mirror of
https://github.com/openSUSE/osc.git
synced 2025-01-24 22:06:14 +01:00
Remove unused code for discontinued distributions
This commit is contained in:
parent
5751222bd0
commit
d9bc6d1c12
@ -5341,10 +5341,6 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
||||
|
||||
|
||||
@cmdln.alias('dists')
|
||||
# FIXME: using just ^DISCONTINUED as match is not a general approach and only valid for one instance
|
||||
# we need to discuss an api call for that, if we need this
|
||||
# @cmdln.option('-d', '--discontinued', action='store_true',
|
||||
# help='show discontinued distributions')
|
||||
def do_distributions(self, subcmd, opts, *args):
|
||||
"""${cmd_name}: Shows all available distributions
|
||||
|
||||
|
20
osc/core.py
20
osc/core.py
@ -5603,28 +5603,10 @@ def get_repositories(apiurl):
|
||||
return r
|
||||
|
||||
|
||||
def get_distributions(apiurl, discon=False):
|
||||
def get_distributions(apiurl):
|
||||
"""Returns list of dicts with headers
|
||||
'distribution', 'project', 'repository', 'reponame'"""
|
||||
|
||||
# FIXME: this is just a naming convention on api.opensuse.org, but not a general valid apparoach
|
||||
if discon:
|
||||
r = []
|
||||
result_line_templ = '%(name)-25s %(project)s'
|
||||
f = http_GET(makeurl(apiurl, ['build']))
|
||||
root = ET.fromstring(''.join(f))
|
||||
|
||||
for node in root.findall('entry'):
|
||||
if node.get('name').startswith('DISCONTINUED:'):
|
||||
rmap = {}
|
||||
rmap['name'] = node.get('name').replace('DISCONTINUED:', '').replace(':', ' ')
|
||||
rmap['project'] = node.get('name')
|
||||
r.append(result_line_templ % rmap)
|
||||
|
||||
r.insert(0, 'distribution project')
|
||||
r.insert(1, '------------ -------')
|
||||
return r
|
||||
|
||||
f = http_GET(makeurl(apiurl, ['distributions']))
|
||||
root = ET.fromstring(b''.join(f))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user