Code Quality
This commit is contained in:
parent
b8e099539e
commit
c734ac7b5f
|
@ -40,7 +40,7 @@ def generate_hash(string):
|
||||||
try:
|
try:
|
||||||
# make input case insensitive
|
# make input case insensitive
|
||||||
string = str.lower(string)
|
string = str.lower(string)
|
||||||
hash_object = hashlib.md5(str.encode(string)) # nosec B303
|
hash_object = hashlib.md5(str.encode(string)) # nosec B303, B324
|
||||||
print(hash_object.hexdigest())
|
print(hash_object.hexdigest())
|
||||||
# returned object is a hex string
|
# returned object is a hex string
|
||||||
return hash_object.hexdigest()
|
return hash_object.hexdigest()
|
||||||
|
|
|
@ -521,8 +521,8 @@ class singleWorker(StoppableThread):
|
||||||
|
|
||||||
inventoryHash = calculateInventoryHash(payload)
|
inventoryHash = calculateInventoryHash(payload)
|
||||||
Inventory()[inventoryHash] = (
|
Inventory()[inventoryHash] = (
|
||||||
objectType, streamNumber, buffer(payload),
|
objectType, streamNumber, buffer(payload), # noqa: F821
|
||||||
embeddedTime, buffer(tag)
|
embeddedTime, buffer(tag) # noqa: F821
|
||||||
)
|
)
|
||||||
self.logger.info(
|
self.logger.info(
|
||||||
'sending inv (within sendOnionPeerObj function) for object: %s',
|
'sending inv (within sendOnionPeerObj function) for object: %s',
|
||||||
|
|
|
@ -413,7 +413,7 @@ class BMProto(AdvancedDispatcher, ObjectTracker):
|
||||||
try:
|
try:
|
||||||
self.object.checkObjectByType()
|
self.object.checkObjectByType()
|
||||||
objectProcessorQueue.put((
|
objectProcessorQueue.put((
|
||||||
self.object.objectType, buffer(self.object.data)))
|
self.object.objectType, buffer(self.object.data))) # noqa: F821
|
||||||
except BMObjectInvalidError:
|
except BMObjectInvalidError:
|
||||||
BMProto.stopDownloadingObject(self.object.inventoryHash, True)
|
BMProto.stopDownloadingObject(self.object.inventoryHash, True)
|
||||||
else:
|
else:
|
||||||
|
@ -429,8 +429,8 @@ class BMProto(AdvancedDispatcher, ObjectTracker):
|
||||||
|
|
||||||
Inventory()[self.object.inventoryHash] = (
|
Inventory()[self.object.inventoryHash] = (
|
||||||
self.object.objectType, self.object.streamNumber,
|
self.object.objectType, self.object.streamNumber,
|
||||||
buffer(self.payload[objectOffset:]), self.object.expiresTime,
|
buffer(self.payload[objectOffset:]), self.object.expiresTime, # noqa: F821
|
||||||
buffer(self.object.tag)
|
buffer(self.object.tag) # noqa: F821
|
||||||
)
|
)
|
||||||
self.handleReceivedObject(
|
self.handleReceivedObject(
|
||||||
self.object.streamNumber, self.object.inventoryHash)
|
self.object.streamNumber, self.object.inventoryHash)
|
||||||
|
|
Reference in New Issue
Block a user