Get rid of evals
- eval is evil. Get rid of the remaining evals. They were not assessed as dangerous but it's matter of policy now.
This commit is contained in:
parent
616920e21a
commit
07149c73c8
|
@ -375,10 +375,9 @@ def bmSettings(): #Allows the viewing and modification of keys.dat settings.
|
||||||
main()
|
main()
|
||||||
|
|
||||||
def validAddress(address):
|
def validAddress(address):
|
||||||
address_information = api.decodeAddress(address)
|
address_information = json.loads(api.decodeAddress(address))
|
||||||
address_information = eval(address_information)
|
|
||||||
|
|
||||||
if 'success' in str(address_information.get('status')).lower():
|
if 'success' in str(address_information['status']).lower():
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
@ -1346,15 +1345,14 @@ def UI(usrInput): #Main user menu
|
||||||
|
|
||||||
elif usrInput == "addinfo":
|
elif usrInput == "addinfo":
|
||||||
tmp_address = userInput('\nEnter the Bitmessage Address.')
|
tmp_address = userInput('\nEnter the Bitmessage Address.')
|
||||||
address_information = api.decodeAddress(tmp_address)
|
address_information = json.loads(api.decodeAddress(tmp_address))
|
||||||
address_information = eval(address_information)
|
|
||||||
|
|
||||||
print '\n------------------------------'
|
print '\n------------------------------'
|
||||||
|
|
||||||
if 'success' in str(address_information.get('status')).lower():
|
if 'success' in str(address_information['status']).lower():
|
||||||
print ' Valid Address'
|
print ' Valid Address'
|
||||||
print ' Address Version: %s' % str(address_information.get('addressVersion'))
|
print ' Address Version: %s' % str(address_information['addressVersion'])
|
||||||
print ' Stream Number: %s' % str(address_information.get('streamNumber'))
|
print ' Stream Number: %s' % str(address_information['streamNumber'])
|
||||||
else:
|
else:
|
||||||
print ' Invalid Address !'
|
print ' Invalid Address !'
|
||||||
|
|
||||||
|
|
|
@ -18,10 +18,7 @@ class Inventory():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
#super(self.__class__, self).__init__()
|
#super(self.__class__, self).__init__()
|
||||||
self._moduleName = BMConfigParser().safeGet("inventory", "storage")
|
self._moduleName = BMConfigParser().safeGet("inventory", "storage")
|
||||||
#import_module("." + self._moduleName, "storage")
|
self._inventoryClass = getattr(getattr(storage, self._moduleName), "{}Inventory".format(self._moduleName.title()))
|
||||||
#import_module("storage." + self._moduleName)
|
|
||||||
self._className = "storage." + self._moduleName + "." + self._moduleName.title() + "Inventory"
|
|
||||||
self._inventoryClass = eval(self._className)
|
|
||||||
self._realInventory = self._inventoryClass()
|
self._realInventory = self._inventoryClass()
|
||||||
self.numberOfInventoryLookupsPerformed = 0
|
self.numberOfInventoryLookupsPerformed = 0
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user