Parcourir la source

Merge branch 'develop'

Oz N Tiram il y a 7 ans
Parent
commit
a2ad715b8c
3 fichiers modifiés avec 8 ajouts et 4 suppressions
  1. 4 2
      pwman/__init__.py
  2. 3 1
      pwman/data/nodes.py
  3. 1 1
      setup.py

+ 4 - 2
pwman/__init__.py

@@ -41,7 +41,7 @@ appname = "pwman3"
 try:
     version = pkg_resources.get_distribution('pwman3').version
 except pkg_resources.DistributionNotFound:  # pragma: no cover
-    version = "0.9.3"
+    version = "0.9.4"
 
 
 class PkgMetadata(object):
@@ -145,12 +145,14 @@ def calculate_client_info():  # pragma: no cover
 def is_latest_version(version, client_info):  # pragma: no cover
     """check current version againt latest version"""
     try:
-        conn = http.client.HTTPConnection("pwman.tiram.it", timeout=0.5)
+        conn = http.client.HTTPSConnection("pwman.tiram.it", timeout=0.5)
         conn.request("GET",
                      "/is_latest/?current_version={}&os={}&hash={}".format(
                          version, sys.platform, client_info))
         r = conn.getresponse()
         data = r.read()  # This will return entire content.
+        if r.status != 200:
+            return None, True
         if data.decode().split(".") > version.split("."):
             return None, False
         else:

+ 3 - 1
pwman/data/nodes.py

@@ -37,6 +37,7 @@ class Node(object):
                           kwargs.get('tags', '')]
 
     def __str__(self):
+        tags =",".join(t.decode() for t in self.tags) if len(self.tags) > 1 else self.tags[0].decode()  # noqa
         p = "{entry_title:>{width}} {entry:<{width}}\n".format(
             entry_title=pwman.ui.tools.typeset('Username:', Fore.RED),
             width=10, entry=str(self.username))
@@ -51,7 +52,8 @@ class Node(object):
             width=10, entry=str(self.notes))
         p += "{entry_title:>{width}} {entry:<{width}}\n".format(
             entry_title=pwman.ui.tools.typeset('Tags:', Fore.RED),
-            width=10, entry=str(self.tags))
+            width=10,
+            entry=tags)
         return p
 
     def to_encdict(self):

+ 1 - 1
setup.py

@@ -327,7 +327,7 @@ packages = find_packages(exclude=['tests', 'pwman/ui/templates'])
 
 
 setup(name='pwman3',
-      version='0.9.3',
+      version='0.9.4',
       description=("a command line password manager with support for multiple"
                    " databases."),
       long_description=long_description,