Compare commits
No commits in common. "6f1bf1ba1fd11f11400fc9fef1804e872deb60bd" and "8568e352be11414544f874c7fbd1b34845af7b6b" have entirely different histories.
6f1bf1ba1f
...
8568e352be
@ -36,22 +36,6 @@ class Account(Person):
|
|||||||
logg.debug('tags are now {}'.format(self.tags))
|
logg.debug('tags are now {}'.format(self.tags))
|
||||||
|
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def deserialize(cls, person_data):
|
|
||||||
o = super(Account, cls).deserialize(person_data)
|
|
||||||
try:
|
|
||||||
o.tags = person_data['custom']['tags']
|
|
||||||
except KeyError as e:
|
|
||||||
pass
|
|
||||||
return o
|
|
||||||
|
|
||||||
|
|
||||||
def serialize(self):
|
|
||||||
o = super(Account, self).serialize()
|
|
||||||
o['custom'] = {}
|
|
||||||
o['custom']['tags'] = self.tags
|
|
||||||
return o
|
|
||||||
|
|
||||||
|
|
||||||
class FileUserStore:
|
class FileUserStore:
|
||||||
|
|
||||||
@ -110,6 +94,7 @@ class FileUserStore:
|
|||||||
sp = os.path.join(s_h, '.stick_' + s_t)
|
sp = os.path.join(s_h, '.stick_' + s_t)
|
||||||
f = open(sp, 'w')
|
f = open(sp, 'w')
|
||||||
f.close()
|
f.close()
|
||||||
|
logg.debug('wrote {}'.format(sp))
|
||||||
|
|
||||||
|
|
||||||
def __is_sticky(self, p):
|
def __is_sticky(self, p):
|
||||||
@ -162,8 +147,6 @@ class FileUserStore:
|
|||||||
f = open(p, 'r')
|
f = open(p, 'r')
|
||||||
r = f.read()
|
r = f.read()
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
logg.debug('retrieved {} from {}'.format(k, p))
|
|
||||||
return r.strip()
|
return r.strip()
|
||||||
|
|
||||||
|
|
||||||
@ -184,6 +167,7 @@ class FileUserStore:
|
|||||||
logg.info(e)
|
logg.info(e)
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
#getter = MetadataRequestsHandler(MetadataPointer.PHONE, phone.encode('utf-8'))
|
||||||
r = None
|
r = None
|
||||||
user_address = None
|
user_address = None
|
||||||
try:
|
try:
|
||||||
@ -211,7 +195,6 @@ class FileUserStore:
|
|||||||
try:
|
try:
|
||||||
person_data = person.deserialize(person_data=v)
|
person_data = person.deserialize(person_data=v)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logg.error('e {}'.format(e))
|
|
||||||
person_data = v
|
person_data = v
|
||||||
return person_data
|
return person_data
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
@ -234,6 +217,7 @@ class FileUserStore:
|
|||||||
data = json.loads(r)
|
data = json.loads(r)
|
||||||
person = Account()
|
person = Account()
|
||||||
person_data = person.deserialize(person_data=data)
|
person_data = person.deserialize(person_data=data)
|
||||||
|
self.put(address, json.dumps(person_data.serialize()), force=update)
|
||||||
|
|
||||||
ptr = generate_metadata_pointer(bytes.fromhex(address), MetadataPointer.CUSTOM)
|
ptr = generate_metadata_pointer(bytes.fromhex(address), MetadataPointer.CUSTOM)
|
||||||
r = None
|
r = None
|
||||||
@ -244,6 +228,4 @@ class FileUserStore:
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
self.put(address, json.dumps(person_data.serialize()), force=update)
|
|
||||||
|
|
||||||
return person_data
|
return person_data
|
||||||
|
Loading…
Reference in New Issue
Block a user