update wakatime package

This commit is contained in:
Alan Hamlett 2013-10-26 17:55:10 -07:00
parent cd41341d33
commit cde423ac86

View file

@ -27,6 +27,12 @@ log = logging.getLogger(__name__)
EXTENSIONS = { EXTENSIONS = {
'md': 'Markdown', 'md': 'Markdown',
} }
TRANSLATIONS = {
'JavaScript+Lasso': 'JavaScript',
'CSS+Lasso': 'CSS',
'CSS+Genshi Text': 'CSS',
'Perl6': 'Perl',
}
def guess_language(file_name): def guess_language(file_name):
@ -41,7 +47,7 @@ def guess_language(file_name):
except: except:
pass pass
if lexer: if lexer:
return str(lexer.name) return translate_language(str(lexer.name))
else: else:
return None return None
@ -55,6 +61,12 @@ def guess_language_from_extension(extension):
return None return None
def translate_language(language):
if language in TRANSLATIONS:
language = TRANSLATIONS[language]
return language
def number_lines_in_file(file_name): def number_lines_in_file(file_name):
lines = 0 lines = 0
try: try: