Add requirements and make PEP8 happy
Cosmetic changes only.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
diff --git a/graph-paths.py b/graph-paths.py
index edfea69..46f34b0 100755
--- a/graph-paths.py
+++ b/graph-paths.py
@@ -124,16 +124,16 @@
cursor = dbconn.cursor()
if not cmdargs.fromkey:
- t_keyid = get_u_keyid(cursor)
- if t_keyid is None:
+ fromkey = get_u_keyid(cursor)
+ if fromkey is None:
logger.critical('Could not find ultimate-trust key, try specifying --fromkey')
sys.exit(1)
else:
- t_keyid = cmdargs.fromkey[-16:].upper()
+ fromkey = cmdargs.fromkey[-16:].upper()
- b_keyid = cmdargs.tokey[-16:].upper()
+ tokey = cmdargs.tokey[-16:].upper()
- paths = get_key_paths(cursor, t_keyid, b_keyid, cmdargs.maxdepth, cmdargs.maxpaths)
+ key_paths = get_key_paths(cursor, fromkey, tokey, cmdargs.maxdepth, cmdargs.maxpaths)
graph = pd.Dot(
graph_type='digraph',
@@ -143,9 +143,8 @@
fontsize=cmdargs.fontsize,
)
- wotmate.draw_key_paths(cursor, paths, graph, cmdargs.show_trust)
+ wotmate.draw_key_paths(cursor, key_paths, graph, cmdargs.show_trust)
chunks = cmdargs.out.split('.')
outformat = chunks[-1]
graph.write(cmdargs.out, format=outformat)
-
diff --git a/graph-to-full.py b/graph-to-full.py
index 1fedada..c5ed1f8 100755
--- a/graph-to-full.py
+++ b/graph-to-full.py
@@ -101,9 +101,9 @@
dbconn = sqlite3.connect(cmdargs.dbfile)
cursor = dbconn.cursor()
- b_keyid = cmdargs.tokey[-16:].upper()
+ tokey = cmdargs.tokey[-16:].upper()
- paths = get_key_paths(cursor, b_keyid, cmdargs.maxdepth)
+ key_paths = get_key_paths(cursor, tokey, cmdargs.maxdepth)
graph = pd.Dot(
graph_type='digraph',
@@ -113,7 +113,7 @@
fontsize=cmdargs.fontsize,
)
- wotmate.draw_key_paths(cursor, paths, graph, cmdargs.show_trust)
+ wotmate.draw_key_paths(cursor, key_paths, graph, cmdargs.show_trust)
chunks = cmdargs.out.split('.')
outformat = chunks[-1]
diff --git a/make-sqlitedb.py b/make-sqlitedb.py
index 5ad5b1b..c2bd748 100755
--- a/make-sqlitedb.py
+++ b/make-sqlitedb.py
@@ -24,6 +24,7 @@
import sqlite3
import wotmate
+
def populate_all_pubkeys(c, use_weak):
logger.info('Loading all valid pubkeys')
keyid_rowid_map = {}
@@ -103,7 +104,7 @@
try:
fields = wotmate.gpg_get_fields(line)
- except UnicodeDecodeError as ex:
+ except UnicodeDecodeError:
# Broken uid, ignore it
uidrowid = None
continue
@@ -132,7 +133,6 @@
# We use this map to eject revoked sigs before we store them
# We only want sig types 0x10-13
- sigtype = 0x10
if len(fields[10]) >= 2:
sigtype = int(fields[10][:2], base=16)
if sigtype == 0x30:
@@ -213,9 +213,9 @@
pass
dbconn = sqlite3.connect(cmdargs.dbfile)
- c = dbconn.cursor()
- wotmate.init_sqlite_db(c)
- keyid_rowid_map = populate_all_pubkeys(c, cmdargs.use_weak)
- populate_uid_sig_data(c, keyid_rowid_map)
+ cursor = dbconn.cursor()
+ wotmate.init_sqlite_db(cursor)
+ kr_map = populate_all_pubkeys(cursor, cmdargs.use_weak)
+ populate_uid_sig_data(cursor, kr_map)
dbconn.close()
logger.info('Wrote out %s' % cmdargs.dbfile)
diff --git a/requirements.txt b/requirements.txt
new file mode 100644
index 0000000..cf62e20
--- /dev/null
+++ b/requirements.txt
@@ -0,0 +1 @@
+pydotplus
\ No newline at end of file
diff --git a/wotmate/__init__.py b/wotmate/__init__.py
index a357979..f1c50e4 100644
--- a/wotmate/__init__.py
+++ b/wotmate/__init__.py
@@ -209,7 +209,6 @@
except IndexError:
show = ''
-
if algo in ALGOS.keys():
algosize = '%s %s' % (ALGOS[algo], size)
else: