From 7a010441c3bffd60b217c15cc807877d40dd691d Mon Sep 17 00:00:00 2001 From: navjot Date: Tue, 29 Dec 2020 13:58:48 +0530 Subject: [PATCH] Fixed flake8 CQ issues --- src/randomtrackingdict.py | 2 +- src/storage/filesystem.py | 7 +++++-- src/tests/test_randomtrackingdict.py | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/randomtrackingdict.py b/src/randomtrackingdict.py index 4b265f82..cb4e310d 100644 --- a/src/randomtrackingdict.py +++ b/src/randomtrackingdict.py @@ -4,7 +4,7 @@ Track randomize ordered dict from threading import RLock from time import time -from pybitmessage import helper_random +import helper_random class RandomTrackingDict(object): diff --git a/src/storage/filesystem.py b/src/storage/filesystem.py index 82ec9feb..150e8d9e 100644 --- a/src/storage/filesystem.py +++ b/src/storage/filesystem.py @@ -1,16 +1,18 @@ """ Module for using filesystem (directory with files) for inventory storage """ +import logging import string import time from binascii import hexlify, unhexlify from os import listdir, makedirs, path, remove, rmdir from threading import RLock -from debug import logger from paths import lookupAppdataFolder from storage import InventoryItem, InventoryStorage +logger = logging.getLogger('default') + class FilesystemInventory(InventoryStorage): """Filesystem for inventory storage""" @@ -163,7 +165,8 @@ class FilesystemInventory(InventoryStorage): newInventory[streamNumber][hashId] = InventoryItem( objectType, streamNumber, None, expiresTime, tag) except KeyError: - logger.warning('error loading %s', hexlify(hashId)) + logger.debug( + 'error loading %s', hexlify(hashId), exc_info=True) self._inventory = newInventory # for i, v in self._inventory.items(): # print "loaded stream: %s, %i items" % (i, len(v)) diff --git a/src/tests/test_randomtrackingdict.py b/src/tests/test_randomtrackingdict.py index 9cad05b3..40d2e01b 100644 --- a/src/tests/test_randomtrackingdict.py +++ b/src/tests/test_randomtrackingdict.py @@ -46,4 +46,4 @@ class TestRandomTrackingDict(unittest.TestCase): a.append(time()) for x in range(len(a) - 1): - self.assertLess(a[x + 1] - a[x], 10) \ No newline at end of file + self.assertLess(a[x + 1] - a[x], 10)