source: ogClient-Git/main.py @ ffbcf7e

Last change on this file since ffbcf7e was 1377ace, checked in by Roberto Hueso Gómez <rhueso@…>, 5 years ago

Rename 'linux' mode to 'live' mode

'linux' represents ogLive mode that is the reason for the rename.

  • Property mode set to 100755
File size: 850 bytes
Line 
1#!/bin/python3
2
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
11import json
12import subprocess
13from src.ogClient import *
14from signal import signal, SIGPIPE, SIG_DFL
15
16def main():
17        signal(SIGPIPE, SIG_DFL)
18        config_path = f'{ogClient.OG_PATH}ogclient/cfg/ogclient.json'
19        try:
20                with open(config_path, 'r') as f:
21                        CONFIG = json.load(f)
22        except:
23                print('Error: Parsing configuration file')
24                return 0
25
26        MODE = CONFIG['opengnsys']['mode']
27        URL = CONFIG['opengnsys']['url']
28        if MODE == 'live':
29                proc = subprocess.Popen(["browser", "-qws", URL])
30
31        client = ogClient(config=CONFIG)
32        client.connect()
33        client.run()
34
35if __name__ == "__main__":
36        main()
Note: See TracBrowser for help on using the repository browser.