Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add missing default auth file #4824

Merged
merged 2 commits into from
Aug 27, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions pokecli.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,16 +290,17 @@ def _json_loader(filename):
parser.add_argument("-af", "--auth", help="Auth File to use")

for _config in ['auth', 'config']:
config_file = os.path.join(_base_dir, 'configs', _config + '.json')
config_arg = parser.parse_known_args() and parser.parse_known_args()[0].__dict__[_config] or None

if config_arg and os.path.isfile(config_arg):
_json_loader(config_arg)
config_file = config_arg if _config == 'config' else config_file
config_file = config_arg
elif os.path.isfile(config_file):
logger.info('No ' + _config + ' argument specified, checking for /configs/' + _config + '.json')
logger.info('No ' + _config + ' argument specified, checking for ' + config_file)
_json_loader(config_file)
else:
logger.info('Error: No /configs/config.json or specified config')
logger.info('Error: No /configs/' + _config + '.json')

# Read passed in Arguments
required = lambda x: not x in load
Expand Down