1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-01-12 16:56:15 +01:00

xml parse result of branch

This commit is contained in:
Ludwig Nussel 2011-12-12 09:55:14 +01:00
parent f53e40b2fd
commit 842df7e511

View File

@ -4385,12 +4385,19 @@ def attribute_branch_pkg(apiurl, attribute, maintained_update_project_attribute,
msg = msg.split('</summary>')[0]
raise oscerr.APIError(msg)
r = f.read()
if dryrun:
return ET.fromstring(r)
r = None
root = ET.fromstring(f.read())
if dryrun:
return root
# TODO: change api here and return parsed XML as class
if conf.config['http_debug']:
print >> sys.stderr, ET.tostring(root)
for node in root.findall('data'):
r = node.get('name')
if r and r == 'targetproject':
return node.text
r = r.split('targetproject">')[1]
r = r.split('</data>')[0]
return r
@ -4435,6 +4442,8 @@ def branch_pkg(apiurl, src_project, src_package, nodevelproject=False, rev=None,
raise
return (True, m.group(1), m.group(2), None, None)
if conf.config['http_debug']:
print >> sys.stderr, ET.tostring(root)
data = {}
for i in ET.fromstring(f.read()).findall('data'):
data[i.get('name')] = i.text