This is an automated email from the git hooks/post-receive script. bdrung pushed a commit to branch master in repository devscripts.
commit 00155fed2f035a230eeebb201cafed4debf5f5c8 Author: Benjamin Drung <[email protected]> Date: Tue Jan 12 23:33:26 2016 +0100 wrap-and-sort: Use list comprehension instead of filter A list comprehension is easier to read than a filter function (and it is shorter). Signed-off-by: Benjamin Drung <[email protected]> --- scripts/wrap-and-sort | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/wrap-and-sort b/scripts/wrap-and-sort index 98a4bb5..f9e6e0e 100755 --- a/scripts/wrap-and-sort +++ b/scripts/wrap-and-sort @@ -1,6 +1,6 @@ #!/usr/bin/python3 # -# Copyright (C) 2010-2014, Benjamin Drung <[email protected]> +# Copyright (C) 2010-2016, Benjamin Drung <[email protected]> # 2010, Stefano Rivera <[email protected]> # # Permission to use, copy, modify, and/or distribute this software for any @@ -94,7 +94,7 @@ class WrapAndSortControl(Control): trailing_comma, sort=True): # An empty element is not explicitly disallowed by Policy but known to # break QA tools, so remove any - packages = list(filter(None, [x.strip() for x in control[entry].split(",")])) + packages = [x.strip() for x in control[entry].split(",") if x.strip()] # Sanitize alternative packages. E.g. "a|b |c" -> "a | b | c" packages = [" | ".join([x.strip() for x in p.split("|")]) for p in packages] @@ -130,7 +130,7 @@ class Install(object): def open(self, filename): assert os.path.isfile(filename), "%s does not exist." % (filename) self.filename = filename - self.content = list(filter(None, [l.strip() for l in open(filename).readlines()])) + self.content = [l.strip() for l in open(filename).readlines() if l.strip()] def save(self, filename=None): if filename: -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/collab-maint/devscripts.git _______________________________________________ devscripts-devel mailing list [email protected] http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/devscripts-devel
