Fix api decoding, method arguments, and update commands

Review Request #3745 — Created Jan. 13, 2013 and submitted

Information

RBTools
api

Reviewers

Update commands for api changes

The commands code has been updated to use the new method of specifying
fields to create and update methods. Also changes was the field used
to retrieve the diff body in the patch command.

Fix decoding and make it consistent

A few mimetypes were special cased to change the name of the field
which the response body would be accessed through which was confusing
and inconsistent. Now mimetypes which are not JSON will have the
payload accessible through the 'data' field.

Also fixes a mimetype parsing bug where text/plain was not recognized
due to some servers providing an encoding with the mimetype.

Allow create and update with kwargs

The fields to be sent in POST and PUT requests can now be provided as
kwargs to the update and create methods instead of as a dictionary in
the 'data' argument.
Ran all the rbt commands, ran an updated Review Bot with the changes, manually messed around in interactive mode with the API
reviewbot
  1. This is a review from Review Bot.
      Tool: PEP8 Style Checker
      Processed Files:
        rbtools/api/resource.py
        rbtools/api/decode.py
        rbtools/commands/publish.py
        rbtools/commands/close.py
        rbtools/commands/patch.py
        rbtools/commands/post.py
        rbtools/api/utils.py
      Ignored Files:
    
    
  2. 
      
david
  1. Ship It!
  2. 
      
SM
Review request changed
Status:
Completed
Change Summary:
Pushed to api
(d166d7ee9587336887ff33cfe70d1b2d6a0fc634
de0d481835c16d4849b889eb04cab28f4e5d0544
dfc756592bcb8364668b4c6f23e456e6d8a09633).