Răsfoiți Sursa

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

oz123 11 ani în urmă
părinte
comite
6518904730
2 a modificat fișierele cu 38 adăugiri și 4 ștergeri
  1. 3 3
      pwman/ui/win.py
  2. 35 1
      setup.py

+ 3 - 3
pwman/ui/win.py

@@ -73,9 +73,9 @@ class PwmanCliWinNew(PwmanCliNew):
             notes = self.get_notes()
             node = NewNode(username, password, url, notes)
             tags = self.get_tags()
-            node.set_tags(tags)
+            node.tags = tags
             self._db.addnodes([node])
-            print "Password ID: %d" % (node.get_id())
+            print "Password ID: %d" % (node._id)
             # when done with node erase it
             zerome(password)
         except Exception, e:
@@ -84,7 +84,7 @@ class PwmanCliWinNew(PwmanCliNew):
     def print_node(self, node):
         width = str(tools._defaultwidth)
         print "Node %d." % (node.get_id())
-        print ("%"+width+"s %s") % (tools.typeset("Username:", Fore.RED),
+        print ("%" + width+"s %s") % (tools.typeset("Username:", Fore.RED),
                                     node.get_username())
         print ("%"+width+"s %s") % (tools.typeset("Password:", Fore.RED),
                                     node.get_password())

+ 35 - 1
setup.py

@@ -5,6 +5,38 @@ script to install pwman3
 
 from setuptools import setup
 import pwman
+import sys
+from setuptools.command.install import install
+import os
+import urllib
+import shutil
+
+
+class PyCryptoInstallCommand(install):
+    """
+    A Custom command to download and install pycrypto26
+    binary from voidspace. Not optimal, but it should work ...
+    """
+    description = ("A Custom command to download and install pycrypto26"
+                   "binary from voidspace.")
+
+    def run(self):
+        if 'win32' in sys.platform:
+            if not os.path.exists('./.setup'):
+                os.mkdir('./.setup')
+            urllib.urlretrieve(("http://www.voidspace.org.uk/downloads/"
+                               "pycrypto26/pycrypto-2.6.win32-py2.7.exe"),
+                               os.path.join('.', 'setup',
+                                            ('pycrypto-2.6.win32-py2.7.exe')))
+            os.system('easy_install '
+                      + os.path.join('.', '.setup',
+                                     'pycrypto-2.6.win32-py2.7.exe'))
+            install.run(self)
+            shutil.rmtree('.', '.setup')
+        else:
+            print(('Please use pip or your Distro\'s package manager '
+                   'to install pycrypto ...'))
+
 
 setup(name=pwman.appname,
       version=pwman.version,
@@ -35,5 +67,7 @@ setup(name=pwman.appname,
           'Programming Language :: Python',
           'Programming Language :: Python :: 2.7'
       ],
-      test_suite='pwman.tests'
+      test_suite='pwman.tests',
+      cmdclass={'install_pycrypto': PyCryptoInstallCommand},
+
       )