diff --git a/src/paths.py b/src/paths.py index 376dbf6a..b203680a 100644 --- a/src/paths.py +++ b/src/paths.py @@ -3,7 +3,6 @@ src/paths.py ============ """ # pylint: disable=import-error - import logging import os import re @@ -12,7 +11,6 @@ from datetime import datetime from shutil import move from kivy.utils import platform - logger = logging.getLogger('default') # When using py2exe or py2app, the variable frozen is added to the sys @@ -54,8 +52,7 @@ def lookupAppdataFolder(): 'Could not find home folder, please report this message' ' and your OS X version to the BitMessage Github.') elif platform == 'android': - dataFolder = os.path.join( - os.environ['ANDROID_PRIVATE'] + '/', APPNAME) + '/' + dataFolder = os.path.join(os.environ['ANDROID_PRIVATE'] + '/', APPNAME) + '/' elif 'win32' in sys.platform or 'win64' in sys.platform: dataFolder = os.path.join( os.environ['APPDATA'].decode( @@ -88,6 +85,7 @@ def codePath(): if frozen == "macosx_app" else sys._MEIPASS) + def tail(f, lines=20): """Returns last lines in the f file object""" total_lines_wanted = lines @@ -97,9 +95,9 @@ def tail(f, lines=20): block_end_byte = f.tell() lines_to_go = total_lines_wanted block_number = -1 + blocks = [] # blocks of size BLOCK_SIZE, in reverse order starting # from the end of the file - blocks = [] while lines_to_go > 0 and block_end_byte > 0: if block_end_byte - BLOCK_SIZE > 0: # read the last block we haven't yet read @@ -134,4 +132,4 @@ def lastCommit(): ) except (IOError, AttributeError, TypeError): pass - return result + return result \ No newline at end of file