captcher configparser error
This commit is contained in:
parent
53ecae953c
commit
ddfa0a8a5a
|
@ -24,13 +24,16 @@ def api_auth(user, passwd, host):
|
||||||
def main():
|
def main():
|
||||||
"""Main logic entrypoint"""
|
"""Main logic entrypoint"""
|
||||||
|
|
||||||
config_path = os.path.join(os.path.expanduser("~"), "config.ini")
|
try:
|
||||||
config = configparser.ConfigParser()
|
config_path = os.path.join(os.path.expanduser("~"), "config.ini")
|
||||||
config.read(config_path)
|
config = configparser.ConfigParser()
|
||||||
|
config.read(config_path)
|
||||||
|
|
||||||
API_HOST = config['API']['HOST']
|
API_HOST = config['API']['HOST']
|
||||||
API_USER = config['API']['USER']
|
API_USER = config['API']['USER']
|
||||||
PASSWORD = config['API']['PASSWORD']
|
PASSWORD = config['API']['PASSWORD']
|
||||||
|
except configparser.Error:
|
||||||
|
return
|
||||||
|
|
||||||
auth_token = api_auth(API_USER, PASSWORD, API_HOST)
|
auth_token = api_auth(API_USER, PASSWORD, API_HOST)
|
||||||
print auth_token
|
print auth_token
|
||||||
|
|
Reference in New Issue
Block a user