config file not needed when passing api key via command line

This commit is contained in:
Alan Hamlett 2017-03-16 08:10:15 -07:00
parent bd7c136606
commit c22990a38a
8 changed files with 139 additions and 32 deletions

View file

@ -128,8 +128,6 @@ def parseArguments():
# parse ~/.wakatime.cfg file
configs = parseConfigFile(args.config)
if configs is None:
return args, configs
# update args from configs
if not args.hostname:

View file

@ -13,10 +13,9 @@
from __future__ import print_function
import os
import sys
import traceback
from .compat import u, open
from .compat import open
from .constants import CONFIG_FILE_PARSE_ERROR
@ -48,8 +47,7 @@ def parseConfigFile(configFile=None):
configs.read_file(fh)
except configparser.Error:
print(traceback.format_exc())
return None
raise SystemExit(CONFIG_FILE_PARSE_ERROR)
except IOError:
sys.stderr.write(u("Error: Could not read from config file {0}\n").format(u(configFile)))
raise SystemExit(CONFIG_FILE_PARSE_ERROR)
pass
return configs

View file

@ -29,7 +29,6 @@ from .compat import u, is_py3
from .constants import (
API_ERROR,
AUTH_ERROR,
CONFIG_FILE_PARSE_ERROR,
SUCCESS,
UNKNOWN_ERROR,
MALFORMED_HEARTBEAT_ERROR,
@ -293,8 +292,6 @@ def execute(argv=None):
sys.argv = ['wakatime'] + argv
args, configs = parseArguments()
if configs is None:
return CONFIG_FILE_PARSE_ERROR
setup_logging(args, __version__)