From 82afcefecea39360b93444548f2cca5fa591ace5 Mon Sep 17 00:00:00 2001 From: Daniel Mach Date: Mon, 12 Feb 2024 15:13:09 +0100 Subject: [PATCH] Migrate core.show_devel_project() to obs_api.Package --- osc/core.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/osc/core.py b/osc/core.py index 321623dd9e..27e80a06b3 100644 --- a/osc/core.py +++ b/osc/core.py @@ -3864,12 +3864,15 @@ def show_scmsync(apiurl, prj, pac=None): def show_devel_project(apiurl, prj, pac): - m = show_package_meta(apiurl, prj, pac) - node = ET.fromstring(b''.join(m)).find('devel') - if node is None: + from . import obs_api + + package_obj = obs_api.Package.from_api(apiurl, prj, pac) + if package_obj.devel is None: return None, None - else: - return node.get('project'), node.get('package', None) + + # mute a false-positive: Instance of 'dict' has no 'project' member (no-member) + # pylint: disable=no-member + return package_obj.devel.project, package_obj.devel.package def set_devel_project(apiurl, prj, pac, devprj=None, devpac=None, print_to="debug"):