Application for synchronizing a local folder with a trovebox.com album. NB: This is to be considered alpha software and may very well delete your photos locally and/or remotely! Please do not use without a safe bacup of all your photos!
I'll probably break the master version quite often as I'm doing all work here (no feature branches). I'm trying to tag versions that I consider working but this is still very much pre-alpha software and I give no guarantees that it doesn't delete your local and/or remote photos. See change history for what features are supported in which versions.
Build status on master is currently
NB: this does not necessarily reflect the build status of the commit you've currently checked out.
- python 2.7
- python-oauth2
- poster
- Install dependencies listed above.
- Get your OAuth credentials from Site Settings on your Trovebox site by creating a new app.
- Copy sample.cred.json to cred.json and replace with your credentials and path to the folder holding your local copy of the album(s).
- In cred.json, replace the "albums" list with pairs of local folder-name (under the albumsPath) and remote album-name.
- Run
python main.py
. - This will loop through your albums
giving you three choices for each
(you can also add "a" to your choice
to apply it to all subsequent albums):
- "Sync remote changes to local folder" (r): Choose this to make your local folder an exact copy of the Trovebox album. For each file in the localonly folder the corresponding file in your local folder will be moved to the backup-folder. For each file in the remoteonly folder the corresponding file will be downloaded from Trovebox to your local folder.
- "Sync local changes to remote album" (l): This will make the Trovebox album an exact copy of your local folder. Each file in the localonly folder will be uploaded to the Trovebox album. For each file in the remoteonly folder the corresponding file will be tagged for deletion on Trovebox.
- "Choose action for each picture" (not yet implemented): This will go through each file in both folders and prompt you to choose whether to upload the file to Trovebox, download the file to your local album, delete the file from Trovebox, delete the file from your local album or ignore the file.
Run python python -m unittest discover -s tests
from root directory (this directory)
or use nose
for more fine grained control.
Because Trovebox currently autorotate all uploaded images with exiftran before storing the original and exiftran (for reasons unknown) adds some bytes to the file irrespective of whether the image needs rotation or not the actual original version of the file is not available for downloading from trovebox (see issue at github). Furthermore, because the hash stored with the image on Trovebox is generated from the actual original, and as trovesync uses this hash to compare files syncing from Trovebox will be faulty. There are two ways to work around this problem (until Trovebox hopefully changes this behaviour):
- Run all your images through exiftran autorotation locally before uploading to Trovebox.
- Ask Trovebox support kindly to disable exiftran for your account.
- Major refactor to prepare for asynchronous webrequests and make it easier to test
- Travis build is now passing and linked to in readme
- Removed dependency on openphoto-python
- Added setup.py script for easier installation (untested)
- Added a few unit tests
- Automatic creation of missing remote albums
- Major refactor, splitting into several modules
- Local folders are now scanned recursively for *.jpg-files.
- Logging is improved and is now also outputted to a file.
- Cleaned up code, splitting it into classes.
- Synchronizing several albums (set up in cred.json)
- First working version with basic functionality
- Synchronize single local folder with single (existing) remote album.
- Does "soft delete" locally by moving files to a backup folder, and remotely by tagging images with "trovesyncDelete".
I do not take any responsibility for any lost photos or information resulting from the use of this application. Released under the MIT License as stated in the file LICENSE.