mirror of https://git.48k.eu/ogclient
#1065 revisit config_path initialization
If current platform is Linux (either live, virtual or linux) expect /opt/opengnsys/ogclient/cfg/ to contain ogclient.json. If current platform is not Linux then we fallback to current directory.more_events
parent
f9511932ad
commit
2dbcd18c06
2
ogclient
2
ogclient
|
@ -22,7 +22,7 @@ from src.log import configure_logging
|
|||
|
||||
|
||||
def main():
|
||||
config_path = f'{ogClient.OG_PATH}ogclient/cfg/ogclient.json'
|
||||
config_path = f'{ogClient.OG_PATH}cfg/ogclient.json'
|
||||
try:
|
||||
with open(config_path, 'r') as f:
|
||||
CONFIG = json.load(f)
|
||||
|
|
|
@ -24,7 +24,10 @@ class State(Enum):
|
|||
FORCE_DISCONNECTED = 2
|
||||
|
||||
class ogClient:
|
||||
OG_PATH = '/opt/opengnsys/'
|
||||
if platform.system().lower() == 'linux':
|
||||
OG_PATH = '/opt/opengnsys/ogclient/'
|
||||
else:
|
||||
OG_PATH = './'
|
||||
|
||||
def __init__(self, config):
|
||||
self.CONFIG = config
|
||||
|
|
Loading…
Reference in New Issue