Преглед изворни кода

Merge branch 'master' of https://github.com/pwman3/pwman3

oz123 пре 10 година
родитељ
комит
9cdaf78918
6 измењених фајлова са 28 додато и 44 уклоњено
  1. 12 27
      README.md
  2. 8 8
      pwman/data/database.py
  3. 0 3
      pwman/data/drivers/sqlite.py
  4. 1 1
      pwman/data/factory.py
  5. 2 1
      pwman/tests/test_factory.py
  6. 5 4
      pwman/tests/test_pwman.py

+ 12 - 27
README.md

@@ -2,6 +2,7 @@
 
 
 [![Build Status](https://travis-ci.org/pwman3/pwman3.png?branch=master)](https://travis-ci.org/pwman3/pwman3)
 [![Build Status](https://travis-ci.org/pwman3/pwman3.png?branch=master)](https://travis-ci.org/pwman3/pwman3)
 [![Coverage Status](https://coveralls.io/repos/pwman3/pwman3/badge.png)](https://coveralls.io/r/pwman3/pwman3?branch=master)
 [![Coverage Status](https://coveralls.io/repos/pwman3/pwman3/badge.png)](https://coveralls.io/r/pwman3/pwman3?branch=master)
+[![Documentation Status](https://readthedocs.org/projects/pwman3/badge/?version=latest)](https://readthedocs.org/projects/pwman3/?badge=latest)
 
 
 A nice command line password manager, which can use different database to store your passwords (currently, SQLite, MySQL, 
 A nice command line password manager, which can use different database to store your passwords (currently, SQLite, MySQL, 
     and PostGresql are supported).  
     and PostGresql are supported).  
@@ -9,13 +10,18 @@ Pwman3 can also copy passwords to the clipboard without exposing them!
 Besides managing and storing passwords, Pwman3 can also generate passwords using different algorithms. 
 Besides managing and storing passwords, Pwman3 can also generate passwords using different algorithms. 
 
 
 ## Nice Features in pwman3:
 ## Nice Features in pwman3:
-
+ 
+ * Strong AES Encryption
  * copying of passwords to clipboard
  * copying of passwords to clipboard
  * launching specific uri's with default browser
  * launching specific uri's with default browser
  * password generators
  * password generators
  * not really a user oriented feature. However, it guarantees the elimination of silly 
  * not really a user oriented feature. However, it guarantees the elimination of silly 
    bugs: pwman3 is test driven! 
    bugs: pwman3 is test driven! 
 
 
+## Documentation
+
+    http://pwman3.readthedocs.org/en/latest/
+
 ## A very important note about security
 ## A very important note about security
 
 
    If you are a concerned about security, please note:
    If you are a concerned about security, please note:
@@ -37,7 +43,7 @@ Pwman3 requires the following debian packages:
  python-crypto 
  python-crypto 
  xsel - to copy password to clipboard on Linux
  xsel - to copy password to clipboard on Linux
     
     
-Pwman only supports Python 2.7. 
+Pwman supports Python 2.7-3.x. 
 
 
 To install from source:
 To install from source:
 
 
@@ -101,10 +107,6 @@ Do your self a favor and skip Windows. Try Linux\BSD\*Nix OS.
       ...
       ...
       cls_timeout = -1
       cls_timeout = -1
       ```
       ```
-
-
-## ikegam's function 
-
  * making a password from the numeric character and the alphabet character ([A-Za-z0-9]).
  * making a password from the numeric character and the alphabet character ([A-Za-z0-9]).
 
 
    You can add a parameter for making the password to the config(~/.pwman/config).
    You can add a parameter for making the password to the config(~/.pwman/config).
@@ -116,12 +118,6 @@ Do your self a favor and skip Windows. Try Linux\BSD\*Nix OS.
      numerics = true
      numerics = true
      ```
      ```
 
 
- * Passwords can be l33tified similarly using the following.
-     
-     ```
-     [Generator]
-     leetify = true
-     ```
  * Passwords can contain one of the following special signs:
  * Passwords can contain one of the following special signs:
     
     
     ```
     ```
@@ -139,11 +135,11 @@ The config file  must have the following option:
  * Individual password policy can be chosen with:
  * Individual password policy can be chosen with:
  
  
      ```
      ```
-     Pwman3 0.2.1 (c) visit: http://github.com/pwman3/pwman3
+     Pwman3 0.6.0 (c) visit: http://github.com/pwman3/pwman3
      pwman> n {'leetify':False, 'numerics':True, 'special_signs':True}
      pwman> n {'leetify':False, 'numerics':True, 'special_signs':True}
      Username: username
      Username: username
-     Password length (default 7): 7
-     New password: Q1dab@7
+     Password length (default 8): 12
+     New password: Q1dab@7abcd5
      ``` 
      ``` 
  
  
  * Default password length can be changed by: 
  * Default password length can be changed by: 
@@ -161,19 +157,8 @@ The config file  must have the following option:
      ```
      ```
      [Global]
      [Global]
      xsel = yes
      xsel = yes
-      xselpath = /usr/bin/xsel
+     xselpath = /usr/bin/xsel
      ```
      ```
  
  
      When launching `pwman` for the first time, it will try and look for 
      When launching `pwman` for the first time, it will try and look for 
      `xsel` and write the configuration properly. 
      `xsel` and write the configuration properly. 
-
-## Password leetifying
-
-If you choose to leetify your passwords when generating passwords, 
-e.g. `leetify = true` in `~/.pwman/config`, password lengths may exceed the length chosen. 
-This is because certain letters will be replaced with 2 or more characters. 
-That is, if an initial random password was generated as : `Murkahm1` it will eventually be
-set to: `|\/|ur|<ham1`. To see to full leet list checkout line 79 in `pwman/util/generator.py`
-or issue in your terminal: 
-
-     python -c'from pwman.util import generator; print generator.leetlist'

+ 8 - 8
pwman/data/database.py

@@ -67,12 +67,12 @@ class Database(object):
         Change the databases password.
         Change the databases password.
         """
         """
         # TODO: call the converter here ...
         # TODO: call the converter here ...
-        #nodeids = self.listnodes()
-        #nodes = self.getnodes(nodeids)
-        #enc = CryptoEngine.get()
-        #oldkey = enc.get_cryptedkey()
-        #newkey = enc.changepassword()
-        #return newkey
+        # nodeids = self.listnodes()
+        # nodes = self.getnodes(nodeids)
+        # enc = CryptoEngine.get()
+        # oldkey = enc.get_cryptedkey()
+        # newkey = enc.changepassword()
+        # return newkey
 
 
     def listtags(self, all=False):
     def listtags(self, all=False):
         pass  # pragma: no cover
         pass  # pragma: no cover
@@ -89,8 +89,8 @@ class Database(object):
     def removenodes(self, nodes):
     def removenodes(self, nodes):
         pass  # pragma: no cover
         pass  # pragma: no cover
 
 
-    #def listnodes(self):
-    #    pass  # pragma: no cover
+    def listnodes(self):
+        pass  # pragma: no cover
 
 
     def savekey(self, key):
     def savekey(self, key):
         pass  # pragma: no cover
         pass  # pragma: no cover

+ 0 - 3
pwman/data/drivers/sqlite.py

@@ -36,8 +36,6 @@ class SQLite(Database):
         cur = con.cursor()
         cur = con.cursor()
         cur.execute("PRAGMA TABLE_INFO(DBVERSION)")
         cur.execute("PRAGMA TABLE_INFO(DBVERSION)")
         row = cur.fetchone()
         row = cur.fetchone()
-        if not row:
-            return "0.3"  # pragma: no cover
         try:
         try:
             return row[-2]
             return row[-2]
         except IndexError:  # pragma: no cover
         except IndexError:  # pragma: no cover
@@ -47,7 +45,6 @@ class SQLite(Database):
         """Initialise SQLitePwmanDatabase instance."""
         """Initialise SQLitePwmanDatabase instance."""
         self._filename = filename
         self._filename = filename
         self.dbformat = dbformat
         self.dbformat = dbformat
-        self._filtertags = None  # TODO: get rid of this property
 
 
     def _open(self):
     def _open(self):
         self._con = sqlite.connect(self._filename)
         self._con = sqlite.connect(self._filename)

+ 1 - 1
pwman/data/factory.py

@@ -55,7 +55,7 @@ def create(dbtype, version=None, filename=None):
         if str(version) == '0.6':
         if str(version) == '0.6':
             db = sqlite.SQLite(filename)
             db = sqlite.SQLite(filename)
         else:
         else:
-            db = sqlite.SQLite(filename)
+            db = sqlite.SQLite(filename, dbformat=version)
 
 
     elif dbtype == "Postgresql":  # pragma: no cover
     elif dbtype == "Postgresql":  # pragma: no cover
         try:
         try:

+ 2 - 1
pwman/tests/test_factory.py

@@ -49,7 +49,8 @@ class TestFactory(unittest.TestCase):
         self.assertEqual(factory.check_db_version('SQLite', testdb), 0.6)
         self.assertEqual(factory.check_db_version('SQLite', testdb), 0.6)
 
 
     def test_factory_check_db_file(self):
     def test_factory_check_db_file(self):
-        factory.create('SQLite', version='0.3', filename='baz.db')
+        db = factory.create('SQLite', version='0.3', filename='baz.db')
+        db._open()
         self.assertEqual(factory.check_db_version('SQLite', 'baz.db'), 0.3)
         self.assertEqual(factory.check_db_version('SQLite', 'baz.db'), 0.3)
         os.unlink('baz.db')
         os.unlink('baz.db')
 
 

+ 5 - 4
pwman/tests/test_pwman.py

@@ -1,5 +1,5 @@
 #!/usr/bin/env python
 #!/usr/bin/env python
-#============================================================================
+# ============================================================================
 # This file is part of Pwman3.
 # This file is part of Pwman3.
 #
 #
 # Pwman3 is free software; you can redistribute it and/or modify
 # Pwman3 is free software; you can redistribute it and/or modify
@@ -14,13 +14,14 @@
 # You should have received a copy of the GNU General Public License
 # You should have received a copy of the GNU General Public License
 # along with Pwman3; if not, write to the Free Software
 # along with Pwman3; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-#============================================================================
+# ============================================================================
 # Copyright (C) 2013 Oz Nahum <nahumoz@gmail.com>
 # Copyright (C) 2013 Oz Nahum <nahumoz@gmail.com>
-#============================================================================
+# ============================================================================
 
 
 import os
 import os
 import sys
 import sys
 import unittest
 import unittest
+# from .test_tools import (SetupTester)
 from .test_crypto_engine import CryptoEngineTest, TestPassGenerator
 from .test_crypto_engine import CryptoEngineTest, TestPassGenerator
 from .test_config import TestConfig
 from .test_config import TestConfig
 from .test_sqlite import TestSQLite
 from .test_sqlite import TestSQLite
@@ -56,7 +57,7 @@ def suite():
     suite.addTest(loader.loadTestsFromTestCase(TestBaseUI))
     suite.addTest(loader.loadTestsFromTestCase(TestBaseUI))
     suite.addTest(loader.loadTestsFromTestCase(TestInit))
     suite.addTest(loader.loadTestsFromTestCase(TestInit))
     suite.addTest(loader.loadTestsFromTestCase(TestNode))
     suite.addTest(loader.loadTestsFromTestCase(TestNode))
-    #if 'win' not in sys.platform:
+    # if 'win' not in sys.platform:
     #    suite.addTest(loader.loadTestsFromTestCase(Ferrum))
     #    suite.addTest(loader.loadTestsFromTestCase(Ferrum))
     return suite
     return suite