encrypted .tox files support

This commit is contained in:
ingvar1995 2016-05-15 19:54:44 +03:00
parent 010c15a498
commit 0fa7ca7b5c
4 changed files with 52 additions and 18 deletions

View file

@ -4,6 +4,7 @@ import os
import locale
from util import Singleton, curr_directory, log
import pyaudio
from toxencryptsave import LibToxEncryptSave
class Settings(Singleton, dict):
@ -145,7 +146,6 @@ class Settings(Singleton, dict):
return os.getenv('APPDATA') + '/Tox/'
# TODO: encrypted profiles support
class ProfileHelper(Singleton):
"""
Class with methods for search, load and save profiles
@ -171,6 +171,9 @@ class ProfileHelper(Singleton):
return self._directory
def save_profile(self, data):
inst = LibToxEncryptSave.get_instance()
if inst.has_password():
data = inst.pass_encrypt(data)
with open(self._path, 'wb') as fl:
fl.write(data)
print 'Profile saved successfully'