A G3Remote - v0.1.8 [12/12/10]

rak

Joined: 2010-08-09
Posts: 44
Posted: Mon, 2010-08-09 13:47

Ok so I got tired of having flash crash every time I want to upload a picture, so I've hacked together a quick desktop client in python.

[img]http://04340.com/g3remote/screen.png[/img]

Latest version - 0.1.8
Get it here [Source code].

Latest Windows (binary) version - 0.1.8

------------------------------------------------------------------
Instructions to use

Enable the REST module on your gallery

Download file and extract (use 7-zip for windows files). Run G3Remote.exe

If running from source

Prerequisites
* Python 2.6 (it should work with 2.7 though i haven't tested it)
* wxpython
* PIL
* httplib2

cd to extracted files and

    $ python G3Remote.py

----------------------------------------------------------------

Changelog:

0.1: Experimental
  * Initial release.
  * Support for browsing gallery structure, uploading files and 
    creating and deleting albums.

0.1.1: Reasonably stable (on linux at least)
  * Added ability to add descriptions to files before uploading.
  * Queue will now autosave whenever an item in it changes and 
    load on startup.
  * Added popup messages to display notifications
  * Fixed a large number of bugs...
    -----Note------
  * Although you can edit tags in the queue this data will not
    be send to the gallery when items are uploaded.
  * There seems to be some minor gui issues in which thumbnails
    do not align correctly. If you select the affected items or
    scroll the panel they should sort themselves out.

0.1.2: Even more stable. 
  * First windows release. This may well be a bit buggy as i
    haven't the time (or will) to test it at the moment.
  * Added progress bars.
  * Added tags support (can also add tags to more than 1 item
    by selecting items and using the right click context menu).
  * Added title support, can now specify a seperate title to
    use instead of the filename (default is still the filename).
  * Cleaned up some of the code.
  * Fixed thumbnail display bug.

0.1.3: Perhaps not quite as stable.
  * --Added ability to browse/edit remote files. (tagging
    of remote files is not supported)--
  * Added some right click options for files in the queue.
  * Added menu bar. This along with context menu options will
    probably start to replace the buttons.
  * Can now see what folder is being browsed.
  * Fixed a load of bugs and made some other changes that
    I can't remember.

0.1.4: Bugfixes and a few new features.
  * Added simple drop support for files dragged onto the
    queue and directories onto the filebrowser.
  * Better loading dialogs (still nowhere near perfect)
  * Cleaned up gallery caching code, should now be more
    efficient and faster.

0.1.5: A usable version
  * Greatly improved config managment
  * Added support for moving remote items
  * Added a few more loading dialogs so the app doesn't
    appear to have hung.

0.1.6: Better remote files support
  * App will now restart when saving config, preventing
    a problem from occuring if you use more that one
    gallery.
  * Improved incorrect config detection.
  * If uploading fails app should now display the error
    message that gallery3 returns instead of crashing.
  * Thumbnails for remote items are now downloaded in
    a seperate thread so the app remains response even
    when downloading a large number of thumbnails.
  * Thumbnails are now downloaded via REST.
  * Reorganised requests so it should be possible to
    catch dropped connections

0.1.7: More remote file improvement
  * Streamlined the remote file managment some more
    and fixed some bugs
  * Remote items are now saved across sessions.

Windows users - Binary (exe) is now available (link above). Runs on XP and vista (probably 7 as well).

Feel free to post any comments/suggestions.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Mon, 2010-08-09 17:16

rak,
Thanks for your contribution. Most users are not familiar with python, so perhaps you can give some details on how to install/run this. I am assuming this will only work for users that have a linux client. I think if you have python install on windows you can run this a swell. Is there any simple docs for Windows/Mac users to install python?

Dave

_____________________________________________
Blog & G2 || floridave - Gallery Team

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Mon, 2010-08-09 18:28

I've also seen "compilers" which package together a python runtime and the code into a exe to run standalone on Windows machines without the prereq of having Python installed on Windows.

Ah here we go:
http://www.py2exe.org/
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Tue, 2010-08-10 03:57

That's totally awesome. Are you using the REST API?
---
Problems? Check gallery3/var/logs
bugs/feature req's | upgrade to the latest code | use git

 
rak

Joined: 2010-08-09
Posts: 44
Posted: Tue, 2010-08-10 14:16

@floridave and nivekian

I'll put up some documentation on how to use it and and look into building some windows binaries once I add a few more features and iron out some bugs its got at the moment.

@bharat

Yeah its using the REST API. To be honest I have no experience with REST and I've put it together quite quickly so I'm not exactly sure if I'm doing it all the correct way, though it seems to be working.

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Wed, 2010-08-11 04:41

If it works, it works :-) The fact that you got it working quickly with the REST API is a good sign!
---
Problems? Check gallery3/var/logs
bugs/feature req's | upgrade to the latest code | use git

 
rak

