Open ibizaman opened 8 years ago
What do you think of this?
Definitely think it's a great idea. Can you explain in more detail how it would work?
Great. So first from a user perspective. Assuming we know what fuse is, the first step is to mount the filesystem:
elodie-fs "/where/my/photos/are" "/where/i/want/my/photos/to/go"
# equivalent to:
./elodie.py import --source="/where/my/photos/are" --destination="/where/i/want/my/photos/to/go"
From now on, renaming or moving a file or directory will issue an elodie.py
command under the hood. Of course, not all rename or move are meaningful so some will be denied by elodie-fs
. Allowed ones are those given previously.
From a technical point of view, it is as simple as implementing all needed system call callbacks. I could not explain it better than http://www.stavros.io/posts/python-fuse-filesystem/ which is based on https://github.com/terencehonles/fusepy.
You mainly see that happening in the write
and create
methods?
Besides identifying which operations should be ignored it seems quite doable. I can create a branch to develop this feature on to see where t goes.
@ibizaman I pushed a branch gh-35-fs-sync
that I'll keep rebased with master
for this work.
Awesome! I made a little tweak to the given example in the aforementioned link: https://gist.github.com/ibizaman/e3609e01abd48e7bd605. Now it prints all arguments, making it easy to know what happens.
@ibizaman sounds good. You can keep a PR open and push commits as they come available. I'll make sure that the @travisci and @scrutinizer jobs are hooked into this branch so we make sure changes here don't break existing code. I'll merge PRs once they look good and open can open another.
TL;DR: what would you think about using fuse?
First of all THANK YOU. This is the project I always wanted to do - in the exact same way.
So for now, the only way to update pictures is to run the
elodie.py
command. I would propose to make importing and updating even more intuitive by adding fuse into the mix. This way, making a modification on the filesystem - renaming a directory, moving a file, etc. - would triggerelodie.py
and automatically change the EXIF information.The UI could then be very inuitive. Assuming:
Renaming
California
toSilicon Valley
would trigger:Renaming
2015-07-Jul
to2015-08
would trigger, with a bit of magick:And of course, editing the EXIF information directly would also trigger corresponding
./elodie.py
commands.Python bindings for fuse can be installed with pip too:
pip install fuse-python
.What do you think of this?