Skip to content

Commit

Permalink
Simplify looping over /distributions XML
Browse files Browse the repository at this point in the history
  • Loading branch information
abitrolly committed Nov 14, 2020
1 parent d7594dd commit c000e0e
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions osc/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -5604,14 +5604,9 @@ def get_distibutions(apiurl, discon=False):

for node in root.findall('distribution'):
rmap = {}
for node2 in node.findall('name'):
rmap['name'] = node2.text
for node3 in node.findall('project'):
rmap['project'] = node3.text
for node4 in node.findall('repository'):
rmap['repository'] = node4.text
for node5 in node.findall('reponame'):
rmap['reponame'] = node5.text
for child in node:
if child.tag in ('name', 'project', 'repository', 'reponame'):
rmap[child.tag] = child.text
r.append(result_line_templ % rmap)

r.insert(0, 'distribution project repository reponame')
Expand Down

0 comments on commit c000e0e

Please sign in to comment.