[Reproducible-commits] [misc] 01/01: clean-notes: pep8 cleanup
Mattia Rizzolo
mapreri-guest at moszumanska.debian.org
Thu Feb 19 23:58:32 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 7f3c31ed702572682b4a44785609bb2e0dfb08e4
Author: Mattia Rizzolo <mattia at mapreri.org>
Date: Fri Feb 20 00:57:56 2015 +0100
clean-notes: pep8 cleanup
---
clean-notes | 32 ++++++++++++++++++++------------
1 file changed, 20 insertions(+), 12 deletions(-)
diff --git a/clean-notes b/clean-notes
index c9ccc68..90df2c0 100755
--- a/clean-notes
+++ b/clean-notes
@@ -39,22 +39,28 @@ import requests
# was taken from the pyyaml sources (Copyright © 2006 Kirill Simonov
# <xi at resolvent.net> under a Expat/MIT license) and modified with a set of
# already seen nodes.
+
+
def scalar_node_eq(self, other):
- return self.id == other.id and self.tag == other.tag and self.value == other.value
+ return self.id == other.id and \
+ self.tag == other.tag and \
+ self.value == other.value
yaml.nodes.ScalarNode.__eq__ = scalar_node_eq
+
def scalar_node_hash(self):
- return hash((self.id,self.tag,self.value))
+ return hash((self.id, self.tag, self.value))
yaml.nodes.ScalarNode.__hash__ = scalar_node_hash
+
def compose_mapping_node(self, anchor):
start_event = self.get_event()
tag = start_event.tag
if tag is None or tag == u'!':
tag = self.resolve(yaml.nodes.MappingNode, None, start_event.implicit)
node = yaml.nodes.MappingNode(tag, [],
- start_event.start_mark, None,
- flow_style=start_event.flow_style)
+ start_event.start_mark, None,
+ flow_style=start_event.flow_style)
if anchor is not None:
self.anchors[anchor] = node
seen = set()
@@ -62,8 +68,10 @@ def compose_mapping_node(self, anchor):
key_event = self.peek_event()
item_key = self.compose_node(node, None)
if item_key in seen:
- raise yaml.composer.ComposerError("while composing a mapping", start_event.start_mark,
- "found duplicate key", key_event.start_mark)
+ raise yaml.composer.ComposerError("while composing a mapping",
+ start_event.start_mark,
+ "found duplicate key",
+ key_event.start_mark)
seen.add(item_key)
item_value = self.compose_node(node, item_key)
node.value.append((item_key, item_value))
@@ -153,7 +161,7 @@ def load_reproducible_status():
except FileNotFoundError:
r = requests.get(reproducible_json)
r = r.json()
- return dict(((item['package'], item) for item in r))
+ return dict((item['package'], item) for item in r)
def load_notes():
@@ -218,15 +226,15 @@ def find_old_notes(testedpkgs, notes):
continue
item = testedpkgs[pkg]
if item['version'] == notes[pkg].get('version') and \
- item['status'] == 'reproducible'and \
- 'fixed-magically' not in args.disable:
- print("The package " + pkg + " has a note for the version "
- + item['version'] + " but that version is reproducible")
+ item['status'] == 'reproducible'and \
+ '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 \
apt_pkg.version_compare(str(item['version']),
str(notes[pkg]['version'])) > 0:
print("The package " + pkg +
- " is now reproducible but still listed in the notes")
+ " is now reproducible but still listed in the notes")
toremove.append(pkg)
if notes[pkg].get('version') and \
apt_pkg.version_compare(str(item['version']),
--
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