From fe1ae7240addf3588dbbf67865ae466539b49d3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Tue, 13 Feb 2018 09:26:11 +0100 Subject: [PATCH] python formatting. Run autopep8 and replace tabs with spaces. autopep8 -i --max-line-length=160 *.py sed -i 's/\t/ /' *.py [ci skip] --- tools/daca2-report.py | 4 +++- tools/daca2.py | 2 +- tools/trac-keywords.py | 7 +++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/tools/daca2-report.py b/tools/daca2-report.py index c471f34ba..6cec33ae7 100644 --- a/tools/daca2-report.py +++ b/tools/daca2-report.py @@ -3,6 +3,7 @@ import os import sys import re + def readdate(data): if data[:5] == 'DATE ': datepos = 0 @@ -30,11 +31,12 @@ def readdate(data): return None datepos += 1 + def summaryHtml(style, font, text1, text2, text3): font1 = '' font2 = '' if font: - font1 = font + font1 = font font2 = '' return ' ' + '' + font1 + text1 + font2 + ' ' + diff --git a/tools/daca2.py b/tools/daca2.py index 1c2773ca7..26e4c4543 100644 --- a/tools/daca2.py +++ b/tools/daca2.py @@ -215,7 +215,7 @@ try: for archive in archives: if len(args.skip) > 0: a = archive[:archive.rfind('/')] - a = a[a.rfind('/')+1:] + a = a[a.rfind('/') + 1:] if a in args.skip: continue scanarchive(archive, args.jobs, args.cpulimit) diff --git a/tools/trac-keywords.py b/tools/trac-keywords.py index 2c5ff7060..9449bc2a4 100644 --- a/tools/trac-keywords.py +++ b/tools/trac-keywords.py @@ -4,6 +4,7 @@ import sys TRACDB = 'trac.db' + def readdb(): global TRACDB cmds = ['sqlite3', TRACDB, 'SELECT id,keywords FROM ticket WHERE status<>"closed";'] @@ -16,12 +17,12 @@ def readdb(): if pos1 <= 0: continue nr = line[:pos1] - for kw in line[pos1+1:].split(' '): + for kw in line[pos1 + 1:].split(' '): if kw == '': continue if kw not in ret: ret[kw] = [] - ret[kw].append(nr); + ret[kw].append(nr) return ret for arg in sys.argv[1:]: @@ -35,5 +36,3 @@ for kw in sorted(data.keys()): for ticket in data[kw]: out = out + ' ' + ticket print(out) - -