5 Copyright (C) e2its - All Rights Reserved 6 * Unauthorized copying of this file, via any medium is strictly prohibited 7 * Proprietary and confidential 9 * This file is part of gDayF project. 11 * Written by Jose L. Sanchez <e2its.es@gmail.com>, 2016-2019 14 from collections
import OrderedDict
16 from os
import path, makedirs
17 from shutil
import copyfile
30 configpath = path.join(path.dirname(__file__),
'../../../.config')
31 configfile = path.join(configpath,
'config.json')
32 user_configpath = path.join(configpath, user_id)
33 user_configfile = path.join(user_configpath,
'config.json')
34 if not path.exists(user_configfile):
36 makedirs(user_configpath, mode=0o755, exist_ok=
True)
37 copyfile(configfile, user_configfile)
46 self.
_config = json.load(f, object_hook=OrderedDict, encoding=
'utf8')
76 configpath = path.join(path.dirname(__file__),
'../../../.config')
77 configfile = path.join(configpath,
'labels.json')
82 with open(configfile,
'rt')
as f:
84 self.
_config = json.load(f, object_hook=OrderedDict, encoding=
'utf8')[lang]
Class Getting the config file place on default location and load all parameters on an internal variab...
def __init__(self, lang='en')
Constructor.
Class Getting the config file place on default location and load all labels named self...
def get_config(self)
Returns OrderedDict with all system labels.
def get_configfile(self)
Returns labelsfile path.
def get_config(self)
Returns OrderedDict with all system configuration.
def __init__(self, user_id='PoC_gDayF')
Constructor.
def get_configfile(self)
Returns configfile path.