Refactor output of commands

Review Request #3847 — Created Feb. 6, 2013 and submitted

Information

RBTools
master

Reviewers

Refactor output of commands

The commands have been refactored to use consistent output
conventions. Any debugging information or non-critical errors should
use the logging module (logging.debug(), logging.error(), etc.). Any
critical errors that halt execution should raise an exception which
will be printed (A stack trace will be printed if debugging is turned
on). Any normal output directed at the user should be printed as
usual.

The clients have yet to be refactored to follow these conventions,
which will happen in a future change.

Also, The base command class now defines a global option list which
is used in addition to the commands option_list. The '[-d | --debug]'
option has been refactored to be a global option.
Tested the new error printing mechanism by triggering the code paths in a couple of commands. Ran post with the -d option and verified debug output.
Description From Last Updated

Col: 17 E128 continuation line under-indented for visual indent

reviewbotreviewbot
reviewbot
  1. This is a review from Review Bot.
      Tool: PEP8 Style Checker
      Processed Files:
        rbtools/commands/__init__.py
        rbtools/commands/diff.py
        rbtools/commands/patch.py
        rbtools/commands/post.py
        rbtools/commands/attach.py
        rbtools/commands/publish.py
        rbtools/commands/close.py
      Ignored Files:
    
    
  2. rbtools/commands/publish.py (Diff revision 1)
     
     
    Show all issues
    Col: 17
     E128 continuation line under-indented for visual indent
    
  3. 
      
SM
reviewbot
  1. This is a review from Review Bot.
      Tool: PEP8 Style Checker
      Processed Files:
        rbtools/commands/__init__.py
        rbtools/commands/diff.py
        rbtools/commands/patch.py
        rbtools/commands/post.py
        rbtools/commands/attach.py
        rbtools/commands/publish.py
        rbtools/commands/close.py
      Ignored Files:
    
    
  2. 
      
david
  1. Most of this looks good. My only real comment is that I think it's frowned upon to raise bare Exception objects. We should probably have a simple error subclass for these.
  2. 
      
SM
reviewbot
  1. This is a review from Review Bot.
      Tool: PEP8 Style Checker
      Processed Files:
        rbtools/commands/__init__.py
        rbtools/commands/diff.py
        rbtools/commands/patch.py
        rbtools/commands/post.py
        rbtools/commands/attach.py
        rbtools/commands/publish.py
        rbtools/commands/close.py
      Ignored Files:
    
    
  2. 
      
chipx86
  1. Ship It!
  2. 
      
SM
Review request changed
Status:
Completed
Change Summary:
Pushed to master (36b26b7e50e4dee0c0bb5054a0c1eb5406c8173c).