From 02944dc6a5cc1a86273d8737196338224be276d7 Mon Sep 17 00:00:00 2001 From: drebs Date: Thu, 31 Jan 2013 14:18:09 -0200 Subject: Add ability to close Soledad instance. --- __init__.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to '__init__.py') diff --git a/__init__.py b/__init__.py index 2ed1a369..c9c981c2 100644 --- a/__init__.py +++ b/__init__.py @@ -41,6 +41,9 @@ class Soledad(object): # for symmetric encryption. self._db = sqlcipher.open(self.LOCAL_DB_PATH, True, self._secret) + def close(self): + self._db.close() + #------------------------------------------------------------------------- # Management of secret for symmetric encryption #------------------------------------------------------------------------- @@ -63,6 +66,7 @@ class Soledad(object): try: with open(self.SECRET_PATH) as f: self._secret = str(self._gpg.decrypt(f.read())) + f.close() except IOError: raise IOError('Failed to open secret file %s.' % self.SECRET_PATH) -- cgit v1.2.3