Upgrade wakatime-cli to v8.0.2

This commit is contained in:
Alan Hamlett
2017-05-24 23:53:28 -07:00
parent 453d96bf9c
commit 2f14009279
6 changed files with 161 additions and 52 deletions

View File

@@ -15,6 +15,7 @@ import re
import sys
from .compat import u, open
from .constants import MAX_FILE_SIZE_SUPPORTED
from .dependencies import DependencyParser
from .language_priorities import LANGUAGES
@@ -184,6 +185,11 @@ def get_language_from_extension(file_name):
def number_lines_in_file(file_name):
try:
if os.path.getsize(file_name) > MAX_FILE_SIZE_SUPPORTED:
return None
except os.error:
pass
lines = 0
try:
with open(file_name, 'r', encoding='utf-8') as fh: