1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-12-26 01:46:13 +01:00

Dedent main code for get_distributions

This commit is contained in:
Anatoli Babenia 2022-07-29 23:04:58 +03:00
parent 4d6a6aaf96
commit 3ae3c88a95

View File

@ -5625,20 +5625,19 @@ def get_distributions(apiurl, discon=False):
r.insert(1, '------------ -------')
return r
else:
f = http_GET(makeurl(apiurl, ['distributions']))
root = ET.fromstring(b''.join(f))
f = http_GET(makeurl(apiurl, ['distributions']))
root = ET.fromstring(b''.join(f))
distlist = []
for node in root.findall('distribution'):
dmap = {}
for child in node:
if child.tag == 'name':
dmap['distribution'] = child.text
elif child.tag in ('project', 'repository', 'reponame'):
dmap[child.tag] = child.text
distlist.append(dmap)
return distlist
distlist = []
for node in root.findall('distribution'):
dmap = {}
for child in node:
if child.tag == 'name':
dmap['distribution'] = child.text
elif child.tag in ('project', 'repository', 'reponame'):
dmap[child.tag] = child.text
distlist.append(dmap)
return distlist
# old compat lib call