clikraken_utils.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:clikraken 作者: zertrin 项目源码 文件源码
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')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号