From 2baad18f1f118c5bee90cb3c1317cf3b0c0a40e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcus=20H=C3=BCwe?= Date: Thu, 7 May 2009 19:13:50 +0000 Subject: [PATCH] - use list comprehensions instead of map/lambda (this is more pythonic:) ) --- osc/commandline.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osc/commandline.py b/osc/commandline.py index b8743bad..356add1e 100755 --- a/osc/commandline.py +++ b/osc/commandline.py @@ -2919,7 +2919,7 @@ Please submit there instead, or use --nodevelproject to force direct submission. root_new = ET.parse(StringIO(''.join(meta))).getroot() dir_new = { 'apiurl': apiurl, 'project': prj, 'package': package } dir_new['srcmd5'] = root_new.get('srcmd5') - dir_new['entries'] = map(lambda e: [e.get('name'), e.get('md5')], root_new.findall('entry')) + dir_new['entries'] = [[n.get('name'), n.get('md5')] for n in root_new.findall('entry')] query = { 'rev': workingrev } u = makeurl(apiurl, ['source', prj, package], query=query) @@ -2932,7 +2932,7 @@ Please submit there instead, or use --nodevelproject to force direct submission. raise oscerr.APIError('working rev is not working?') dir_oldpatched = { 'apiurl': apiurl, 'project': prj, 'package': package } dir_oldpatched['srcmd5'] = root_oldpatched.get('srcmd5') - dir_oldpatched['entries'] = map(lambda e: [e.get('name'), e.get('md5')], root_oldpatched.findall('entry')) + dir_oldpatched['entries'] = [[n.get('name'), n.get('md5')] for n in root_oldpatched.findall('entry')] query = {} query['rev'] = linkinfo_oldpatched.get('srcmd5') @@ -2943,7 +2943,7 @@ Please submit there instead, or use --nodevelproject to force direct submission. dir_old['project'] = linkinfo_oldpatched.get('project') dir_old['package'] = linkinfo_oldpatched.get('package') dir_old['srcmd5'] = root_old.get('srcmd5') - dir_old['entries'] = map(lambda e: [e.get('name'), e.get('md5')], root_old.findall('entry')) + dir_old['entries'] = [[n.get('name'), n.get('md5')] for n in root_old.findall('entry')] entries_old = dict(dir_old['entries']) entries_oldpatched = dict(dir_oldpatched['entries'])