Jelajahi Sumber

Merge branch 'release-0.9.1'

Oz N Tiram 8 tahun lalu
induk
melakukan
dc0dc60a3f
5 mengubah file dengan 23 tambahan dan 82 penghapusan
  1. 4 0
      ChangeLog
  2. 11 39
      README.md
  3. 1 1
      pwman/__init__.py
  4. 6 16
      pwman/ui/win.py
  5. 1 26
      setup.py

+ 4 - 0
ChangeLog

@@ -1,3 +1,7 @@
+2016-August-12 Oz Nahum Tiram <oz.tiram@gmail.com>
+	* Release 0.9.1	
+	* Windows fixes
+
 2016-August-09 Oz Nahum Tiram <oz.tiram@gmail.com>
 	* Release 0.9.0	
 	* Completely drop Python2 support

+ 11 - 39
README.md

@@ -43,7 +43,7 @@ Pwman3 requires the following debian packages:
  xsel - to copy password to clipboard on Linux
 
 It is also recommended to install python-crypto.
-Pwman supports Python 2.7-3.x. 
+Pwman supports Python 3.x. 
 
 To install from source:
 
@@ -53,45 +53,8 @@ You can also install PWMAN3 using python pip:
 
     $ pip install pwman3
 
-### Windows Users:
 
-Pwman3 comes with a pure python implementation of the AES encryptio algorithm based
-of PythonCrypto-Plus.
- 
-Pwman3 can also help you install PyCrypto. To you can install PyCrypto with:
-
-    python setup install_pycrypto
-
-When done, issue:
-    
-    python setup install
-
-If you are more picky then you can compile PyCrypto using the instruction bellow.
-
-After you downloaded the source code of 
-pycrypto and extracted it do the following inisde the source code direcotry:
-
-    C:\Temp\pycrypto> python setup.py build -c mingw32 
-    C:\Temp\pycrypto> python setup.py bdist_wininst
-
-Now you should be able to run pwman3 on Windows.
-
-On Windows 7 64bit: 
-
-PyCrypto builds with mingw gcc version 4.6.2. Note that you also need msys installed from mingw. 
-The above setup commands won't work in the Windows command prompt. But they do work in 
-the msys command prompt. 
-You also need to edit the following file:
-
-	C:\Python27\Lib\distutils\cygwinccompiler.py
-
-Before doing anything on this file make sure you create a backup! After that remove all references
-for ``-mno-cygwin`. 
-
-and after all that, if you a security minded person, who is capable of using a command line password:
-Do your self a favor and skip Windows. Try Linux\BSD\*Nix OS. 
-
-    ## User Interface
+## User Interface
    1. When xsel is install on a Linux system, you can copy passwords directly to clipboard with the copy command.
    2. The command 'open' will open the default browser if URL is specified.
    3. An automatic 'clear screen' function is called after printing an entry in the database. 
@@ -165,3 +128,12 @@ The config file  must have the following option:
  
      When launching `pwman` for the first time, it will try and look for 
      `xsel` and write the configuration properly. 
+
+## Supporting
+
+If you find this work useful, you can do one or more of the following:
+
+	* Star this repository.
+	* Tweeter me with a thank you.
+	* Donate me a humlbe sum of 5-10€. (Donations should go to oz dot tiram at gmail dot com), I'll mention you here for supporting my work.
+

+ 1 - 1
pwman/__init__.py

@@ -40,7 +40,7 @@ appname = "pwman3"
 try:
     version = pkg_resources.get_distribution('pwman3').version
 except pkg_resources.DistributionNotFound:  # pragma: no cover
-    version = "0.9.0"
+    version = "0.9.1"
 
 
 class PkgMetadata(object):

+ 6 - 16
pwman/ui/win.py

@@ -67,26 +67,16 @@ def winGetClipboard():
 
 
 def winSetClipboard(text):
-    text = str(text)
+    
     GMEM_DDESHARE = 0x2000
     ctypes.windll.user32.OpenClipboard(0)
     ctypes.windll.user32.EmptyClipboard()
-    try:
-        # works on Python 2 (bytes() only takes one argument)
-        hCd = ctypes.windll.kernel32.GlobalAlloc(GMEM_DDESHARE,
+    hCd = ctypes.windll.kernel32.GlobalAlloc(GMEM_DDESHARE,
                                                  len(bytes(text))+1)
-    except TypeError:
-        # works on Python 3 (bytes() requires an encoding)
-        hCd = ctypes.windll.kernel32.GlobalAlloc(GMEM_DDESHARE,
-                                                 len(bytes(text, 'ascii'))+1)
     pchData = ctypes.windll.kernel32.GlobalLock(hCd)
-    try:
-        # works on Python 2 (bytes() only takes one argument)
-        ctypes.cdll.msvcrt.strcpy(ctypes.c_char_p(pchData), bytes(text))
-    except TypeError:
-        # works on Python 3 (bytes() requires an encoding)
-        ctypes.cdll.msvcrt.strcpy(ctypes.c_char_p(pchData),
-                                  bytes(text, 'ascii'))
+        
+    ctypes.cdll.msvcrt.strcpy(ctypes.c_char_p(pchData), bytes(text))
+    
     ctypes.windll.kernel32.GlobalUnlock(hCd)
     ctypes.windll.user32.SetClipboardData(1, hCd)
     ctypes.windll.user32.CloseClipboard()
@@ -127,7 +117,7 @@ class PwmanCliWin(PwmanCli):
             flushtimeout = flushtimeout or 10
             print("erasing in {} sec...".format(flushtimeout))
             time.sleep(int(flushtimeout))
-            winSetClipboard("")
+            winSetClipboard(b"")
 
     def do_open(self, args):
         ids = self._get_ids(args)

+ 1 - 26
setup.py

@@ -10,7 +10,6 @@ import argparse
 from setuptools import setup
 from setuptools import find_packages
 import sys
-from setuptools.command.install import install
 import os
 
 
@@ -294,29 +293,6 @@ class ManPageCreator(object):
 sys.path.insert(0, os.getcwd())
 
 
-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):
-        base_path = "http://www.voidspace.org.uk/downloads/pycrypto26"
-        if 'win32' in sys.platform:
-            if 'AMD64' not in sys.version:
-                pycrypto = 'pycrypto-2.6.win32-py2.7.exe'
-            else:  # 'for AMD64'
-                pycrypto = 'pycrypto-2.6.win-amd64-py2.7.exe'
-            os.system('easy_install '+base_path+'/'+pycrypto)
-            install.run(self)
-        else:
-            print(('Please use pip or your Distro\'s package manager '
-                   'to install pycrypto ...'))
-
-
 install_requires = ['colorama>=0.2.4', 'cryptography']
 
 if sys.platform.startswith('win'):
@@ -334,7 +310,7 @@ packages = find_packages(exclude=['tests', 'pwman/ui/templates'])
 
 
 setup(name='pwman3',
-      version='0.9.0',
+      version='0.9.1',
       description=("a command line password manager with support for multiple"
                    " databases."),
       long_description=long_description,
@@ -363,7 +339,6 @@ setup(name='pwman3',
                    ],
       test_suite='tests.test_pwman.suite',
       cmdclass={
-          'install_pycrypto': PyCryptoInstallCommand,
           'build_manpage': BuildManPage
       },
       entry_points={