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))
|
||||
|
||||
|
||||
@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:
|
||||
|
||||
@ -110,6 +94,7 @@ class FileUserStore:
|
||||
sp = os.path.join(s_h, '.stick_' + s_t)
|
||||
f = open(sp, 'w')
|
||||
f.close()
|
||||
logg.debug('wrote {}'.format(sp))
|
||||
|
||||
|
||||
def __is_sticky(self, p):
|
||||
@ -162,8 +147,6 @@ class FileUserStore:
|
||||
f = open(p, 'r')
|
||||
r = f.read()
|
||||
f.close()
|
||||
|
||||
logg.debug('retrieved {} from {}'.format(k, p))
|
||||
return r.strip()
|
||||
|
||||
|
||||
@ -184,6 +167,7 @@ class FileUserStore:
|
||||
logg.info(e)
|
||||
pass
|
||||
|
||||
#getter = MetadataRequestsHandler(MetadataPointer.PHONE, phone.encode('utf-8'))
|
||||
r = None
|
||||
user_address = None
|
||||
try:
|
||||
@ -211,7 +195,6 @@ class FileUserStore:
|
||||
try:
|
||||
person_data = person.deserialize(person_data=v)
|
||||
except Exception as e:
|
||||
logg.error('e {}'.format(e))
|
||||
person_data = v
|
||||
return person_data
|
||||
except FileNotFoundError:
|
||||
@ -234,6 +217,7 @@ class FileUserStore:
|
||||
data = json.loads(r)
|
||||
person = Account()
|
||||
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)
|
||||
r = None
|
||||
@ -244,6 +228,4 @@ class FileUserStore:
|
||||
except Exception as e:
|
||||
pass
|
||||
|
||||
self.put(address, json.dumps(person_data.serialize()), force=update)
|
||||
|
||||
return person_data
|
||||
|
Loading…
Reference in New Issue
Block a user