@@ -160,7 +160,7 @@ def usage():
sys.stderr.write("""\nFilter options for 'list' and 'search':
-s <state> : Filter by patch state (e.g., 'New', 'Accepted', etc.)
-p <project> : Filter by project name (see 'projects' for list)
- -w <who> : Filter by submitter (name, e-mail substring search)
+ -w <who> : Filter by submitter (name, e-mail substring, or ID)
-d <who> : Filter by delegate (name, e-mail substring search)
-n <max #> : Restrict number of results
-m <messageid>: Filter by Message-Id\n""")
@@ -190,10 +190,17 @@ def state_id_by_name(rpc, name):
return 0
def person_ids_by_name(rpc, name):
- """Given a partial name or email address, return a list of the
- person IDs that match."""
+ """Given a partial name, email address, or submitter ID, return a list
+ of the person IDs that match."""
if len(name) == 0:
return []
+
+ # If the ID is an int then assume it's a submitter ID.
+ try:
+ return [ int(name) ]
+ except ValueError:
+ pass
+
people = rpc.person_list(name, 0)
return map(lambda x: x['id'], people)
Now that we can know what the submitter id is for a given email address (because of the info command), allow it to be used to list patches. This can be used to work around problems with patchwork servers that have problems with users that have no real name. Signed-off-by: Doug Anderson <dianders@chromium.org> --- Changes in v2: None apps/patchwork/bin/pwclient | 13 ++++++++++--- 1 files changed, 10 insertions(+), 3 deletions(-)