source:
ogClient-Git/ogclient
@
082079a
Last change on this file since 082079a was cb9edc8, checked in by , 4 years ago | |
---|---|
|
|
File size: 920 bytes |
Rev | Line | |
---|---|---|
[87c2a6a] | 1 | #!/usr/bin/python3 |
[99f2951] | 2 | |
[834f5cd] | 3 | # |
[cb9edc8] | 4 | # Copyright (C) 2020-2021 Soleta Networks <info@soleta.eu> |
[834f5cd] | 5 | # |
6 | # This program is free software: you can redistribute it and/or modify it under | |
7 | # the terms of the GNU Affero General Public License as published by the | |
[cb9edc8] | 8 | # Free Software Foundation; either version 3 of the License, or |
9 | # (at your option) any later version. | |
[834f5cd] | 10 | |
[38b6d77] | 11 | import json |
[bf69d20] | 12 | import subprocess |
[834f5cd] | 13 | from src.ogClient import * |
14 | from signal import signal, SIGPIPE, SIG_DFL | |
15 | ||
16 | def main(): | |
17 | signal(SIGPIPE, SIG_DFL) | |
[d7b7b0b] | 18 | config_path = f'{ogClient.OG_PATH}ogclient/cfg/ogclient.json' |
[38b6d77] | 19 | try: |
20 | with open(config_path, 'r') as f: | |
21 | CONFIG = json.load(f) | |
22 | except: | |
23 | print('Error: Parsing configuration file') | |
[834f5cd] | 24 | return 0 |
25 | ||
[38b6d77] | 26 | MODE = CONFIG['opengnsys']['mode'] |
27 | URL = CONFIG['opengnsys']['url'] | |
[1377ace] | 28 | if MODE == 'live': |
[38b6d77] | 29 | proc = subprocess.Popen(["browser", "-qws", URL]) |
[bf69d20] | 30 | |
[38b6d77] | 31 | client = ogClient(config=CONFIG) |
[834f5cd] | 32 | client.connect() |
33 | client.run() | |
34 | ||
35 | if __name__ == "__main__": | |
36 | main() |
Note: See TracBrowser
for help on using the repository browser.