diff options
author | drebs <drebs@leap.se> | 2013-02-10 00:46:36 -0200 |
---|---|---|
committer | drebs <drebs@leap.se> | 2013-02-10 00:46:36 -0200 |
commit | 86b8f78e7d4ac3e3e47535604713c497a8b68936 (patch) | |
tree | 5e89750ba7454e388ac185d2235167d52ddee2de /src/leap/soledad/__init__.py | |
parent | 3f8460cd2506ff78971f2ddb0edf4d0b0f009d12 (diff) |
Soledad can be instantiated in different directories.
Diffstat (limited to 'src/leap/soledad/__init__.py')
-rw-r--r-- | src/leap/soledad/__init__.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/leap/soledad/__init__.py b/src/leap/soledad/__init__.py index e11b8319..4b7a12df 100644 --- a/src/leap/soledad/__init__.py +++ b/src/leap/soledad/__init__.py @@ -21,13 +21,15 @@ class Soledad(object): # other configs SECRET_LENGTH = 50 - def __init__(self, user_email, gpghome=None, initialize=True): + def __init__(self, user_email, gpghome=None, initialize=True, + prefix=None, secret_path=None, local_db_path=None): self._user_email = user_email + self.PREFIX = prefix or self.PREFIX + self.SECRET_PATH = secret_path or self.SECRET_PATH + self.LOCAL_DB_PATH = local_db_path or self.LOCAL_DB_PATH if not os.path.isdir(self.PREFIX): os.makedirs(self.PREFIX) - if not gpghome: - gpghome = self.GNUPG_HOME - self._gpg = GPGWrapper(gpghome=gpghome) + self._gpg = GPGWrapper(gpghome=(gpghome or self.GNUPG_HOME)) if initialize: self._initialize() |