MCPcopy Index your code
hub / github.com/Bitmessage/PyBitmessage / Inventory

Class Inventory

src/inventory.py:17–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15
16@Singleton
17class Inventory():
18 def __init__(self):
19 #super(self.__class__, self).__init__()
20 self._moduleName = BMConfigParser().safeGet("inventory", "storage")
21 #import_module("." + self._moduleName, "storage")
22 #import_module("storage." + self._moduleName)
23 self._className = "storage." + self._moduleName + "." + self._moduleName.title() + "Inventory"
24 self._inventoryClass = eval(self._className)
25 self._realInventory = self._inventoryClass()
26 self.numberOfInventoryLookupsPerformed = 0
27
28 # cheap inheritance copied from asyncore
29 def __getattr__(self, attr):
30 try:
31 if attr == "__contains__":
32 self.numberOfInventoryLookupsPerformed += 1
33 realRet = getattr(self._realInventory, attr)
34 except AttributeError:
35 raise AttributeError("%s instance has no attribute '%s'" %(self.__class__.__name__, attr))
36 else:
37 return realRet
38
39
40class PendingDownloadQueue(Queue.Queue):

Calls

no outgoing calls

Tested by

no test coverage detected