afgane/bioblend — pull request #42 by cjav (2013-09-12 16:05:07+00:00)
Title: Added galaxy.libraries.get_folders().

I ran into the need of getting the list of folders in a library. I realized this was not a method already implemented. I was wondering if this is something you might want to add to bioblend.

Sorry about the newline thingy at the end of the file. Vim added it automatically. Let me know if you would prefer a pull request without it.

```
>>> gi.libraries.create_library('bioblend-dev')
{u'url': u'/api/libraries/d7155af8715f79bb', u'id': u'd7155af8715f79bb', u'name': u'bioblend-dev'}

>>> gi.libraries.create_folder('d7155af8715f79bb', 'folder_1')
[{u'url': u'/api/libraries/d7155af8715f79bb/contents/F777f57b217444f0e', u'id': u'F777f57b217444f0e', u'name': u'folder_1'}]

>>> gi.libraries.create_folder('d7155af8715f79bb', 'folder_2')
[{u'url': u'/api/libraries/d7155af8715f79bb/contents/F4230d9272de5d3a4', u'id': u'F4230d9272de5d3a4', u'name': u'folder_2'}]

>>> gi.libraries.get_folders('d7155af8715f79bb')
[{u'url': u'/api/libraries/d7155af8715f79bb/contents/F96803d911f93eda1', u'type': u'folder', u'id': u'F96803d911f93eda1', u'name': u'/'}, {u'url': u'/api/libraries/d7155af8715f79bb/contents/F777f57b217444f0e', u'type': u'folder', u'id': u'F777f57b217444f0e', u'name': u'/folder_1'}, {u'url': u'/api/libraries/d7155af8715f79bb/contents/F4230d9272de5d3a4', u'type': u'folder', u'id': u'F4230d9272de5d3a4', u'name': u'/folder_2'}]

>>> gi.libraries.get_folders('d7155af8715f79bb', name='/folder_1')
[{u'url': u'/api/libraries/d7155af8715f79bb/contents/F777f57b217444f0e', u'type': u'folder', u'id': u'F777f57b217444f0e', u'name': u'/folder_1'}]

>>> gi.libraries.get_folders('d7155af8715f79bb', folder_id='F4230d9272de5d3a4')
[{u'url': u'/api/libraries/d7155af8715f79bb/contents/F4230d9272de5d3a4', u'type': u'folder', u'id': u'F4230d9272de5d3a4', u'name': u'/folder_2'}]
```