Last change
on this file since 0593119 was
0ada33c,
checked in by OpenGnSys Support Team <soporte-og@…>, 5 years ago
|
rename main.py to ogclient
|
-
Property mode set to
100755
|
File size:
854 bytes
|
Rev | Line | |
---|
[87c2a6a] | 1 | #!/usr/bin/python3 |
---|
[99f2951] | 2 | |
---|
[834f5cd] | 3 | # |
---|
| 4 | # Copyright (C) 2020 Soleta Networks <info@soleta.eu> |
---|
| 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 |
---|
| 8 | # Free Software Foundation, version 3. |
---|
| 9 | # |
---|
| 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.