forked from luna/vim-rana-local
update wakatime package
This commit is contained in:
parent
cd41341d33
commit
cde423ac86
1 changed files with 13 additions and 1 deletions
|
@ -27,6 +27,12 @@ log = logging.getLogger(__name__)
|
|||
EXTENSIONS = {
|
||||
'md': 'Markdown',
|
||||
}
|
||||
TRANSLATIONS = {
|
||||
'JavaScript+Lasso': 'JavaScript',
|
||||
'CSS+Lasso': 'CSS',
|
||||
'CSS+Genshi Text': 'CSS',
|
||||
'Perl6': 'Perl',
|
||||
}
|
||||
|
||||
|
||||
def guess_language(file_name):
|
||||
|
@ -41,7 +47,7 @@ def guess_language(file_name):
|
|||
except:
|
||||
pass
|
||||
if lexer:
|
||||
return str(lexer.name)
|
||||
return translate_language(str(lexer.name))
|
||||
else:
|
||||
return None
|
||||
|
||||
|
@ -55,6 +61,12 @@ def guess_language_from_extension(extension):
|
|||
return None
|
||||
|
||||
|
||||
def translate_language(language):
|
||||
if language in TRANSLATIONS:
|
||||
language = TRANSLATIONS[language]
|
||||
return language
|
||||
|
||||
|
||||
def number_lines_in_file(file_name):
|
||||
lines = 0
|
||||
try:
|
||||
|
|
Loading…
Reference in a new issue