bug fixes and history export

This commit is contained in:
ingvar1995
2016-03-15 23:35:15 +03:00
parent ae50efa2e6
commit 44e5e7d0a6
5 changed files with 20 additions and 2 deletions

View File

@ -21,6 +21,15 @@ class History(object):
')')
db.close()
def export(self, directory):
path = Settings.get_default_path() + self._name + '.hstr'
new_path = directory + self._name + '.hstr'
with open(path, 'rb') as fin:
data = fin.read()
with open(new_path, 'wb') as fout:
fout.write(data)
print 'History exported to: {}'.format(new_path)
def add_friend_to_db(self, tox_id):
chdir(Settings.get_default_path())
db = connect(self._name + '.hstr')