def load_config():
"""Load configuration parameters from the settings file"""
if not os.path.exists(gv.USER_SETTINGS_PATH):
logger.info("The user settings file {} was not found! "
"Using hardcoded default values.".format(gv.USER_SETTINGS_PATH))
config = configparser.ConfigParser()
config.read_string(gv.DEFAULT_SETTINGS_INI)
config.read(gv.USER_SETTINGS_PATH)
conf = config['clikraken']
# Get the default currency pair from environment variable if available
# otherwise take the value from the config file.
gv.DEFAULT_PAIR = os.getenv('CLIKRAKEN_DEFAULT_PAIR', conf.get('currency_pair'))
gv.TICKER_PAIRS = os.getenv('CLIKRAKEN_TICKER_PAIRS', conf.get('ticker_currency_pairs'))
# Get the default asset pair from the config file
gv.DEFAULT_ASSET = os.getenv('CLIKRAKEN_DEFAULT_ASSET', conf.get('asset'))
gv.TZ = conf.get('timezone')
gv.TRADING_AGREEMENT = conf.get('trading_agreement')
评论列表
文章目录