Use list comprehensions
https://docs.python.org/3/tutorial/datastructures.html#list-comprehensions
This commit is contained in:
parent
09d1a3c82f
commit
82e59a951d
2 changed files with 2 additions and 8 deletions
|
|
@ -19,12 +19,9 @@ def makearchive (dest, manifest, root):
|
|||
def parse_packagedb (packagedb_loc):
|
||||
"""Parses a jhbuild packagedb.xml file"""
|
||||
|
||||
packages = []
|
||||
|
||||
tree = ElementTree.parse (packagedb_loc)
|
||||
root = tree.getroot ()
|
||||
for child in root:
|
||||
packages.append (child.attrib)
|
||||
packages = [child.attrib for child in root]
|
||||
|
||||
return packages
|
||||
|
||||
|
|
|
|||
|
|
@ -94,10 +94,7 @@ def colorxhtml(img, drawable, filename, raw_filename,
|
|||
|
||||
chars = chars.translate(allchars, badchars)
|
||||
|
||||
data = []
|
||||
|
||||
for c in chars:
|
||||
data.append(escape_table.get(c, c))
|
||||
data = [escape_table.get(c, c) for c in chars]
|
||||
|
||||
if data:
|
||||
data.reverse()
|
||||
|
|
|
|||
Loading…
Reference in a new issue