From f50fceb55d5530318dac1d2bf679558268a2a230 Mon Sep 17 00:00:00 2001 From: Nate Case Date: Wed, 10 Sep 2008 17:14:33 -0500 Subject: pwclient: Get rid of underscore to dash replacement I was erroneously doing some string substitutions so that it would find project names with an underscore in the name. It was only necessary due to a side effect of a bug fixed in commit 35241d528c3699b982730a333e236d57dc6451b6 (find project by linkname, not full name). In my test case, I had an underscore in the linkname, but a dash in the full name. No such string replacement is necessary, and actually breaks filtering by projects with an underscore in the name now that we're searching by linkname properly. Signed-off-by: Nate Case Signed-off-by: Jeremy Kerr --- apps/patchwork/bin/pwclient | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'apps/patchwork') diff --git a/apps/patchwork/bin/pwclient b/apps/patchwork/bin/pwclient index 9b35240..e25212a 100755 --- a/apps/patchwork/bin/pwclient +++ b/apps/patchwork/bin/pwclient @@ -128,11 +128,9 @@ def project_id_by_name(rpc, linkname): """Given a project short name, look up the Project ID.""" if len(linkname) == 0: return 0 - # The search requires - instead of _ - search = linkname.replace("_", "-") - projects = rpc.project_list(search, 0) + projects = rpc.project_list(linkname, 0) for project in projects: - if project['linkname'].replace("_", "-") == search: + if project['linkname'] == linkname: return project['id'] return 0 @@ -205,7 +203,7 @@ def action_projects(rpc): print("%-5s %-24s %s" % ("--", "----", "-----------")) for project in projects: print("%-5d %-24s %s" % (project['id'], \ - project['linkname'].replace("_", "-"), \ + project['linkname'], \ project['name'])) def action_states(rpc): -- cgit v1.2.3