def read_balances(): try: balances = storage.read(storage.key('system', "list:balances")) except: balances = {} return balances
def get_runlists(): try: return json.dumps(storage.read(storage.key("system", "list:runlists"))) except RuntimeError: return json.dumps([])
def exists(prefix, postfix): try: return str(storage.read(storage.key(prefix, postfix))) except: return 'Not exists', 404
def dict_remove(prefix, postfix, value): dict_key = storage.key(prefix, postfix) runlist_dict = storage.read(dict_key) runlist_dict.pop(value, None) storage.write(dict_key, runlist_dict)