Joined: 2010-08-09
Posts: 44
Posted: Mon, 2010-08-16 14:21

Fixed a load of stuff, added some new features and built a Windows version. Let me know what you think / if you have any problems (I know about error messages on startup but these shouldn't affect anything, will fix for the next version)

 
JaronRH

Joined: 2010-07-28
Posts: 23
Posted: Wed, 2010-09-08 23:14

Rak, I just tried this out on my computer (Windows XP SP3) and it closed as soon as I tried to run it. I also tried it in a VM (XP, sp3 again) and it complained about it not being configured correctly.

Let me know what you need to debug this. Thanks!

 
rak

Joined: 2010-08-09
Posts: 44
Posted: Thu, 2010-09-09 21:07

I've uploaded a new version - 0.1.3. See first post for links and details.

@JaronRH did you edit the config file and add your gallery's url and rest key as thats what'll happen if they're incorrect?

When i get some time I'll build it into the gui.

 
rak

Joined: 2010-08-09
Posts: 44
Posted: Mon, 2010-09-13 12:18

Updated first post with latest version. The interface still isn't the neatest but it should now be easy for anyone to use and run.

 
kc5daq

Joined: 2010-09-30
Posts: 1
Posted: Thu, 2010-09-30 18:43

Ok i am tying the windows version here and i must be missing something. i executed the G3Remote.exe and i filled in the requested lines and clicked save. The box just stays there and no GR interface pops up. What am i doing wrong.. ?? Thanks
[img]http://netweb.hctx.net/rest.jpg[/img]

 
mamouneyya

Joined: 2009-11-02
Posts: 337
Posted: Thu, 2010-09-30 22:21

A Mac OS X version, please?

 
jbillings

Joined: 2009-11-12
Posts: 33
Posted: Fri, 2010-10-01 00:37

I'll second that!

 
rak

Joined: 2010-08-09
Posts: 44
Posted: Sat, 2010-10-02 12:44

@kc5daq: unless you're using a url rewrite you need the index.php on the end so try using http://10.0.1.51/gallery3/index.php/

As to a Mac version I don't know how to build a binary, but I think python is installed by default so you should be able to run it from source.

 
daveman

Joined: 2009-10-09
Posts: 25
Posted: Fri, 2010-10-08 20:39

Where do i find the Rest API Key????

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Fri, 2010-10-08 21:01

Click on your user account in the upper-right corner or as admin you can edit users under Admin > Users/Groups and there is a Remote access key property
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
daveman

Joined: 2009-10-09
Posts: 25
Posted: Sun, 2010-10-10 22:02

It is very slow to update a large directory of images but otherwise seems to work well.

Thanks

Dave

 
gpo

Joined: 2008-05-05
Posts: 68
Posted: Mon, 2010-10-11 09:30

Make android app version

 
rak

Joined: 2010-08-09
Posts: 44
Posted: Mon, 2010-10-11 15:49

@daveman

I see what you mean. Downloading the thumbnails is threaded so you can try upping the "concurrent_connections" in your config, be careful though. if you put it too high your server might not be able to handle it and you'll get missing thumbnails. I'll thread the item get requests (and i'll put in a feature request to allow the REST API to support multiple item requests in a single request which would be a better solution) in the next version would should speed up the first part at least. If I get the time I'll look into loading the thumbnails dynamically.

@gpo

Does android support python? If it does, it's possible. I don't have the time (or an android phone) to do it though. Source code is available if someone else wants to.

 
rameijer

Joined: 2003-10-01
Posts: 3
Posted: Tue, 2010-10-19 05:39

I'm having the same problem as kc5daq, but on Kubuntu 10.10 AMD64...

All Python libs are installed and there are no error messages. After entering my Gallery's details and clicking Save the first two lines in the window turn blue but nothing else happens.

How can I troubleshoot this? I'm not familiar with Python.

 
rak

Joined: 2010-08-09
Posts: 44
Posted: Tue, 2010-10-19 17:23

Blue means that the login is failing, chances are you've got your gallery url wrong (it'll need the "/index.php/" on the end if you're not using a urlrewrite so try "http://example.com/gallery3/index.php/"), or your rest key is incorrect.

If you're still having a problem let me know.

edit:

Just put in a fix which should differentiate between an incorrect url or rest key which should simplify things for the next version.

 
rameijer

Joined: 2003-10-01
Posts: 3
Posted: Tue, 2010-10-19 18:48

It tired both with '/index.php/' and without it (I do use rewrite). I generated a new REST key as well, but to no avail...still the same.

I downloaded g3remote-v0.1.5-source.7z, which expands into g3remote-v0.1.3/. Is that really the latest version?

 
rak

Joined: 2010-08-09
Posts: 44
Posted: Tue, 2010-10-19 22:14

Yeah that should be the latest, I must have forgotten to rename the folder. If you could send me a link to your gallery I'll take a look and see if I can work out whats going wrong.

 
sjsipila

Joined: 2007-04-03
Posts: 11
Posted: Mon, 2010-10-25 20:52

Very nice work, rak!
I have been looking for a good place to start writing a small Python script to upload pics from my Nokia N900 to gallery3, this program seems to be exactly what I needed..

I just gave G3Remote a try on my Ubuntu machine. The program runs just fine, I am able to see the albums of my gallery and thumbnails of the pictures. I can also read a local directory in and move pictures to the upload queue. However, when I start the upload, the program hangs on the first file, I attached the JSON related error message from the terminal at the end of this message. Any idea about this, or can I give some additional info to troubleshoot?

BR,
Julius

-edit-
Also tried this on a win7 machine, hangs on the same way. Perhaps the problem is on the server side? Gallery REST API module is activated, I don't know what else to check.

Ubuntu 10.04 Desktop / python 2.6.5 / python-wxversion 2.8.10.1 / python-imaging 1.1.7 / python-httplib2 0.6.0

-----
Traceback (most recent call last):
File "G3Remote.py", line 690, in upload
response, content = self.REST.uploadItem(a, i[j]['type'], i[j]['filelocation'], j, i[j]['title'], i[j]['description'])
File "/home/sjsipila/Downloads/g3remote-v0.1.3/rest.py", line 133, in uploadItem
content = json.loads(content)
File "/usr/lib/python2.6/json/__init__.py", line 307, in loads
return _default_decoder.decode(s)
File "/usr/lib/python2.6/json/decoder.py", line 319, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python2.6/json/decoder.py", line 338, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded

 
rak

Joined: 2010-08-09
Posts: 44
Posted: Mon, 2010-10-25 21:12

Not sure whats going wrong there, it would appear your gallery3 isn't responding to the request properly in which case it would be server side. Are you using the latest version and can you upload files with the flash uploader?

Could you post a traceback with httplib2 debug turned on (edit rest.py and change "httplib2.debuglevel = 0" to "httplib2.debuglevel = 1") or possible send me a link to your gallery with a valid rest key so I can test it myself.

 
sjsipila

Joined: 2007-04-03
Posts: 11
Posted: Tue, 2010-10-26 15:21

Thanks for your help,
I turned httplib2 debug on, the whole traceback is attached in the log.txt here (I removed hostname and gallery REST key from the log). The server replies with 'HTTP/1.1 500 Internal Server Error', I have still no idea why.

I am running Gallery 3.0, and uploading files with the flash updater works ok. Do you think I should try the latest development version? If it helps and I can send you a valid rest key to my gallery for testing.

 
rak

Joined: 2010-08-09
Posts: 44
Posted: Tue, 2010-10-26 16:04

Ok I'm still not sure whats going wrong there, its either something wrong with the data thats being sent or a server error. Are there any errors in gallery3's logs?

If you send me a rest key and url I'll take a look and see if I can work out whats going wrong.

 
sjsipila

Joined: 2007-04-03
Posts: 11
Posted: Wed, 2010-10-27 14:50

Problem solved with hep from rak. It was a trivial permission problem, I had no Add/Edit permissions to the album with that REST key. You should make sure the permissions are OK before uploading, otherwise the current version 1.5 of G3Remote will hang. Also if you try to get thumbnails from an album which is not readable by "Everyone" it will hang.

Thanks rak for troubleshooting this for me!
- Julius

 
rak

Joined: 2010-08-09
Posts: 44
Posted: Wed, 2010-10-27 22:08

Both those errors should be addressed in version 0.1.6, I've also rewritten the way remote thumbnails handled which should make it much more usable. Just want to do a bit more testing and then I'll upload the new version.

 
rak

Joined: 2010-08-09
Posts: 44
Posted: Thu, 2010-10-28 17:02

@rameijer

Your problems may well have been caused by a permissions bug that has been fixed in the latest (git) gallery3 code.

 
rak

Joined: 2010-08-09
Posts: 44
Posted: Sun, 2010-10-31 14:00

Source for new version (0.1.6) is up.

Quote:
0.1.6: Better remote files support
* App will now restart when saving config, preventing
a problem from occuring if you use more that one
gallery.
* Improved incorrect config detection.
* If uploading fails app should now display the error
message that gallery3 returns instead of crashing.
* Thumbnails for remote items are now downloaded in
a seperate thread so the app remains response even
when downloading a large number of thumbnails.
* Thumbnails are now downloaded via REST.
* Reorganised requests so it should be possible to
catch dropped connections

 
rameijer

Joined: 2003-10-01
Posts: 3
Posted: Mon, 2010-11-01 10:39

Thanks rak, I'll try again when 3.0.1 is out then.

 
do0d

Joined: 2010-07-12
Posts: 10
Posted: Wed, 2010-12-01 21:58

Anyone have another place to download? The links above haven't worked for a couple days, but this sounds great.

 
claytonbrowns

Joined: 2010-12-01
Posts: 1
Posted: Wed, 2010-12-01 22:20

Also looking for this source, seems the URLs are all borked.

 
rak

Joined: 2010-08-09
Posts: 44
Posted: Thu, 2010-12-02 19:03

Ok slight trouble with my host, should have it fixed in a few hours.

 
rak

Joined: 2010-08-09
Posts: 44
Posted: Fri, 2010-12-03 00:37

Files are back up. I've also uploaded the source to a new version which should make browsing and editing remote items a lot nicer (I made some rather drastic changes so let me know if you notice anything weird).

http://04340.com/g3remote/g3remote-v0.1.7-source.tar.gz

When I get some time I'll look at setting up a git repository.

 
milliondollar

Joined: 2010-12-09
Posts: 18
Posted: Sat, 2010-12-11 20:15

rak,
this is totally awesome software.

How to get windows binary for v0.1.7?
_____________________________________________________
Cheers!
Visit my Travel Photo Gallery!

 
rak

Joined: 2010-08-09
Posts: 44
Posted: Sat, 2010-12-11 20:56

I'll try and build the binary tomorrow if I get time.

 
milliondollar

Joined: 2010-12-09
Posts: 18
Posted: Sat, 2010-12-11 21:13

Thank you very much. I'm looking for your release.
_____________________________________________________
Cheers!
Visit my Travel Photo Gallery!

 
rak

Joined: 2010-08-09
Posts: 44
Posted: Sun, 2010-12-12 14:45

v0.1.8 source and win32 builds are up

http://04340.com/g3remote/g3remote-v0.1.8-source.tar.gz
http://04340.com/g3remote/g3remote-v0.1.8-win32.7z

its still a work in progress but as usual suggestions and comments are much appreciated.

 
milliondollar

Joined: 2010-12-09
Posts: 18
Posted: Sun, 2010-12-12 15:22

Great!. I will try that later.

_____________________________________________________
Cheers!
Visit my Travel Photo Gallery!

 
shecter
shecter's picture

Joined: 2006-12-30
Posts: 130
Posted: Sun, 2010-12-12 23:36

Hi Rak,

I just tried the latest version for windows. It accepts my settings, but then gives me an "Errors Occured" dialog box and tells me to check the log.

The log reports the following:

Traceback (most recent call last):
  File "G3Remote.py", line 1337, in onTreeSelect
  File "G3Remote.py", line 1018, in refreshUploadPanel
AttributeError: 'MyFrame' object has no attribute 'uploadPanel'
Traceback (most recent call last):
  File "G3Remote.py", line 1337, in onTreeSelect
  File "G3Remote.py", line 1018, in refreshUploadPanel
AttributeError: 'MyFrame' object has no attribute 'uploadPanel'
Traceback (most recent call last):
  File "G3Remote.py", line 1503, in <module>
  File "G3Remote.py", line 154, in __init__
  File "G3Remote.py", line 331, in loadTree
  File "G3Remote.py", line 1350, in buildTree
  File "G3Remote.py", line 1382, in extendTree
KeyError: 'http://mysite/gallery3-2/index.php/rest/item/1'
 
rak

Joined: 2010-08-09
Posts: 44
Posted: Mon, 2010-12-13 11:40

Hmmm weird error.

I think I may know whats going wrong but I don't know why and can't be sure without testing it.

Any chance you could PM a link to your gallery and a rest api key?

 
shecter
shecter's picture

Joined: 2006-12-30
Posts: 130
Posted: Mon, 2010-12-13 16:01

Thanks RAK.. sent you a PM.

 
rak

Joined: 2010-08-09
Posts: 44
Posted: Mon, 2010-12-13 17:50

My bad, should have seen this earlier, can you try without the "/index.php/".

 
shecter
shecter's picture

Joined: 2006-12-30
Posts: 130
Posted: Mon, 2010-12-13 17:55

that worked! Thanks.

 
mormax

Joined: 2010-04-11
Posts: 2
Posted: Thu, 2010-12-16 18:13

Tool looks promising, unfortunately in my case it's not able to work with albums containing more than few pictures - I waited for 1 hour trying open an album containing 92 pictures - without success.

 
rak

Joined: 2010-08-09
Posts: 44
Posted: Fri, 2010-12-17 22:22

Somethings definitely going wrong there. It used to take about 10 minutes for me to load an album with 1000+ pictures, but since I threaded some stuff and made it dynamic its no much faster.

If you let me know if you're getting any errors (and your platform) I'll see if we can sort the problem.

 
vhenninot

Joined: 2008-09-26
Posts: 32
Posted: Sun, 2011-01-30 14:31

Hello,

I was interested (Ubuntu) but Downloads links are not working...

Vincent

 
rak

Joined: 2010-08-09
Posts: 44
Posted: Mon, 2011-01-31 12:14

Links should be working again now.

 
CJ00TA

Joined: 2010-03-31
Posts: 34
Posted: Wed, 2011-02-02 05:28

I'm having an issue where I can pull my main 7 albums and they display in G3Remote, but if I try to expand any of those albums, the app will hang with the "loading data for album" window.

edit: I thought I helped it some.. I bumped the request size to 100000 and the concurrent connections to 100.. I was able to get a couple more folder lists.. but it still hangs on albums with 200 or more sub albums.