KodakLoader released

2007-09-16 Update: Just found out about the Firefox Companion for Kodak EasyShare Gallery. This tool provides a great solution for Linux users, and a preferable solution to my kodakloader tool below, as it is better maintained.

After trying out a few services for printing digital photos, we've settled on KodakGallery.com. The prices are comparable with other services, but most importantly the quality is good and the colours are accurate (unfortunately this can't be taken for granted).

Unfortunately, Kodak Gallery doesn't provide an upload tool for Linux, so the only option is to use their web interface. This is fine for a few files, but for large batches (100 photos or more), it could take an hour to select each of the files, and would require uploading in 5 batches. Clearly not much fun.

To make this process easier, I spent a few hours writing a graphical interface I'm calling KodakLoader, which makes it much more convenient to uploading files. Now that it's mostly complete, I'm releasing it.

This was a nice opportunity to play with gtk2, which I don't often have opportunity to do. Kudos to the pygtk team for the excellent python bindings and superb documentation.

I used John J. Lee's mechanize, ClientForm and ClientCookie modules to emulate a browser. Hopefully this won't break too often if they rename URLs and links (KodakLoader does some screen-scraping to read out existing photo albums). I'd expect that Kodak Gallery has a soap or xmlrpc interface (which their ofoto software uses), so it'd be great if they were nice enough to provide some documentation about this (I haven't asked, but am considering doing so).

Probably the single largest hurdle was figuring out how to report accurate progress for the file upload, as the actual upload is buried within mechanize, urllib and httplib. Once I was able to figure out the twisty maze, it didn't take too much code to implement. I used some hooks to provide a few alternate classes, which enabled me to break up the transfer into chunks and invoke a callback occasionally.

Posted by Jason Hildebrand <jason@opensky.ca> Saturday Mar 25, 2006 at 1:38 PM

Jason,
Thanks for all your hard work: I was pleased to find such a tool for the Kodak Gallery & Linux. I installed Kodakloader without much trouble and it runs swimmingly until I try to upload the photos I have added to the queue. When I do, the program allows me to double-check the saved username/password and then freezes. This is, no doubt, something I have not done quite right: I am a dedicated Linux user but not a programmer of any sort. To me, it looks like something to do with my MECHANIZE installation, but I can't be sure. I am using Ubuntu but migrated to the actual Debian packages in order to complete the install of Kodakloader. If you (or anyone else) could help, here is the output in terminal when the error occurs:
evan@teclaptop:~$ kodakloader Traceback (most recent call last): File "/usr/lib/python2.4/site-packages/kodakloader/kodak_gui.py", line 161, in startUpload action, arg = self.promptForAlbum() File "/usr/lib/python2.4/site-packages/kodakloader/kodak_gui.py", line 232, in promptForAlbum albums = self._browser.albumList() File "/usr/lib/python2.4/site-packages/kodakloader/uploader.py", line 125, in albumList pages = self.links(url_regex=re.compile("AlbumMenu.*[\?\&]page=.*")) File "/usr/lib/python2.4/site-packages/mechanize/_mechanize.py", line 326, in links return self._find_links(False, **kwds) File "/usr/lib/python2.4/site-packages/mechanize/_mechanize.py", line 627, in _find_links raise LinkNotFoundError() mechanize._mechanize.LinkNotFoundError
Kind Regards, Evan

Posted by: Evan on Thursday Apr 6, 2006 at 8:33 AM

Hi Evan, No, your mechanize installation looks ok -- this looks like a bug in KodakLoader. I'll try to fix this and release an updated version.

Posted by: Jason on Tuesday Apr 11, 2006 at 0:55 PM

Hello Jason, I've finally decided to move over into Linux world and yes it has been fun so far :) I'm able to switch from my Windows apps into Linux versions with good results. My latest one is you KodakLoader app which I'm having little bit of problem with. I'm able to select my pics, enter my username/password, however, he upload process seems to be stuck at Connecing phase. Here's traceback I'm getting: serduszko@serduszko-laptop:~$ kodakloader traceback Traceback (most recent call last): File "/usr/lib/python2.4/site-packages/kodakloader/kodak_gui.py", line 159, in startUpload browser.login(username, password) File "/usr/lib/python2.4/site-packages/kodakloader/uploader.py", line 92, in login self.select_form(nr=0) File "/usr/lib/python2.4/site-packages/mechanize/_mechanize.py", line 445, in select_form raise FormNotFoundError("no form matching "+description) mechanize._mechanize.FormNotFoundError: no form matching nr 0 Sincerly, Tom

Posted by: Tom on Monday Aug 7, 2006 at 7:15 AM

Hi Jason Thanks for your hard work - my hands have been aching from using the single photo upload facility on the Kodak gallery. Unfortunately, like Tom above, I'm still stuck at the connecting phase. Do you have any idea what this could be? Here's the traceback: kodakloader traceback Traceback (most recent call last): File "/usr/lib/python2.4/site-packages/kodakloader/kodak_gui.py", line 159, in startUpload browser.login(username, password) File "/usr/lib/python2.4/site-packages/kodakloader/uploader.py", line 92, in login self.select_form(nr=0) File "/usr/lib/python2.4/site-packages/mechanize/_mechanize.py", line 445, in select_form raise FormNotFoundError("no form matching "+description) mechanize._mechanize.FormNotFoundError: no form matching nr 0 Any help you can provide would be greatly received! All the best, JJ

Posted by: JJ on Sunday Oct 29, 2006 at 1:27 PM

KodakLoader released

2007-09-16 Update: Just found out about the Firefox Companion for Kodak EasyShare Gallery. This tool provides a great solution for Linux users, and a preferable solution to my kodakloader tool below, as it is better maintained.

After trying out a few services for printing digital photos, we've settled on KodakGallery.com. The prices are comparable with other services, but most importantly the quality is good and the colours are accurate (unfortunately this can't be taken for granted).

