source: ogClient-Git/main.py @ 6764fc4

Last change on this file since 6764fc4 was 7548870, checked in by Alvaro Neira Ayuso <alvaroneay@…>, 5 years ago

Port program to Python 3

Python 2.7 will be deprecated in January of 2020. So, we need to have the program
with a supported api.

  • Property mode set to 100644
File size: 423 bytes
Line 
1from src.ogClient import *
2from src.ogConfig import *
3
4def main():
5        ogconfig = ogConfig()
6        if (not ogconfig.parserFile('cfg/ogagent.cfg')):
7                print ('Error: Parsing configuration file')
8                return 0
9
10        ip = ogconfig.getValueSection('opengnsys', 'ip')
11        port = ogconfig.getValueSection('opengnsys', 'port')
12
13        client = ogClient(ip, int(port))
14        client.connect()
15        client.run()
16
17if __name__ == "__main__":
18        main()
Note: See TracBrowser for help on using the repository browser.