[Reproducible-commits] [misc] 03/04: clean-notes: pep8 cleanup. lines > 79 chars go out of my terminal
Mattia Rizzolo
mattia at mapreri.org
Wed Jun 24 14:35:36 UTC 2015
This is an automated email from the git hooks/post-receive script.
mapreri-guest pushed a commit to branch master
in repository misc.
commit 0e0c6ad5b30aedce247a7f444f13e9f924bd7aa2
Author: Mattia Rizzolo <mattia at mapreri.org>
Date: Wed Jun 24 13:47:10 2015 +0000
clean-notes: pep8 cleanup. lines > 79 chars go out of my terminal
---
clean-notes | 36 +++++++++++++++++++++---------------
1 file changed, 21 insertions(+), 15 deletions(-)
diff --git a/clean-notes b/clean-notes
index 7b046fe..08da45b 100755
--- a/clean-notes
+++ b/clean-notes
@@ -27,25 +27,27 @@ notes_yaml = 'packages.yml'
# {package_name: {version: 0.0.0, comments: "blablabla", bugs: [111, 222],
# issues: [issue1, issue2]}, {...}}
-description = """Housekeep the packages.yml file from the notes.git repository.
+desc = """Housekeep the packages.yml file from the notes.git repository.
This script is also able to show you other information:
* missing-version: list notes without version
* fixed-magically: list notes which version is marked as reproducible
* now fixed: list notes of package where a greater version is reproducible
-* new-tested-version: there is a new version tested in jenkins, but the package
- is not reproducible anyway...
+* new-tested-version: there is a new version tested in jenkins, but the
+ package is not reproducible anyway...
* missing-usertagged: list usertagged bugs but not listed in the notes
* not-usertagged: list bugs listed in notes but without usertags
"""
-parser = argparse.ArgumentParser(description=description,
- formatter_class=argparse.RawTextHelpFormatter)
+parser = argparse.ArgumentParser(description=desc,
+ formatter_class=argparse.RawTextHelpFormatter
+ )
parser.add_argument('-e', '--enable', action='append', default=[],
help="enable a particular view (choose from above)")
parser.add_argument('-d', '--disable', action='append', default=[],
help="disable a particular view (choose from above)")
parser.add_argument("--ignore-duplicates", action="store_true",
- help="ATTENTION! This option remove any duplicated field present in the file!")
+ help="ATTENTION! This option remove any duplicated " +
+ "field present in the file!")
parser.add_argument('-s', '--sort-only', action='store_true',
help='Only sort the notes, do no clean up')
parser.add_argument("-v", "--verbose", action="store_true")
@@ -61,11 +63,11 @@ if __name__ == '__main__':
disabled_features = [
'fixed-magically',
'new-tested-version',
-# 'missing-version',
'missing-usertagged',
'not-usertagged',
'now-fixed',
]
+# 'missing-version',
args.disable.extend(disabled_features)
for feature in args.enable:
if feature in args.disable:
@@ -85,7 +87,7 @@ if __name__ == '__main__':
# and column number in the error output, it is easy to find the offending key
# and manually merge their content.
#
-# It seems the only way to implement this is to monkey-patch the pyyaml loader.
+# It seems the only way to do this is to monkey-patch the pyyaml loader.
# To allow ScalarNode objects in a dictionary, their __eq__ and __hash__
# methods have to be patched.
#
@@ -137,6 +139,7 @@ if __name__ == '__main__':
if not args.ignore_duplicates:
yaml.composer.Composer.compose_mapping_node = compose_mapping_node
+
def error(*objs):
print("ERROR: ", *objs, file=sys.stderr)
@@ -216,7 +219,7 @@ def check_notes_validity(notes, testedpkgs):
def check_bugs(notes):
"""
- This function check whether all the bugs listed in notes.git are usertagged
+ This function check that all the bugs listed in notes.git are usertagged
"""
bugs = []
for pkg in sorted(notes, key=str):
@@ -257,7 +260,8 @@ def find_old_notes(testedpkgs, notes):
try:
item = testedpkgs[pkg]
except KeyError:
- # this is due to https://anonscm.debian.org/cgit/qa/jenkins.debian.net.git/commit/?id=27530903da1ce04e2e9c8089a9ae7b4413f75d9d
+ # this is due to
+# https://anonscm.debian.org/cgit/qa/jenkins.debian.net.git/commit/?id=275309
# and later commits to that file, otherwise this would be
# quite a issue
if args.verbose:
@@ -268,16 +272,17 @@ def find_old_notes(testedpkgs, notes):
'fixed-magically' not in args.disable:
print("The package " + pkg + " has a note for the version " +
item['version'] + " but that version is reproducible")
- if item['status'] == 'reproducible' and notes[pkg].get('version') and \
+ if item['status'] == 'reproducible' and \
+ notes[pkg].get('version') and \
'now-fixed' not in args.disable and \
version_compare(str(item['version']),
- str(notes[pkg]['version'])) > 0:
+ str(notes[pkg]['version'])) > 0:
print("The package " + pkg +
" is now reproducible but still listed in the notes")
toremove.append(pkg)
if notes[pkg].get('version') and \
version_compare(str(item['version']),
- str(notes[pkg]['version'])) > 0:
+ str(notes[pkg]['version'])) > 0:
if 'new-tested-version' not in args.disable:
print("The package " + pkg + " has a new tested version")
return toremove
@@ -292,8 +297,9 @@ def is_virtual_package(package):
def get_bugs():
- rows = query_udd("""SELECT * FROM bugs_usertags WHERE
- email='reproducible-builds at lists.alioth.debian.org'""")
+ query = 'SELECT * FROM bugs_usertags ' + \
+ 'WHERE email="reproducible-builds at lists.alioth.debian.org"'
+ rows = query_udd(query)
# returns a list of tuples (email, tag, id)
bugs = {}
for tag in rows:
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/misc.git
More information about the Reproducible-commits
mailing list