Unfortunately, Kodak Gallery doesn't provide an upload tool for Linux, so the only option is to use their web interface. This is fine for a few files, but for large batches (100 photos or more), it could take an hour to select each of the files, and would require uploading in 5 batches. Clearly not much fun.

To make this process easier, I spent a few hours writing a graphical interface I'm calling KodakLoader, which makes it much more convenient to uploading files. Now that it's mostly complete, I'm releasing it.

This was a nice opportunity to play with gtk2, which I don't often have opportunity to do. Kudos to the pygtk team for the excellent python bindings and superb documentation.

I used John J. Lee's mechanize, ClientForm and ClientCookie modules to emulate a browser. Hopefully this won't break too often if they rename URLs and links (KodakLoader does some screen-scraping to read out existing photo albums). I'd expect that Kodak Gallery has a soap or xmlrpc interface (which their ofoto software uses), so it'd be great if they were nice enough to provide some documentation about this (I haven't asked, but am considering doing so).

Probably the single largest hurdle was figuring out how to report accurate progress for the file upload, as the actual upload is buried within mechanize, urllib and httplib. Once I was able to figure out the twisty maze, it didn't take too much code to implement. I used some hooks to provide a few alternate classes, which enabled me to break up the transfer into chunks and invoke a callback occasionally.

Posted by Jason Hildebrand <jason@opensky.ca> Saturday Mar 25, 2006 at 1:38 PM

Jason,
Thanks for all your hard work: I was pleased to find such a tool for the Kodak Gallery & Linux. I installed Kodakloader without much trouble and it runs swimmingly until I try to upload the photos I have added to the queue. When I do, the program allows me to double-check the saved username/password and then freezes. This is, no doubt, something I have not done quite right: I am a dedicated Linux user but not a programmer of any sort. To me, it looks like something to do with my MECHANIZE installation, but I can't be sure. I am using Ubuntu but migrated to the actual Debian packages in order to complete the install of Kodakloader. If you (or anyone else) could help, here is the output in terminal when the error occurs:
evan@teclaptop:~$ kodakloader Traceback (most recent call last): File "/usr/lib/python2.4/site-packages/kodakloader/kodak_gui.py", line 161, in startUpload action, arg = self.promptForAlbum() File "/usr/lib/python2.4/site-packages/kodakloader/kodak_gui.py", line 232, in promptForAlbum albums = self._browser.albumList() File "/usr/lib/python2.4/site-packages/kodakloader/uploader.py", line 125, in albumList pages = self.links(url_regex=re.compile("AlbumMenu.*[\?\&]page=.*")) File "/usr/lib/python2.4/site-packages/mechanize/_mechanize.py", line 326, in links return self._find_links(False, **kwds) File "/usr/lib/python2.4/site-packages/mechanize/_mechanize.py", line 627, in _find_links raise LinkNotFoundError() mechanize._mechanize.LinkNotFoundError
Kind Regards, Evan

Posted by: Evan on Thursday Apr 6, 2006 at 8:33 AM

Hi Evan, No, your mechanize installation looks ok -- this looks like a bug in KodakLoader. I'll try to fix this and release an updated version.

Posted by: Jason on Tuesday Apr 11, 2006 at 0:55 PM

Hello Jason, I've finally decided to move over into Linux world and yes it has been fun so far :) I'm able to switch from my Windows apps into Linux versions with good results. My latest one is you KodakLoader app which I'm having little bit of problem with. I'm able to select my pics, enter my username/password, however, he upload process seems to be stuck at Connecing phase. Here's traceback I'm getting: serduszko@serduszko-laptop:~$ kodakloader traceback Traceback (most recent call last): File "/usr/lib/python2.4/site-packages/kodakloader/kodak_gui.py", line 159, in startUpload browser.login(username, password) File "/usr/lib/python2.4/site-packages/kodakloader/uploader.py", line 92, in login self.select_form(nr=0) File "/usr/lib/python2.4/site-packages/mechanize/_mechanize.py", line 445, in select_form raise FormNotFoundError("no form matching "+description) mechanize._mechanize.FormNotFoundError: no form matching nr 0 Sincerly, Tom

Posted by: Tom on Monday Aug 7, 2006 at 7:15 AM

Hi Jason Thanks for your hard work - my hands have been aching from using the single photo upload facility on the Kodak gallery. Unfortunately, like Tom above, I'm still stuck at the connecting phase. Do you have any idea what this could be? Here's the traceback: kodakloader traceback Traceback (most recent call last): File "/usr/lib/python2.4/site-packages/kodakloader/kodak_gui.py", line 159, in startUpload browser.login(username, password) File "/usr/lib/python2.4/site-packages/kodakloader/uploader.py", line 92, in login self.select_form(nr=0) File "/usr/lib/python2.4/site-packages/mechanize/_mechanize.py", line 445, in select_form raise FormNotFoundError("no form matching "+description) mechanize._mechanize.FormNotFoundError: no form matching nr 0 Any help you can provide would be greatly received! All the best, JJ

Posted by: JJ on Sunday Oct 29, 2006 at 1:27 PM