salimfadhley/jenkinsapi — pull request #86 by lechat (2013-05-29 15:29:06+00:00)
Title: Cleaned create_view, added delete_view

Hi,

I cleaned up Jenkins.create_view method:
* set it to use self.hit_url instead urllib
* put messages into debug instead of returning them as a result
* added more debug messages, in case somebody needs to see what's wrong

Unfortunately, this changes API - method now returns View object if view has been created (as it was stated previously in docs, but in reality string was returned), None if something went wrong. I think it is cleaner that way, matches the docs, but it may break somebody else's code.

Added Jenkins.delete_view method, which takes view name, checks if it exists and deletes it. Again, returns False if something went wrong, True if ok.

Added example for all of this.

All of this works for out of the box SimpleListView, I'll add other view types and nested views later. Plus, adding jobs to an existing view doesn't seems to work...