From 6679d58c9658a3c513abf0dc0aaa5f88e4416001 Mon Sep 17 00:00:00 2001 From: drebs Date: Sun, 10 Feb 2013 00:46:36 -0200 Subject: Soledad can be instantiated in different directories. --- __init__.py | 10 ++++++---- 1 file 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() -- cgit v1.2.3