Ver Fonte

Various bug fixes

oz123 há 10 anos atrás
pai
commit
624612922d

+ 2 - 2
pwman/__init__.py

@@ -14,7 +14,7 @@
 # along with Pwman3; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 # ============================================================================
-# Copyright (C) 2012 Oz Nahum <nahumoz@gmail.com>
+# Copyright (C) 2012 Oz Nahum Tiram <nahumoz@gmail.com>
 # ============================================================================
 # Copyright (C) 2006 Ivan Kelly <ivan@ivankelly.net>
 # ============================================================================
@@ -37,7 +37,7 @@ except pkg_resources.DistributionNotFound:  # pragma: no cover
     version = u"0.5"
 
 website = "http://pwman3.github.io/pwman3/"
-author = "Oz Nahum"
+author = "Oz Nahum Tiram"
 authoremail = "nahumoz@gmail.com"
 description = "a command line password management application."
 keywords = "password management sqlite crypto"

+ 4 - 4
pwman/data/database.py

@@ -1,4 +1,4 @@
-#============================================================================
+# ============================================================================
 # This file is part of Pwman3.
 #
 # Pwman3 is free software; you can redistribute it and/or modify
@@ -13,11 +13,11 @@
 # You should have received a copy of the GNU General Public License
 # along with Pwman3; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-#============================================================================
+# ============================================================================
 # Copyright (C) 2012 Oz Nahum <nahumoz@gmail.com>
-#============================================================================
+# ============================================================================
 # Copyright (C) 2006 Ivan Kelly <ivan@ivankelly.net>
-#============================================================================
+# ============================================================================
 
 from pwman.util.crypto_engine import CryptoEngine
 

+ 5 - 2
pwman/data/drivers/sqlite.py

@@ -517,8 +517,11 @@ class SQLite(SQLiteDatabaseNewForm):
         return _keycrypted
         """
         sql = "SELECT * FROM CRYPTO"
-        seed, digest = self._cur.execute(sql).fetchone()
-        return seed + u'$6$' + digest
+        try:
+            seed, digest = self._cur.execute(sql).fetchone()
+            return seed + u'$6$' + digest
+        except TypeError:
+            return None
 
     def close(self):
         self._clean_orphands()

+ 5 - 2
pwman/data/nodes.py

@@ -137,7 +137,8 @@ class Node(object):
             self._password = enc.encrypt(kwargs.get('password')).strip()
             self._url = enc.encrypt(kwargs.get('url')).strip()
             self._notes = enc.encrypt(kwargs.get('notes')).strip()
-            self._tags = [enc.encrypt(t).strip() for t in kwargs.get('tags')]
+            _tags = [enc.encrypt(t).strip() for t in kwargs.get('tags')]
+            self._tags = _tags
 
     @classmethod
     def from_encrypted_entries(cls, username, password, url, notes, tags):
@@ -154,7 +155,9 @@ class Node(object):
         return node
 
     def __repr__(self):
-        """we use this method to write node to the database"""
+        """we use this method to write node to the database,
+        this is only practical if node is a blob!
+        However, the new db uses a clear table structure."""
         res = u''
         tags = self.__dict__.pop('_tags', None)
         for item in self.__dict__:

+ 0 - 1
pwman/exchange/importer.py

@@ -43,7 +43,6 @@ class CSVImporter(BaseImporter):
         self.args = args
         self.config = config
         self._db = db
-import ipdb; ipdb.set_trace()
 
     def _read_file(self):
         """read the csv file, remove empty lines and the header"""