Fixed flake8 CQ issues

This commit is contained in:
navjot 2020-12-29 13:58:48 +05:30
parent 46e2f04488
commit 7a010441c3
No known key found for this signature in database
GPG Key ID: 9EE70AFD71357F1C
3 changed files with 7 additions and 4 deletions

View File

@ -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):

View File

@ -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))

View File

@ -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)
self.assertLess(a[x + 1] - a[x], 10)