leocrawford / picasawebsync

Sync local directories with picasaweb
MIT License
59 stars 16 forks source link

IndexError: tuple index out of range #28

Closed ghost closed 9 years ago

ghost commented 9 years ago

Hi, I am trying to decipher the instructions on how to use this uploader. They don't seem to be very clear, unless you are a hardcore python and regex expert and mind reader:-(

Anyway, the error I am seeing is "IndexError: tuple index out of range"

Here is my commandline, followed by directory listing.

I am trying to keep the album naming as simple as it can be

Name (Year) as per your example.

root@RPI:~/picasawebsync# ./picasawebsync.py -d /mnt/Pictures/ -m upload -c5 -t -s ".wdmc" -n "{1} ({0})" Excluding .wdmc\Z(?ms) on client and $. on server Traceback (most recent call last): File "./picasawebsync.py", line 744, in albums = Albums(rootDirs, albumNaming, excludes, args.replace, args.namingextract) File "./picasawebsync.py", line 143, in init self.albums = self.scanFileSystem(albumNaming, excludes, replace, namingextract) File "./picasawebsync.py", line 152, in scanFileSystem albumName = convertDirToAlbum(albumNaming, rootDir, dirName, replace, namingextract) File "./picasawebsync.py", line 537, in convertDirToAlbum work = formElements[which - 1].format(*nameElements) IndexError: tuple index out of range root@RPI:~/picasawebsync# ls /mnt/Pictures/ 1995 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 flickr_upload.db Misc

leocrawford commented 9 years ago

Hi,

Thanks for getting in touch.

My guess is that there is a file, perhaps flickr_upload.db, that isn't in a directory for it to find the date from.

Maybe you could create a directory called test directory with a simplified file structure and see if it works with that?

If you can help improve the documentation it would be really appreciated.

Leo

On Thu, 18 Jun, 2015 at 9:34 PM, Mark Gillespie notifications@github.com wrote:

Hi, I am trying to decipher the instructions on how to use this uploader. They don't seem to be very clear, unless you are a hardcore python and regex expert and mind reader:-(

Anyway, the error I am seeing is "IndexError: tuple index out of range"

Here is my commandline, followed by directory listing.

I am trying to keep it as simple as it can be

Name (Year) as per your example.

root@RPI:~/picasawebsync# ./picasawebsync.py -d /mnt/Pictures/ -m upload -c5 -t -s ".wdmc" -n "{1} ({0})" Excluding .wdmc\Z(?ms) on client and $. on server Traceback (most recent call last): File "./picasawebsync.py", line 744, in albums = Albums(rootDirs, albumNaming, excludes, args.replace, args.namingextract) File "./picasawebsync.py", line 143, in init self.albums = self.scanFileSystem(albumNaming, excludes, replace, namingextract) File "./picasawebsync.py", line 152, in scanFileSystem albumName = convertDirToAlbum(albumNaming, rootDir, dirName, replace, namingextract) File "./picasawebsync.py", line 537, in convertDirToAlbum work = formElements[which - 1].format(*nameElements) IndexError: tuple index out of range root@RPI:~/picasawebsync# ls /mnt/Pictures/ 1995 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 flickr_upload.db Misc

— Reply to this email directly or view it on GitHub.

ghost commented 9 years ago

Thanks, that was the problem. I added a try catch block around convertDirToAlbum and now it seems much happier.

I will try and have a go at the documentation soon. Before I do so however, I think I need to try out more things.

One question I do have, is does this build a local database of what's been uploaded? can I run this from a script and it will ignore anything that's already been uploaded (even if it's been rescaled)?

I think the section that needs to most work is the mode, only the first line made sense. The rest of the Mode section is really confusing. I still haven't worked out what I need to do to make it stop complaining about remote duplicates.

leocrawford commented 9 years ago

I'm glad you got that sorted. I'm happy to take a patch if you've fixed a problems others may experience.

The system was designed to not keep a local database (for better or worse). That means it has to match files based on hash, date, size, name or some combination of the above (depending how you configure it).

This means if you choose to just use name as the identifier then it will ignore identical files, even if resized.

What warning are you getting about remote duplicates?