upgrade wakatime-cli to v6.0.9

This commit is contained in:
Alan Hamlett 2016-09-22 10:26:57 +02:00
parent a326046733
commit 24d0f65116
3 changed files with 16 additions and 2 deletions

View file

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

View file

@ -471,6 +471,17 @@ def sync_offline_heartbeats(args, hostname):
return SUCCESS
def format_file_path(filepath):
"""Formats a path as absolute and with the correct platform separator."""
try:
filepath = os.path.realpath(os.path.abspath(filepath))
filepath = re.sub(r'[/\\]', os.path.sep, filepath)
except:
pass # pragma: nocover
return filepath
def process_heartbeat(args, configs, hostname, heartbeat):
exclude = should_exclude(heartbeat['entity'], args.include, args.exclude)
if exclude is not False:
@ -482,6 +493,9 @@ def process_heartbeat(args, configs, hostname, heartbeat):
if heartbeat.get('entity_type') not in ['file', 'domain', 'app']:
heartbeat['entity_type'] = 'file'
if heartbeat['entity_type'] == 'file':
heartbeat['entity'] = format_file_path(heartbeat['entity'])
if heartbeat['entity_type'] != 'file' or os.path.isfile(heartbeat['entity']):
stats = get_file_stats(heartbeat['entity'],

View file

@ -37,7 +37,7 @@
"""
try:
import pkg_resources
except ImportError:
except (ImportError, IOError):
pkg_resources = None
LEXER_ENTRY_POINT = 'pygments.lexers'