mirror of
https://github.com/openSUSE/osc.git
synced 2024-12-26 18:06:13 +01:00
Dedent main code for get_distributions
This commit is contained in:
parent
4d6a6aaf96
commit
3ae3c88a95
25
osc/core.py
25
osc/core.py
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user