Introduce the status command

Review Request #3865 — Created Feb. 11, 2013 and submitted

Information

RBTools
master

Reviewers

Introduce the status command

The status command will display the id and summary of each pending
review request a user has.

Also, the get_root method has been renamed get_api and will now return the
RBClient instance along with the root resource. This allows commands
to receive direct access to the API client which can be useful if they
need to update login information after instantiating the client.

A few of the commands have also been updated to make less requests to
the Review Board server by taking advantage of the uri templates on
the root resource.
Ran commands, used rbt status to check review requests.
Description From Last Updated

Can we add a docstring for this? Also, assuming this is a private function, we should provide an underscore (and …

chipx86chipx86

Might as well include self.get_cookie() right here.

chipx86chipx86

Should this be the same thing? Can we bail out any other way than StopIteration?

chipx86chipx86

Blank line between these.

chipx86chipx86

This seems like something worth having in a common place.

chipx86chipx86

Should probably be a period before and after "Please login"

chipx86chipx86

Does this get outputted in non-debug situations? If so, we should make sure it wraps at 80.

chipx86chipx86

Excess blank line.

chipx86chipx86

"Review Board"

chipx86chipx86

"auth_required"

chipx86chipx86
reviewbot
  1. This is a review from Review Bot.
      Tool: PEP8 Style Checker
      Processed Files:
        rbtools/commands/status.py
        setup.py
        rbtools/commands/__init__.py
      Ignored Files:
    
    
  2. 
      
chipx86
  1. 
      
  2. rbtools/commands/__init__.py (Diff revision 1)
     
     
    Show all issues
    Can we add a docstring for this?
    
    Also, assuming this is a private function, we should provide an underscore (and stick it at the end of the class).
    
    Should this be _make_api_client? Calling it more than once would give different results.
  3. rbtools/commands/__init__.py (Diff revision 1)
     
     
    Show all issues
    Might as well include self.get_cookie() right here.
  4. rbtools/commands/status.py (Diff revision 1)
     
     
     
     
    Show all issues
    Should this be the same thing? Can we bail out any other way than StopIteration?
  5. rbtools/commands/status.py (Diff revision 1)
     
     
     
    Show all issues
    Blank line between these.
  6. rbtools/commands/status.py (Diff revision 1)
     
     
     
     
     
     
     
     
     
     
     
     
     
    Show all issues
    This seems like something worth having in a common place.
  7. rbtools/commands/status.py (Diff revision 1)
     
     
    Show all issues
    Should probably be a period before and after "Please login"
  8. rbtools/commands/status.py (Diff revision 1)
     
     
     
     
     
    Show all issues
    Does this get outputted in non-debug situations? If so, we should make sure it wraps at 80.
    1. This will be output in non-debug situations. 
      
      How do you suggest we take care of wrapping things like this? Should
      we create a logging formatter which will take care of it automatically?
    2. Python has a textwrap module of some sort that would work (rb-site uses this), but for now I'd say just figure out where the natural breaks are for 80 columns and hand-wrap.
    3. I was more referring to wrapping with respect to calls with the logging
      module. (i.e. How can we make logging.warning(...) automatically wrap
      what's printed to the screen.)
    4. Right. I don't know the answer to that. I think we'd probably need our own ConsoleHandler or whatever that put everything through the textwrap module.
  9. rbtools/commands/status.py (Diff revision 1)
     
     
     
    Show all issues
    Excess blank line.
  10. 
      
SM
reviewbot
  1. This is a review from Review Bot.
      Tool: PEP8 Style Checker
      Processed Files:
        rbtools/commands/status.py
        rbtools/api/client.py
        rbtools/commands/__init__.py
        rbtools/commands/close.py
        rbtools/commands/patch.py
        rbtools/commands/post.py
        rbtools/commands/attach.py
        rbtools/commands/publish.py
        setup.py
        rbtools/utils/users.py
      Ignored Files:
    
    
  2. 
      
chipx86
  1. 
      
  2. rbtools/commands/__init__.py (Diff revision 2)
     
     
    Show all issues
    "Review Board"
  3. rbtools/commands/patch.py (Diff revision 2)
     
     
    Can this be done in a common place so that all commands can get it for free?
  4. 
      
SM
reviewbot
  1. This is a review from Review Bot.
      Tool: PEP8 Style Checker
      Processed Files:
        rbtools/commands/status.py
        rbtools/api/client.py
        rbtools/commands/publish.py
        rbtools/commands/close.py
        rbtools/commands/patch.py
        rbtools/commands/post.py
        rbtools/commands/attach.py
        rbtools/commands/__init__.py
        setup.py
        rbtools/utils/users.py
      Ignored Files:
    
    
  2. 
      
chipx86
  1. Found a typo. After that, ship it!
  2. rbtools/utils/users.py (Diff revision 3)
     
     
    Show all issues
    "auth_required"
  3. rbtools/utils/users.py (Diff revision 3)
     
     
     
     
     
     
     
    Eventually we should find a way to handle this without assuming raw input, but that's for another day.
  4. 
      
SM
Review request changed
Status:
Completed
Change Summary:
Pushed to master (fea88b90fa27cd4a841cac502430551d25968d92, 8709d10a5c8dbb6bb5effc79038b96e800b305a8).