summaryrefslogtreecommitdiff
path: root/__init__.py
diff options
context:
space:
mode:
authordrebs <drebs@leap.se>2013-02-10 00:46:36 -0200
committerdrebs <drebs@leap.se>2013-02-10 00:46:36 -0200
commit6679d58c9658a3c513abf0dc0aaa5f88e4416001 (patch)
treeb4dafd492e154107e3515724045a811ce3777645 /__init__.py
parente311ab455873571708004dc2710ad0098234bea9 (diff)
Soledad can be instantiated in different directories.
Diffstat (limited to '__init__.py')
-rw-r--r--__init__.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/__init__.py b/__init__.py
index e11b8319..4b7a12df 100644
--- a/__init__.py
+++ b/__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()