Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add several option to support file_watcher, notification center and foreign language #58

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

nekopep
Copy link

@nekopep nekopep commented Sep 12, 2015

Hello,

These patch add several option I found usefull:
--set-locale fr_FR to force a locale, thus directory name created match the locale user need
--ignore to ignore a list of specific file like .* or .db (.* was ever supported in the script) but since I imported directory from windows got a lot of annoying Thumb.db files that were parsed by exiftool...
--remove-ignored-files option remove ignored files, the idea is to be able to get a clean source directory once file have been processed and moved
--remove-empty-dirs option to remove empty dirs in source dir once it has been processed

With all these option it is possible to put file in a dir and a script can process the dir. Once the dir is processed it can be completely cleaned up for next data incomming.

This bring us to the two new script file_watcher.py and sort_filter.py. The file_watcher is a script that use filewatch a cross platfrom directory watcher. Once file are put into the dir the sort_filter is called with the files added as argument, allowing to automagically sort your photos :)

disclaimer: This is initial version that do not use yet the new options.
A future version will come with new options support to improve speed and corner cases.

Laurent

--ignore: a list of files to be ignored, example: --ignore .* *.db (especially usefull with Thumb.db files under windows)
--remove-ignored-files: remove ignored files
--remove-empty-dirs option recursively scan source directory and remove any remaining empty dirs. usefull to see if everything have been processed.
…e sorting is automatically launched once no more activity is detected on them.

Use fswatch from https://github.com/emcrisostomo/fswatch
Added option -w,--watch to make sortphoto wait on it's standard input new files to analyze.
@nekopep
Copy link
Author

nekopep commented Sep 13, 2015

Added file_watcher script, when a file is put in the watched directories the sorting is automatically launched once no more activity is detected on them.

Use fswatch from https://github.com/emcrisostomo/fswatch
Added option -w,--watch to make sortphoto wait on it's standard input new files to analyze.

…ssion. Any file put in incoming directory will be sorted to sorted_directory after 30s of inactivity in incoming directory.
@nekopep
Copy link
Author

nekopep commented Sep 17, 2015

Added a plist file to launch the file_watch script on user session login. Every time a file is put in incoming_directory, after 30s of inactivity the directory is sorted and files are moved to sorted_directory.

…done. The banner display how much photos have been processed and if clicked open output directory.

change the semantic of --ignore to workaround a bug in terminal that interpret * ...
…as processed as 2018 July 03 instead of being processed as a timestamp.
@nekopep
Copy link
Author

nekopep commented Sep 19, 2015

Work done, the file watcher does not impact computer speed.
After 5 seconds of inactivity, the photos are sorted automagically and a notification is displayed in notification center.
If user click on banner, the output dir is displayed

@nekopep
Copy link
Author

nekopep commented Sep 19, 2015

Here the banner result:
capture d ecran 2015-09-19 a 03 31 45

@nekopep nekopep changed the title Add several option to support file_watcher and foreign language Add several option to support file_watcher, notificaion center and foreign language Sep 19, 2015
@nekopep nekopep changed the title Add several option to support file_watcher, notificaion center and foreign language Add several option to support file_watcher, notification center and foreign language Sep 19, 2015
@andrewning
Copy link
Owner

@nekopep Great stuff. But there are too many things for me to pull all at once. Some of them have been superseded by other pull requests or are of lower priority. If you make separate pull requests for each change (each pull request doing only one thing) then it is more likely that I can accept more of them. Sorry for the hassle. I understand if you don't want go to the trouble of doing that. If not, I may try pull a few things out myself and you've made some nice changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants