A Gallery 3 Python library
crustymonkey
Joined: 2010-11-13
Posts: 11 |
Posted: Thu, 2010-12-16 18:21 |
I just finished putting the finishing touches on my first run through of Python library that uses the new Gallery 3 REST API for access. If there are any Python programmers that want to play with this, the download and documentation are on my site at: http://stuffivelearned.org/doku.php?id=programming:python:libgal3. I know there are some limitations at this point, but I'm hoping to have the time to crank out some more functionality in the future. I'm open to suggestions and comments on this and let me know if you run into any snags along the way. |
|
Posts: 7994
Awesome! Would you be interested in putting this into our git repo? I think it'd go here:
https://github.com/gallery/gallery3-contrib/tree/master/3.0/client
Make a python directory there and put your library in it. That'd be stellar, I'm sure lots of other folks will appreciate this.
---
Problems? Check gallery3/var/logs
file a bug/feature ticket | upgrade to the latest code! | hacking G3? join us on IRC!
Posts: 11
Yep, I'll take a look at that tomorrow. I should have some time to push that to the gallery repo as well.
Posts: 11
I only have read access to that directory within the repos. You can either grant me write access to that or just add the Python library as a git "submodule" and then you can just pull changes from the main github repos. at git://github.com/crustymonkey/pylibgal3.git (if github supports submodules).
Posts: 7994
Sorry I should have explained better!
1) go to github.com and log in
2) go to https://github.com/gallery/gallery3-contrib
3) click the [fork] button
Now you'll have your own gallery3-contrib repo that's forked off of the master one. Go add your code in there, and then it'll show up in the gallery3-contrib forkqueue:
https://github.com/gallery/gallery3-contrib/forkqueue
I'll see it there and pull it in, or you can send me a pull request and I'll grab it. You might want to read:
http://help.github.com/forking/
---
Problems? Check gallery3/var/logs
file a bug/feature ticket | upgrade to the latest code! | hacking G3? join us on IRC!
Posts: 11
Done. A pull request has been sent. I've been using git for a while, but I'm new to Github specifically so the help page is much appreciated.
Posts: 11
@crustymonkey Many thanks for this nice library! It enabled me to finally get a nice way to upload pics to my Nokia N900 as described here.
If you plan to make any updates to the library, changing the import json statements to something like:
try:
import jason
except:
import simplejson as jason
makes the library compatible with Python 2.5 where there is no json module. Also commented out the "print url" statement in Gallery3.py to be a bit less verbose.
Posts: 11
Good suggestions sjsipila. I'll get those implemented very soon and issue a pull request for the main Gallery repository. Heh, that "print url" statement was a leftover debug statement from initial testing that I forgot to remove. Thanks for the feedback.
Posts: 11
I got the changes in, pushed to https://github.com/crustymonkey/pylibgal3 and my gallery3-contrib fork, and submitted a pull request to the main gallery3-contrib git repos. I would imagine this will be mainlined soon.
Posts: 7994
Sorry for the delay - I've pulled it into the mainline. thanks, @crustymonkey!
---
Problems? Check gallery3/var/logs
file a bug/feature ticket | upgrade to the latest code! | hacking G3? join us on IRC!