From 642838c92c58af3a4bdd30740b289fa2e06f5ec3 Mon Sep 17 00:00:00 2001 From: Rene Ladan Date: Fri, 30 Sep 2022 22:00:10 +0200 Subject: cleanup: Remove expired ports: 2022-09-30 security/pwman3: Depends on expired security/py-pycrypto 2022-09-30 sysutils/py-ansible-base: Depends on expired security/py-pycrypto --- MOVED | 2 + security/Makefile | 1 - security/pwman3/Makefile | 24 - security/pwman3/distinfo | 2 - security/pwman3/files/patch-2to3 | 1226 -------------------- .../pwman3/files/patch-pwman-exchange_exporter.py | 11 - .../pwman3/files/patch-pwman-exchange_importer.py | 11 - security/pwman3/pkg-descr | 3 - sysutils/Makefile | 1 - sysutils/py-ansible-base/Makefile | 110 -- sysutils/py-ansible-base/distinfo | 5 - sysutils/py-ansible-base/pkg-descr | 8 - 12 files changed, 2 insertions(+), 1402 deletions(-) delete mode 100644 security/pwman3/Makefile delete mode 100644 security/pwman3/distinfo delete mode 100644 security/pwman3/files/patch-2to3 delete mode 100644 security/pwman3/files/patch-pwman-exchange_exporter.py delete mode 100644 security/pwman3/files/patch-pwman-exchange_importer.py delete mode 100644 security/pwman3/pkg-descr delete mode 100644 sysutils/py-ansible-base/Makefile delete mode 100644 sysutils/py-ansible-base/distinfo delete mode 100644 sysutils/py-ansible-base/pkg-descr diff --git a/MOVED b/MOVED index 5ba63e30221d..9ddffc7c044a 100644 --- a/MOVED +++ b/MOVED @@ -17561,3 +17561,5 @@ audio/phaserotate-lv2|audio/x42-plugins-lv2|2022-09-13|phaserotate-lv2 LV2 plugi graphics/darktable40|graphics/darktable|2022-09-22|Obsolete. Use graphics/darktable, which is the same version java/bootstrap-openjdk6|java/bootstrap-openjdk8|2022-09-25|Was only used to bootstrap the now deleted java/openjdk7 port graphics/caffe|misc/caffe|2022-09-29|Move to a more appropriate category +security/pwman3||2022-09-30|Has expired: Depends on expired security/py-pycrypto +sysutils/py-ansible-base||2022-09-30|Has expired: Depends on expired security/py-pycrypto diff --git a/security/Makefile b/security/Makefile index 5770350685b9..1fb61f99161f 100644 --- a/security/Makefile +++ b/security/Makefile @@ -815,7 +815,6 @@ SUBDIR += pvk SUBDIR += pwauth SUBDIR += pwman - SUBDIR += pwman3 SUBDIR += pwned-check SUBDIR += py-RestrictedPython SUBDIR += py-SecretStorage diff --git a/security/pwman3/Makefile b/security/pwman3/Makefile deleted file mode 100644 index f5314f89344d..000000000000 --- a/security/pwman3/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -PORTNAME= pwman3 -PORTVERSION= 0.0.6 -PORTREVISION= 2 -CATEGORIES= security python -MASTER_SITES= http://pwman.bleurgh.com/~ivan/pwman3/source/ \ - http://source.antisupport.com/pwman3/ -DISTNAME= Pwman3-${PORTVERSION} - -MAINTAINER= yarodin@gmail.com -COMMENT= Console password management application with sql storage -WWW= http://pwman.bleurgh.com - -DEPRECATED= Depends on expired security/py-pycrypto -EXPIRATION_DATE=2022-09-30 - -RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pycrypto>=2.0:security/py-pycrypto@${PY_FLAVOR} \ - ${PYTHON_PKGNAMEPREFIX}sqlite3>=0:databases/py-sqlite3@${PY_FLAVOR} - -USES= python:3.6+ -USE_PYTHON= distutils autoplist concurrent optsuffix - -NO_ARCH= yes - -.include diff --git a/security/pwman3/distinfo b/security/pwman3/distinfo deleted file mode 100644 index c45a89c0a9cf..000000000000 --- a/security/pwman3/distinfo +++ /dev/null @@ -1,2 +0,0 @@ -SHA256 (Pwman3-0.0.6.tar.gz) = bcc0f1511c76af6a0a1abd4fc2eb436e77bab1998800822fb5074dc0462583d2 -SIZE (Pwman3-0.0.6.tar.gz) = 28877 diff --git a/security/pwman3/files/patch-2to3 b/security/pwman3/files/patch-2to3 deleted file mode 100644 index df330dcf8e93..000000000000 --- a/security/pwman3/files/patch-2to3 +++ /dev/null @@ -1,1226 +0,0 @@ ---- pwman/data/drivers/mysql.py.orig 2007-02-04 18:44:43 UTC -+++ pwman/data/drivers/mysql.py -@@ -24,7 +24,7 @@ from pwman.data.tags import Tag - - import MySQLdb - import pwman.util.config as config --import cPickle -+import pickle - - class MySQLDatabase(Database): - """MySQL Database implementation""" -@@ -46,7 +46,7 @@ class MySQLDatabase(Database): - self._password = config.get_value('Database', 'password') - self._database = config.get_value('Database', 'database') - self._prefix = config.get_value('Database', 'table_prefix') -- except KeyError, e: -+ except KeyError as e: - raise DatabaseException( - "MySQL: missing parameter [%s]" % (e)) - -@@ -60,14 +60,14 @@ class MySQLDatabase(Database): - # password = self._password) - # self._cur = self._con.cursor() - self._checktables() -- except MySQLdb.DatabaseError, e: -+ except MySQLdb.DatabaseError as e: - raise DatabaseException("MySQL: %s" % (e)) - - def _get_cur(self): - try: - if (self._con != None): - return self._con.cursor() -- except MySQLdb.DatabaseError, e: -+ except MySQLdb.DatabaseError as e: - pass - self._con = MySQLdb.connect(host = self._server, - port = int(self._port), -@@ -105,7 +105,7 @@ class MySQLDatabase(Database): - sql += ("SELECT NODE FROM %sLOOKUP LEFT JOIN %sTAGS ON TAG = %sTAGS.ID " - + " WHERE %sTAGS.DATA = %%s") % (self._prefix, self._prefix, - self._prefix, self._prefix) -- params.append(cPickle.dumps(t)) -+ params.append(pickle.dumps(t)) - sql += ") EXCEPT SELECT DATA FROM %sTAGS WHERE " %(self._prefix) - first = True - for t in self._filtertags: -@@ -114,7 +114,7 @@ class MySQLDatabase(Database): - else: - first = False - sql += "%sTAGS.DATA = %%s" % (self._prefix) -- params.append(cPickle.dumps(t)) -+ params.append(pickle.dumps(t)) - try: - cursor = self._get_cur() - cursor.execute(sql, params) -@@ -122,11 +122,11 @@ class MySQLDatabase(Database): - tags = [] - row = cursor.fetchone() - while (row != None): -- tag = cPickle.loads(str(row[0])) -+ tag = pickle.loads(str(row[0])) - tags.append(tag) - row = cursor.fetchone() - return tags -- except MySQLdb.DatabaseError, e: -+ except MySQLdb.DatabaseError as e: - raise DatabaseException("MySQL: %s" % (e)) - - def getnodes(self, ids): -@@ -151,11 +151,11 @@ class MySQLDatabase(Database): - - row = cursor.fetchone() - while row != None: -- node = cPickle.loads(str(row[1])) -+ node = pickle.loads(str(row[1])) - node.set_id(row[0]) - nodes.append(node) - row = cursor.fetchone() -- except MySQLdb.DatabaseError, e: -+ except MySQLdb.DatabaseError as e: - raise DatabaseException("MySQL: %s" % (e)) - return nodes - -@@ -165,9 +165,9 @@ class MySQLDatabase(Database): - try: - cursor = self._get_cur() - sql = "UPDATE %sNODES SET DATA = %%s WHERE ID = %%s" % (self._prefix) -- cursor.execute(sql, (cPickle.dumps(node), id)) -+ cursor.execute(sql, (pickle.dumps(node), id)) - -- except MySQL.DatabaseError, e: -+ except MySQL.DatabaseError as e: - raise DatabaseException("MySQL: %s" % (e)) - self._setnodetags(node) - self._checktags() -@@ -179,13 +179,13 @@ class MySQLDatabase(Database): - sql = "INSERT INTO %sNODES(DATA) VALUES(%%s)" % (self._prefix) - if not isinstance(n, Node): raise DatabaseException( - "Tried to insert foreign object into database [%s]", n) -- values = [cPickle.dumps(n)] -+ values = [pickle.dumps(n)] - try: - cursor.execute(sql, values) -- except MySQLdb.DatabaseError, e: -+ except MySQLdb.DatabaseError as e: - raise DatabaseException("MySQL: %s" % (e)) - id = cursor.lastrowid -- print "id: %d" % (id) -+ print("id: %d" % (id)) - n.set_id(id) - - self._setnodetags(n) -@@ -200,7 +200,7 @@ class MySQLDatabase(Database): - sql = "DELETE FROM %sNODES WHERE ID = %%s" % (self._prefix) - cursor.execute(sql, [n.get_id()]) - -- except MySQLdb.DatabaseError, e: -+ except MySQLdb.DatabaseError as e: - raise DatabaseException("MySQL: %s" % (e)) - self._deletenodetags(n) - -@@ -226,9 +226,9 @@ class MySQLDatabase(Database): - sql += (("SELECT NODE FROM %sLOOKUP LEFT JOIN %sTAGS ON TAG = %sTAGS.ID" - + " WHERE %sTAGS.DATA = %%s ") % (self._prefix, self._prefix, - self._prefix, self._prefix)) -- params.append(cPickle.dumps(t)) -+ params.append(pickle.dumps(t)) - try: -- print sql -+ print(sql) - cursor.execute(sql, params) - - ids = [] -@@ -237,13 +237,13 @@ class MySQLDatabase(Database): - ids.append(row[0]) - row = cursor.fetchone() - return ids -- except MySQLdb.DatabaseError, e: -+ except MySQLdb.DatabaseError as e: - raise DatabaseException("MySQL: %s" % (e)) - - def _commit(self): - try: - self._con.commit() -- except MySQLdb.DatabaseError, e: -+ except MySQLdb.DatabaseError as e: - self._con.rollback() - raise DatabaseException( - "MySQL: Error commiting data to db [%s]" % (e)) -@@ -252,11 +252,11 @@ class MySQLDatabase(Database): - ids = [] - cursor = self._get_cur() - for t in tags: -- pickled = cPickle.dumps(t) -+ pickled = pickle.dumps(t) - try: - ids.append(self._tagidcache[pickled]) - continue -- except KeyError, e: -+ except KeyError as e: - pass # not in cache - sql = "SELECT ID FROM %sTAGS WHERE DATA = %%s" % (self._prefix) - if not isinstance(t, Tag): raise DatabaseException( -@@ -275,7 +275,7 @@ class MySQLDatabase(Database): - id = cursor.lastrowid - ids.append(id) - self._tagidcache[pickled] = id -- except MySQLdb.DatabaseError, e: -+ except MySQLdb.DatabaseError as e: - raise DatabaseException("MySQLdb: %s" % (e)) - return ids - -@@ -285,7 +285,7 @@ class MySQLDatabase(Database): - sql = "DELETE FROM %sLOOKUP WHERE NODE = %%s" % (self._prefix) - cursor.execute(sql, [node.get_id()]) - -- except MySQLdb.DatabaseError, e: -+ except MySQLdb.DatabaseError as e: - raise DatabaseException("MySQLdb: %s" % (e)) - - def _setnodetags(self, node): -@@ -299,7 +299,7 @@ class MySQLDatabase(Database): - try: - cursor = self._get_cur() - cursor.execute(sql, params) -- except MySQLdb.DatabaseError, e: -+ except MySQLdb.DatabaseError as e: - raise DatabaseException("MySQLdb: %s" % (e)) - - def _checktags(self): -@@ -310,7 +310,7 @@ class MySQLDatabase(Database): - + "(SELECT TAG FROM %sLOOKUP GROUP BY TAG)") % (self._prefix, - self._prefix) - cursor.execute(sql) -- except MySQLdb.DatabaseError, e: -+ except MySQLdb.DatabaseError as e: - raise DatabaseException("MySQL: %s" % (e)) - self._commit() - -@@ -342,7 +342,7 @@ class MySQLDatabase(Database): - - try: - self._con.commit() -- except MySQLdb.DatabaseError, e: -+ except MySQLdb.DatabaseError as e: - self._con.rollback() - raise e - -@@ -353,7 +353,7 @@ class MySQLDatabase(Database): - cursor.execute(sql, values) - try: - self._con.commit() -- except MySQLdb.DatabaseError, e: -+ except MySQLdb.DatabaseError as e: - self._con.rollback() - raise DatabaseException( - "MySQL: Error saving key [%s]" % (e)) ---- pwman/data/drivers/postgresql.py.orig 2007-02-04 18:44:43 UTC -+++ pwman/data/drivers/postgresql.py -@@ -24,7 +24,7 @@ from pwman.data.tags import Tag - - import pgdb - import pwman.util.config as config --import cPickle -+import pickle - - class PostgresqlDatabase(Database): - """Postgresql Database implementation""" -@@ -46,7 +46,7 @@ class PostgresqlDatabase(Database): - self._password = config.get_value('Database', 'password') - self._database = config.get_value('Database', 'database') - self._prefix = config.get_value('Database', 'table_prefix') -- except KeyError, e: -+ except KeyError as e: - raise DatabaseException( - "Postgresql: missing parameter [%s]" % (e)) - -@@ -60,14 +60,14 @@ class PostgresqlDatabase(Database): - # password = self._password) - # self._cur = self._con.cursor() - self._checktables() -- except pgdb.DatabaseError, e: -+ except pgdb.DatabaseError as e: - raise DatabaseException("Postgresql: %s" % (e)) - - def _get_cur(self): - try: - if (self._con != None): - return self._con.cursor() -- except pgdb.DatabaseError, e: -+ except pgdb.DatabaseError as e: - pass - server = "%s:%s" % (self._server, self._port) - self._con = pgdb.connect(host = server, -@@ -106,7 +106,7 @@ class PostgresqlDatabase(Database): - + " WHERE %sTAGS.DATA = %%(%s)s") % (self._prefix, self._prefix, - self._prefix, self._prefix, - paramname) -- params[paramname] = cPickle.dumps(t) -+ params[paramname] = pickle.dumps(t) - sql += ") EXCEPT SELECT DATA FROM %sTAGS WHERE " %(self._prefix) - first = True - for t in self._filtertags: -@@ -122,11 +122,11 @@ class PostgresqlDatabase(Database): - tags = [] - row = cursor.fetchone() - while (row != None): -- tag = cPickle.loads(str(row[0])) -+ tag = pickle.loads(str(row[0])) - tags.append(tag) - row = cursor.fetchone() - return tags -- except pgdb.DatabaseError, e: -+ except pgdb.DatabaseError as e: - raise DatabaseException("Postgresql: %s" % (e)) - - def getnodes(self, ids): -@@ -151,11 +151,11 @@ class PostgresqlDatabase(Database): - - row = cursor.fetchone() - while row != None: -- node = cPickle.loads(str(row[1])) -+ node = pickle.loads(str(row[1])) - node.set_id(row[0]) - nodes.append(node) - row = cursor.fetchone() -- except pgdb.DatabaseError, e: -+ except pgdb.DatabaseError as e: - raise DatabaseException("Postgresql: %s" % (e)) - return nodes - -@@ -165,10 +165,10 @@ class PostgresqlDatabase(Database): - try: - cursor = self._get_cur() - sql = "UPDATE %sNODES SET DATA = %%(data)s WHERE ID = %%(id)d" % (self._prefix) -- cursor.execute(sql, {"data":cPickle.dumps(node), -+ cursor.execute(sql, {"data":pickle.dumps(node), - "id": id}) - -- except pgdb.DatabaseError, e: -+ except pgdb.DatabaseError as e: - raise DatabaseException("Postgresql: %s" % (e)) - self._setnodetags(node) - self._checktags() -@@ -180,10 +180,10 @@ class PostgresqlDatabase(Database): - sql = "INSERT INTO %sNODES(DATA) VALUES(%%(data)s)" % (self._prefix) - if not isinstance(n, Node): raise DatabaseException( - "Tried to insert foreign object into database [%s]", n) -- values = {"data": cPickle.dumps(n)} -+ values = {"data": pickle.dumps(n)} - try: - cursor.execute(sql, values) -- except pgdb.DatabaseError, e: -+ except pgdb.DatabaseError as e: - raise DatabaseException("Postgresql: %s" % (e)) - id = self._lastrowid("NODES") - n.set_id(id) -@@ -200,7 +200,7 @@ class PostgresqlDatabase(Database): - sql = "DELETE FROM %sNODES WHERE ID = %%(id)d" % (self._prefix) - cursor.execute(sql, {"id": n.get_id()}) - -- except pgdb.DatabaseError, e: -+ except pgdb.DatabaseError as e: - raise DatabaseException("Postgresql: %s" % (e)) - self._deletenodetags(n) - -@@ -228,7 +228,7 @@ class PostgresqlDatabase(Database): - + " WHERE %sTAGS.DATA = %%(%s)s ") % (self._prefix, self._prefix, - self._prefix, self._prefix, - paramname)) -- params[paramname] = cPickle.dumps(t) -+ params[paramname] = pickle.dumps(t) - try: - cursor.execute(sql, params) - -@@ -238,13 +238,13 @@ class PostgresqlDatabase(Database): - ids.append(row[0]) - row = cursor.fetchone() - return ids -- except pgdb.DatabaseError, e: -+ except pgdb.DatabaseError as e: - raise DatabaseException("Postgresql: %s" % (e)) - - def _commit(self): - try: - self._con.commit() -- except pgdb.DatabaseError, e: -+ except pgdb.DatabaseError as e: - self._con.rollback() - raise DatabaseException( - "Postgresql: Error commiting data to db [%s]" % (e)) -@@ -253,11 +253,11 @@ class PostgresqlDatabase(Database): - ids = [] - cursor = self._get_cur() - for t in tags: -- pickled = cPickle.dumps(t) -+ pickled = pickle.dumps(t) - try: - ids.append(self._tagidcache[pickled]) - continue -- except KeyError, e: -+ except KeyError as e: - pass # not in cache - sql = "SELECT ID FROM %sTAGS WHERE DATA = %%(tag)s" % (self._prefix) - if not isinstance(t, Tag): raise DatabaseException( -@@ -276,7 +276,7 @@ class PostgresqlDatabase(Database): - id = self._lastrowid("TAGS") - ids.append(id) - self._tagidcache[pickled] = id -- except pgdb.DatabaseError, e: -+ except pgdb.DatabaseError as e: - raise DatabaseException("Postgresql: %s" % (e)) - return ids - -@@ -286,7 +286,7 @@ class PostgresqlDatabase(Database): - sql = "DELETE FROM %sLOOKUP WHERE NODE = %%(node)d" % (self._prefix) - cursor.execute(sql, {"node":node.get_id()}) - -- except pgdb.DatabaseError, e: -+ except pgdb.DatabaseError as e: - raise DatabaseException("Postgresql: %s" % (e)) - - def _setnodetags(self, node): -@@ -300,7 +300,7 @@ class PostgresqlDatabase(Database): - try: - cursor = self._get_cur() - cursor.execute(sql, params) -- except pgdb.DatabaseError, e: -+ except pgdb.DatabaseError as e: - raise DatabaseException("Postgresql: %s" % (e)) - - def _checktags(self): -@@ -311,7 +311,7 @@ class PostgresqlDatabase(Database): - + "(SELECT TAG FROM %sLOOKUP GROUP BY TAG)") % (self._prefix, - self._prefix) - cursor.execute(sql) -- except pgdb.DatabaseError, e: -+ except pgdb.DatabaseError as e: - raise DatabaseException("Postgresql: %s" % (e)) - self._commit() - -@@ -352,7 +352,7 @@ class PostgresqlDatabase(Database): - - try: - self._con.commit() -- except pgdb.DatabaseError, e: -+ except pgdb.DatabaseError as e: - self._con.rollback() - raise e - -@@ -363,7 +363,7 @@ class PostgresqlDatabase(Database): - cursor.execute(sql, values) - try: - self._con.commit() -- except pgdb.DatabaseError, e: -+ except pgdb.DatabaseError as e: - self._con.rollback() - raise DatabaseException( - "Postgresql: Error saving key [%s]" % (e)) ---- pwman/data/drivers/sqlite.py.orig 2007-02-04 18:44:43 UTC -+++ pwman/data/drivers/sqlite.py -@@ -22,9 +22,9 @@ from pwman.data.tags import Tag - from pwman.data.nodes import Node - from pwman.data.tags import Tag - --from pysqlite2 import dbapi2 as sqlite -+from sqlite3 import dbapi2 as sqlite - import pwman.util.config as config --import cPickle -+import pickle - - class SQLiteDatabase(Database): - """SQLite Database implementation""" -@@ -35,7 +35,7 @@ class SQLiteDatabase(Database): - - try: - self._filename = config.get_value('Database', 'filename') -- except KeyError, e: -+ except KeyError as e: - raise DatabaseException( - "SQLite: missing parameter [%s]" % (e)) - -@@ -44,7 +44,7 @@ class SQLiteDatabase(Database): - self._con = sqlite.connect(self._filename) - self._cur = self._con.cursor() - self._checktables() -- except sqlite.DatabaseError, e: -+ except sqlite.DatabaseError as e: - raise DatabaseException("SQLite: %s" % (s)) - - def close(self): -@@ -69,7 +69,7 @@ class SQLiteDatabase(Database): - - sql += ("SELECT NODE FROM LOOKUP OUTER JOIN TAGS ON TAG = TAGS.ID " - + " WHERE TAGS.DATA = ?") -- params.append(cPickle.dumps(t)) -+ params.append(pickle.dumps(t)) - sql += ") EXCEPT SELECT DATA FROM TAGS WHERE " - first = True - for t in self._filtertags: -@@ -78,18 +78,18 @@ class SQLiteDatabase(Database): - else: - first = False - sql += "TAGS.DATA = ?" -- params.append(cPickle.dumps(t)) -+ params.append(pickle.dumps(t)) - try: - self._cur.execute(sql, params) - - tags = [] - row = self._cur.fetchone() - while (row != None): -- tag = cPickle.loads(str(row[0])) -+ tag = pickle.loads(str(row[0])) - tags.append(tag) - row = self._cur.fetchone() - return tags -- except sqlite.DatabaseError, e: -+ except sqlite.DatabaseError as e: - raise DatabaseException("SQLite: %s" % (e)) - - def getnodes(self, ids): -@@ -101,10 +101,10 @@ class SQLiteDatabase(Database): - - row = self._cur.fetchone() - if row != None: -- node = cPickle.loads(str(row[0])) -+ node = pickle.loads(str(row[0])) - node.set_id(i) - nodes.append(node) -- except sqlite.DatabaseError, e: -+ except sqlite.DatabaseError as e: - raise DatabaseException("SQLite: %s" % (e)) - return nodes - -@@ -113,9 +113,9 @@ class SQLiteDatabase(Database): - "Tried to insert foreign object into database [%s]" % node) - try: - sql = "UPDATE NODES SET DATA = ? WHERE ID = ?"; -- self._cur.execute(sql, [cPickle.dumps(node), id]) -+ self._cur.execute(sql, [pickle.dumps(node), id]) - -- except sqlite.DatabaseError, e: -+ except sqlite.DatabaseError as e: - raise DatabaseException("SQLite: %s" % (e)) - self._setnodetags(node) - self._checktags() -@@ -126,10 +126,10 @@ class SQLiteDatabase(Database): - sql = "INSERT INTO NODES(DATA) VALUES(?)" - if not isinstance(n, Node): raise DatabaseException( - "Tried to insert foreign object into database [%s]", n) -- value = cPickle.dumps(n) -+ value = pickle.dumps(n) - try: - self._cur.execute(sql, [value]) -- except sqlite.DatabaseError, e: -+ except sqlite.DatabaseError as e: - raise DatabaseException("SQLite: %s" % (e)) - id = self._cur.lastrowid - n.set_id(id) -@@ -145,7 +145,7 @@ class SQLiteDatabase(Database): - sql = "DELETE FROM NODES WHERE ID = ?"; - self._cur.execute(sql, [n.get_id()]) - -- except sqlite.DatabaseError, e: -+ except sqlite.DatabaseError as e: - raise DatabaseException("SQLite: %s" % (e)) - self._deletenodetags(n) - -@@ -167,7 +167,7 @@ class SQLiteDatabase(Database): - sql += ("SELECT NODE FROM LOOKUP OUTER JOIN TAGS ON TAG = TAGS.ID" - + " WHERE TAGS.DATA = ? ") - -- params.append(cPickle.dumps(t)) -+ params.append(pickle.dumps(t)) - try: - self._cur.execute(sql, params) - -@@ -177,13 +177,13 @@ class SQLiteDatabase(Database): - ids.append(row[0]) - row = self._cur.fetchone() - return ids -- except sqlite.DatabaseError, e: -+ except sqlite.DatabaseError as e: - raise DatabaseException("SQLite: %s" % (e)) - - def _commit(self): - try: - self._con.commit() -- except sqlite.DatabaseError, e: -+ except sqlite.DatabaseError as e: - self._con.rollback() - raise DatabaseException( - "SQLite: Error commiting data to db [%s]" % (e)) -@@ -194,7 +194,7 @@ class SQLiteDatabase(Database): - sql = "SELECT ID FROM TAGS WHERE DATA = ?" - if not isinstance(t, Tag): raise DatabaseException( - "Tried to insert foreign object into database [%s]", t) -- data = cPickle.dumps(t) -+ data = pickle.dumps(t) - - try: - self._cur.execute(sql, [data]) -@@ -205,7 +205,7 @@ class SQLiteDatabase(Database): - sql = "INSERT INTO TAGS(DATA) VALUES(?)" - self._cur.execute(sql, [data]) - ids.append(self._cur.lastrowid) -- except sqlite.DatabaseError, e: -+ except sqlite.DatabaseError as e: - raise DatabaseException("SQLite: %s" % (e)) - return ids - -@@ -214,7 +214,7 @@ class SQLiteDatabase(Database): - sql = "DELETE FROM LOOKUP WHERE NODE = ?" - self._cur.execute(sql, [node.get_id()]) - -- except sqlite.DatabaseError, e: -+ except sqlite.DatabaseError as e: - raise DatabaseException("SQLite: %s" % (e)) - self._commit() - -@@ -228,7 +228,7 @@ class SQLiteDatabase(Database): - - try: - self._cur.execute(sql, params) -- except sqlite.DatabaseError, e: -+ except sqlite.DatabaseError as e: - raise DatabaseException("SQLite: %s" % (e)) - self._commit() - -@@ -236,7 +236,7 @@ class SQLiteDatabase(Database): - try: - sql = "DELETE FROM TAGS WHERE ID NOT IN (SELECT TAG FROM LOOKUP GROUP BY TAG)" - self._cur.execute(sql) -- except sqlite.DatabaseError, e: -+ except sqlite.DatabaseError as e: - raise DatabaseException("SQLite: %s" % (e)) - self._commit() - -@@ -263,7 +263,7 @@ class SQLiteDatabase(Database): - - try: - self._con.commit() -- except DatabaseError, e: -+ except DatabaseError as e: - self._con.rollback() - raise e - -@@ -273,7 +273,7 @@ class SQLiteDatabase(Database): - self._cur.execute(sql, values) - try: - self._con.commit() -- except sqlite.DatabaseError, e: -+ except sqlite.DatabaseError as e: - self._con.rollback() - raise DatabaseException( - "SQLite: Error saving key [%s]" % (e)) ---- pwman/data/factory.py.orig 2007-02-04 18:44:43 UTC -+++ pwman/data/factory.py -@@ -45,19 +45,19 @@ def create(type): - try: - from pwman.data.drivers import sqlite - db = sqlite.SQLiteDatabase() -- except ImportError, e: -+ except ImportError as e: - raise DatabaseException("python-sqlite not installed") - elif (type == "Postgresql"): - try: - from pwman.data.drivers import postgresql - db = postgresql.PostgresqlDatabase() -- except ImportError, e: -+ except ImportError as e: - raise DatabaseException("python-pygresql not installed") - elif (type == "MySQL"): - try: - from pwman.data.drivers import mysql - db = mysql.MySQLDatabase() -- except ImportError, e: -+ except ImportError as e: - raise DatabaseException("python-mysqldb not installed") - else: - raise DatabaseException("Unknown database type specified") ---- pwman/ui/cli.py.orig 2007-02-04 18:44:44 UTC -+++ pwman/ui/cli.py -@@ -40,12 +40,12 @@ import traceback - try: - import readline - _readline_available = True --except ImportError, e: -+except ImportError as e: - _readline_available = False - - class CLICallback(Callback): - def getinput(self, question): -- return raw_input(question) -+ return input(question) - - def getsecret(self, question): - return getpass.getpass(question + ":") -@@ -67,19 +67,19 @@ class ANSI(object): - class PwmanCli(cmd.Cmd): - def error(self, exception): - if (isinstance(exception, KeyboardInterrupt)): -- print -+ print() - else: - # traceback.print_exc() -- print "Error: %s " % (exception) -+ print("Error: %s " % (exception)) - - def do_EOF(self, args): - return self.do_exit(args) - - def do_exit(self, args): -- print -+ print() - try: - self._db.close() -- except Exception, e: -+ except Exception as e: - self.error(e) - return True - -@@ -92,8 +92,8 @@ class PwmanCli(cmd.Cmd): - if m == None: - ids.append(int(i)) - else: -- ids += range(int(m.group(1)), -- int(m.group(2))+1) -+ ids += list(range(int(m.group(1)), -+ int(m.group(2))+1)) - return ids - - def get_filesystem_path(self, default=""): -@@ -108,7 +108,7 @@ class PwmanCli(cmd.Cmd): - length = getinput("Password length (default 7): ", "7") - length = int(length) - (password, dumpme) = generator.generate_password(length, length) -- print "New password: %s" % (password) -+ print("New password: %s" % (password)) - return password - else: - return password -@@ -153,30 +153,30 @@ class PwmanCli(cmd.Cmd): - - def print_node(self, node): - width = str(_defaultwidth) -- print "Node %d." % (node.get_id()) -- print ("%"+width+"s %s") % (typeset("Username:", ANSI.Red), -- node.get_username()) -- print ("%"+width+"s %s") % (typeset("Password:", ANSI.Red), -- node.get_password()) -- print ("%"+width+"s %s") % (typeset("Url:", ANSI.Red), -- node.get_url()) -- print ("%"+width+"s %s") % (typeset("Notes:", ANSI.Red), -- node.get_notes()) -- print typeset("Tags: ", ANSI.Red), -+ print("Node %d." % (node.get_id())) -+ print(("%"+width+"s %s") % (typeset("Username:", ANSI.Red), -+ node.get_username())) -+ print(("%"+width+"s %s") % (typeset("Password:", ANSI.Red), -+ node.get_password())) -+ print(("%"+width+"s %s") % (typeset("Url:", ANSI.Red), -+ node.get_url())) -+ print(("%"+width+"s %s") % (typeset("Notes:", ANSI.Red), -+ node.get_notes())) -+ print(typeset("Tags: ", ANSI.Red), end=' ') - for t in node.get_tags(): -- print "%s " % t.get_name(), -- print -+ print("%s " % t.get_name(), end=' ') -+ print() - - def do_tags(self, arg): - tags = self._db.listtags() - if len(tags) > 0: - tags[0].get_name() # hack to get password request before output -- print "Tags: ", -+ print("Tags: ", end=' ') - if len(tags) == 0: -- print "None", -+ print("None", end=' ') - for t in tags: -- print "%s " % (t.get_name()), -- print -+ print("%s " % (t.get_name()), end=' ') -+ print() - - def complete_filter(self, text, line, begidx, endidx): - strings = [] -@@ -202,19 +202,19 @@ class PwmanCli(cmd.Cmd): - self._db.filter(tags) - - tags = self._db.currenttags() -- print "Current tags: ", -+ print("Current tags: ", end=' ') - if len(tags) == 0: -- print "None", -+ print("None", end=' ') - for t in tags: -- print "%s " % (t.get_name()), -- print -- except Exception, e: -+ print("%s " % (t.get_name()), end=' ') -+ print() -+ except Exception as e: - self.error(e) - - def do_clear(self, args): - try: - self._db.clearfilter() -- except Exception, e: -+ except Exception as e: - self.error(e) - - -@@ -225,7 +225,7 @@ class PwmanCli(cmd.Cmd): - i = int(i) - node = self._db.getnodes([i])[0] - menu = CliMenu() -- print "Editing node %d." % (i) -+ print("Editing node %d." % (i)) - menu.add(CliMenuItem("Username", self.get_username, - node.get_username, - node.set_username)) -@@ -244,7 +244,7 @@ class PwmanCli(cmd.Cmd): - - menu.run() - self._db.editnode(i, node) -- except Exception, e: -+ except Exception as e: - self.error(e) - - -@@ -263,7 +263,7 @@ class PwmanCli(cmd.Cmd): - type = select("Select filetype:", types) - imp = importer.Importer.get(type) - imp.import_data(self._db, i) -- except Exception, e: -+ except Exception as e: - self.error(e) - - def do_export(self, arg): -@@ -292,8 +292,8 @@ class PwmanCli(cmd.Cmd): - if not b: - return - exp.export_data(self._db, file, nodes) -- print "Data exported." -- except Exception, e: -+ print("Data exported.") -+ except Exception as e: - self.error(e) - - def do_new(self, arg): -@@ -306,8 +306,8 @@ class PwmanCli(cmd.Cmd): - tags = self.get_tags() - node.set_tags(tags) - self._db.addnodes([node]) -- print "Password ID: %d" % (node.get_id()) -- except Exception, e: -+ print("Password ID: %d" % (node.get_id())) -+ except Exception as e: - self.error(e) - - def do_print(self, arg): -@@ -315,7 +315,7 @@ class PwmanCli(cmd.Cmd): - try: - node = self._db.getnodes([i]) - self.print_node(node[0]) -- except Exception, e: -+ except Exception as e: - self.error(e) - - def do_rm(self, arg): -@@ -330,8 +330,8 @@ class PwmanCli(cmd.Cmd): - % (n.get_username(), n.get_url()), False) - if b == True: - self._db.removenodes([n]) -- print "%s@%s deleted" % (n.get_username(), n.get_url()) -- except Exception, e: -+ print("%s@%s deleted" % (n.get_username(), n.get_url())) -+ except Exception as e: - self.error(e) - - def do_ls(self, args): -@@ -359,28 +359,28 @@ class PwmanCli(cmd.Cmd): - if len(tagstring) > 20: - tagstring = tagstring[:17] + "..." - -- print typeset("%5d. %-30s %-20s" % (n.get_id(), name, tagstring), -- ANSI.Yellow, False) -+ print(typeset("%5d. %-30s %-20s" % (n.get_id(), name, tagstring), -+ ANSI.Yellow, False)) - i += 1 - if i > 23: - i = 0 - c = getonechar("Press for more, or 'Q' to cancel") - if c == 'q': - break -- except Exception, e: -+ except Exception as e: - self.error(e) - - def do_forget(self, args): - try: - enc = CryptoEngine.get() - enc.forget() -- except Exception,e: -+ except Exception as e: - self.error(e) - - def do_passwd(self, args): - try: - self._db.changepassword() -- except Exception, e: -+ except Exception as e: - self.error(e) - - def do_set(self, args): -@@ -388,29 +388,29 @@ class PwmanCli(cmd.Cmd): - try: - if len(argstrs) == 0: - conf = config.get_conf() -- for s in conf.keys(): -- for n in conf[s].keys(): -- print "%s.%s = %s" % (s, n, conf[s][n]) -+ for s in list(conf.keys()): -+ for n in list(conf[s].keys()): -+ print("%s.%s = %s" % (s, n, conf[s][n])) - elif len(argstrs) == 1: - r = re.compile("(.+)\.(.+)") - m = r.match(argstrs[0]) - if m is None or len(m.groups()) != 2: -- print "Invalid option format" -+ print("Invalid option format") - self.help_set() - return -- print "%s.%s = %s" % (m.group(1), m.group(2), -- config.get_value(m.group(1), m.group(2))) -+ print("%s.%s = %s" % (m.group(1), m.group(2), -+ config.get_value(m.group(1), m.group(2)))) - elif len(argstrs) == 2: - r = re.compile("(.+)\.(.+)") - m = r.match(argstrs[0]) - if m is None or len(m.groups()) != 2: -- print "Invalid option format" -+ print("Invalid option format") - self.help_set() - return - config.set_value(m.group(1), m.group(2), argstrs[1]) - else: - self.help_set() -- except Exception, e: -+ except Exception as e: - self.error(e) - - def do_save(self, args): -@@ -420,103 +420,103 @@ class PwmanCli(cmd.Cmd): - config.save(argstrs[0]) - else: - config.save() -- print "Config saved." -- except Exception, e: -+ print("Config saved.") -+ except Exception as e: - self.error(e) - - ## - ## Help functions - ## - def usage(self, string): -- print "Usage: %s" % (string) -+ print("Usage: %s" % (string)) - - def help_ls(self): - self.help_list() - - def help_list(self): - self.usage("list") -- print "List nodes that match current filter. ls is an alias." -+ print("List nodes that match current filter. ls is an alias.") - - def help_EOF(self): - self.help_quit() - - def help_delete(self): - self.usage("delete ...") -- print "Deletes nodes. rm is an alias." -+ print("Deletes nodes. rm is an alias.") - self._mult_id_help() - - def help_help(self): - self.usage("help [topic]") -- print "Prints a help message for a command." -+ print("Prints a help message for a command.") - - def help_edit(self): - self.usage("edit ... ") -- print "Edits a nodes." -+ print("Edits a nodes.") - self._mult_id_help() - - def help_import(self): - self.usage("import [filename] ...") -- print "Imports a nodes from a file." -+ print("Imports a nodes from a file.") - - def help_export(self): - self.usage("export ... ") -- print "Exports a list of ids to an external format. If no IDs are specified, then all nodes under the current filter are exported." -+ print("Exports a list of ids to an external format. If no IDs are specified, then all nodes under the current filter are exported.") - self._mult_id_help() - - def help_new(self): - self.usage("new") -- print "Creates a new node." -+ print("Creates a new node.") - - def help_rm(self): - self.help_delete() - - def help_print(self): - self.usage("print ...") -- print "Displays a node. ", -+ print("Displays a node. ", end=' ') - self._mult_id_help() - - def _mult_id_help(self): -- print "Multiple ids can be specified, separated by a space. A range of ids can be specified in the format n-N. e.g. 10-20 would specify all ids from 10 to 20 inclusive." -+ print("Multiple ids can be specified, separated by a space. A range of ids can be specified in the format n-N. e.g. 10-20 would specify all ids from 10 to 20 inclusive.") - - def help_exit(self): - self.usage("exit") -- print "Exits the application." -+ print("Exits the application.") - - def help_save(self): - self.usage("save [filename]") -- print "Saves the current configuration to [filename]. If no filename is given, the configuration is saved to the file from which the initial configuration was loaded." -+ print("Saves the current configuration to [filename]. If no filename is given, the configuration is saved to the file from which the initial configuration was loaded.") - - def help_set(self): - self.usage("set [configoption] [value]") -- print "Sets a configuration option. If no value is specified, the current value for [configoption] is output. If neither [configoption] nor [value] are specified, the whole current configuration is output. [configoption] must be of the format
.