upgrade wakatime-cli to v6.2.0

This commit is contained in:
Alan Hamlett 2016-10-24 12:39:37 +02:00
parent eaa3bb5180
commit 9167eb2558
3 changed files with 18 additions and 5 deletions

View file

@ -1,7 +1,7 @@
__title__ = 'wakatime' __title__ = 'wakatime'
__description__ = 'Common interface to the WakaTime api.' __description__ = 'Common interface to the WakaTime api.'
__url__ = 'https://github.com/wakatime/wakatime' __url__ = 'https://github.com/wakatime/wakatime'
__version_info__ = ('6', '0', '9') __version_info__ = ('6', '2', '0')
__version__ = '.'.join(__version_info__) __version__ = '.'.join(__version_info__)
__author__ = 'Alan Hamlett' __author__ = 'Alan Hamlett'
__author_email__ = 'alan@wakatime.com' __author_email__ = 'alan@wakatime.com'

View file

@ -117,9 +117,9 @@ class DependencyParser(object):
try: try:
self.parser = getattr(module, class_name) self.parser = getattr(module, class_name)
except AttributeError: except AttributeError:
log.debug('Module {0} is missing class {1}'.format(module.__name__, class_name)) log.debug('Parsing dependencies not supported for {0}.{1}'.format(module_name, class_name))
except ImportError: except ImportError:
log.traceback(logging.DEBUG) log.debug('Parsing dependencies not supported for {0}.{1}'.format(module_name, class_name))
def parse(self): def parse(self):
if self.parser: if self.parser:

View file

@ -74,6 +74,12 @@ def parseConfigFile(configFile=None):
at ~/.wakatime.cfg. at ~/.wakatime.cfg.
""" """
# get config file location from ENV
home = os.environ.get('WAKATIME_HOME')
if not configFile and home:
configFile = os.path.join(os.path.expanduser(home), '.wakatime.cfg')
# use default config file location
if not configFile: if not configFile:
configFile = os.path.join(os.path.expanduser('~'), '.wakatime.cfg') configFile = os.path.join(os.path.expanduser('~'), '.wakatime.cfg')
@ -86,7 +92,8 @@ def parseConfigFile(configFile=None):
print(traceback.format_exc()) print(traceback.format_exc())
return None return None
except IOError: except IOError:
print(u('Error: Could not read from config file {0}').format(u(configFile))) sys.stderr.write(u("Error: Could not read from config file {0}\n").format(u(configFile)))
raise SystemExit(CONFIG_FILE_PARSE_ERROR)
return configs return configs
@ -197,7 +204,10 @@ def parseArguments():
if default_key: if default_key:
args.key = default_key args.key = default_key
else: else:
try:
parser.error('Missing api key') parser.error('Missing api key')
except SystemExit:
raise SystemExit(AUTH_ERROR)
if not args.entity: if not args.entity:
if args.file: if args.file:
args.entity = args.file args.entity = args.file
@ -240,6 +250,9 @@ def parseArguments():
args.verbose = configs.getboolean('settings', 'debug') args.verbose = configs.getboolean('settings', 'debug')
if not args.logfile and configs.has_option('settings', 'logfile'): if not args.logfile and configs.has_option('settings', 'logfile'):
args.logfile = configs.get('settings', 'logfile') args.logfile = configs.get('settings', 'logfile')
if not args.logfile and os.environ.get('WAKATIME_HOME'):
home = os.environ.get('WAKATIME_HOME')
args.logfile = os.path.join(os.path.expanduser(home), '.wakatime.log')
if not args.api_url and configs.has_option('settings', 'api_url'): if not args.api_url and configs.has_option('settings', 'api_url'):
args.api_url = configs.get('settings', 'api_url') args.api_url = configs.get('settings', 'api_url')
if not args.timeout and configs.has_option('settings', 'timeout'): if not args.timeout and configs.has_option('settings', 'timeout'):