Exemplo n.º 1
0
def load_api_key_secret():
    path = os.path.expanduser('~/.onetoken/config.yml')
    if os.path.isfile(path):
        try:
            js = yaml.load(open(path).read())
            return js['api_key'], js['api_secret'], js['account']
        except:
            log.exception('failed load api key/secret')
    return None, None, None
Exemplo n.º 2
0
def load_api_key_secret(file_path):
    path = os.path.expanduser(file_path)
    if os.path.isfile(path):
        try:
            f_config = open(path)
            js = yaml.load(f_config.read())
            f_config.close()
            return js['api_key'], js['api_secret'], js['account']
        except:
            log.exception('failed load api key/secret')
    return None, None, None