diff mbox

[10/10] pwclient: Integrate 'status' endpoint

Message ID 1438160328-4912-11-git-send-email-stephen.finucane@intel.com
State Superseded
Headers show

Commit Message

Stephen Finucane July 29, 2015, 8:58 a.m. UTC
Signed-off-by: Stephen Finucane <stephen.finucane@intel.com>
---
 patchwork/bin/pwclient | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
diff mbox

Patch

diff --git a/patchwork/bin/pwclient b/patchwork/bin/pwclient
index 8d1f476..bcb0293 100755
--- a/patchwork/bin/pwclient
+++ b/patchwork/bin/pwclient
@@ -207,6 +207,11 @@  def action_projects(rpc):
                 project['linkname'], \
                 project['name']))
 
+def action_statuses(rpc):
+    statuses = rpc.status_list("", 0)
+    for status in statuses:
+        print("%d (for '%s')" % (status['id'], status['patch']))
+
 def action_states(rpc):
     states = rpc.state_list("", 0)
     print("%-5s %s" % ("ID", "Name"))
@@ -466,6 +471,12 @@  def main():
         help='''List all projects'''
     )
     projects_parser.set_defaults(subcmd='projects')
+    statuses_parser = subparsers.add_parser(
+        'statuses',
+        add_help=False,
+        help='''Show list of patch statuses'''
+    )
+    statuses_parser.set_defaults(subcmd='statuses')
     states_parser = subparsers.add_parser(
         'states',
         add_help=False,
@@ -680,6 +691,9 @@  def main():
     elif action.startswith('project'):
         action_projects(rpc)
 
+    elif action.startswith('status'):
+        action_statuses(rpc)
+
     elif action.startswith('state'):
         action_states(rpc)