forked from luna/vim-rana-local
upgrade wakatime-cli to v6.0.6
This commit is contained in:
parent
73710edd4a
commit
2701f8a381
4 changed files with 15 additions and 12 deletions
|
@ -1,7 +1,7 @@
|
|||
__title__ = 'wakatime'
|
||||
__description__ = 'Common interface to the WakaTime api.'
|
||||
__url__ = 'https://github.com/wakatime/wakatime'
|
||||
__version_info__ = ('6', '0', '5')
|
||||
__version_info__ = ('6', '0', '6')
|
||||
__version__ = '.'.join(__version_info__)
|
||||
__author__ = 'Alan Hamlett'
|
||||
__author_email__ = 'alan@wakatime.com'
|
||||
|
|
|
@ -73,11 +73,15 @@ class JsonFormatter(logging.Formatter):
|
|||
|
||||
|
||||
def traceback_formatter(*args, **kwargs):
|
||||
if 'level' in kwargs and (kwargs['level'].lower() == 'warn' or kwargs['level'].lower() == 'warning'):
|
||||
try:
|
||||
level = kwargs.get('level', args[0]).lower()
|
||||
except:
|
||||
level = None
|
||||
if level == 'warn' or level == 'warning':
|
||||
logging.getLogger('WakaTime').warning(traceback.format_exc())
|
||||
elif 'level' in kwargs and kwargs['level'].lower() == 'info':
|
||||
elif level == 'info':
|
||||
logging.getLogger('WakaTime').info(traceback.format_exc())
|
||||
elif 'level' in kwargs and kwargs['level'].lower() == 'debug':
|
||||
elif level == 'debug':
|
||||
logging.getLogger('WakaTime').debug(traceback.format_exc())
|
||||
else:
|
||||
logging.getLogger('WakaTime').error(traceback.format_exc())
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
|
||||
import logging
|
||||
import os
|
||||
import traceback
|
||||
from time import sleep
|
||||
|
||||
try:
|
||||
|
@ -70,7 +69,7 @@ class Queue(object):
|
|||
conn.commit()
|
||||
conn.close()
|
||||
except sqlite3.Error:
|
||||
log.error(traceback.format_exc())
|
||||
log.traceback()
|
||||
|
||||
def pop(self):
|
||||
if not HAS_SQL: # pragma: nocover
|
||||
|
@ -81,7 +80,7 @@ class Queue(object):
|
|||
try:
|
||||
conn, c = self.connect()
|
||||
except sqlite3.Error:
|
||||
log.debug(traceback.format_exc())
|
||||
log.traceback('debug')
|
||||
return None
|
||||
loop = True
|
||||
while loop and tries > -1:
|
||||
|
@ -119,11 +118,11 @@ class Queue(object):
|
|||
}
|
||||
loop = False
|
||||
except sqlite3.Error: # pragma: nocover
|
||||
log.debug(traceback.format_exc())
|
||||
log.traceback('debug')
|
||||
sleep(wait)
|
||||
tries -= 1
|
||||
try:
|
||||
conn.close()
|
||||
except sqlite3.Error: # pragma: nocover
|
||||
log.debug(traceback.format_exc())
|
||||
log.traceback('debug')
|
||||
return heartbeat
|
||||
|
|
|
@ -20,8 +20,8 @@ from .packages import (
|
|||
get_lexer_by_name,
|
||||
guess_lexer_for_filename,
|
||||
get_filetype_from_buffer,
|
||||
ClassNotFound,
|
||||
)
|
||||
from .packages.pygments.lexers import ClassNotFound
|
||||
|
||||
try:
|
||||
from .packages import simplejson as json # pragma: nocover
|
||||
|
@ -108,7 +108,7 @@ def guess_lexer_using_modeline(text):
|
|||
if file_type is not None:
|
||||
try:
|
||||
lexer = get_lexer_by_name(file_type)
|
||||
except: # pragma: nocover
|
||||
except ClassNotFound:
|
||||
pass
|
||||
|
||||
if lexer is not None:
|
||||
|
@ -231,7 +231,7 @@ def get_file_head(file_name):
|
|||
try:
|
||||
with open(file_name, 'r', encoding='utf-8') as fh:
|
||||
text = fh.read(512000)
|
||||
except: # pragma: nocover
|
||||
except:
|
||||
try:
|
||||
with open(file_name, 'r', encoding=sys.getfilesystemencoding()) as fh:
|
||||
text = fh.read(512000)
|
||||
|
|
Loading…
Reference in a new issue