history fix
This commit is contained in:
parent
cfdf145160
commit
be4a592599
1 changed files with 3 additions and 4 deletions
|
@ -22,9 +22,9 @@ class History(object):
|
||||||
path = settings.ProfileHelper.get_path() + self._name + '.hstr'
|
path = settings.ProfileHelper.get_path() + self._name + '.hstr'
|
||||||
if os.path.exists(path):
|
if os.path.exists(path):
|
||||||
decr = LibToxEncryptSave.get_instance()
|
decr = LibToxEncryptSave.get_instance()
|
||||||
if decr.has_password():
|
with open(path, 'rb') as fin:
|
||||||
with open(path, 'rb') as fin:
|
data = fin.read()
|
||||||
data = fin.read()
|
if decr.is_data_encrypted(data):
|
||||||
data = decr.pass_decrypt(data)
|
data = decr.pass_decrypt(data)
|
||||||
with open(path, 'wb') as fout:
|
with open(path, 'wb') as fout:
|
||||||
fout.write(data)
|
fout.write(data)
|
||||||
|
@ -52,7 +52,6 @@ class History(object):
|
||||||
data = fin.read()
|
data = fin.read()
|
||||||
with open(new_path, 'wb') as fout:
|
with open(new_path, 'wb') as fout:
|
||||||
fout.write(data)
|
fout.write(data)
|
||||||
print 'History exported to: {}'.format(new_path)
|
|
||||||
|
|
||||||
def add_friend_to_db(self, tox_id):
|
def add_friend_to_db(self, tox_id):
|
||||||
chdir(settings.ProfileHelper.get_path())
|
chdir(settings.ProfileHelper.get_path())
|
||||||
|
|
Loading…
Reference in a new issue