Last active
April 1, 2019 15:46
-
-
Save joshmoore/9768d02568d8a166f2babfa7ef5875fe to your computer and use it in GitHub Desktop.
OMERO DropBox Test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker run -ti --rm --entrypoint=python -v $PWD:/dropbox openmicroscopy/omero-server /dropbox/test.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
sys.path.insert(0, "/opt/omero/server/OMERO.server/lib/python") | |
import fsPyinotifyMonitor as fpm | |
import omero_ext.pyinotify as pyinotify | |
def callback(eventList): | |
print eventList | |
wm = fpm.MyWatchManager() | |
notifier = pyinotify.ThreadedNotifier( | |
wm, fpm.ProcessEvent( | |
wm=wm, cb=callback, | |
et=['Creation', 'Modification', 'Deletion'], | |
ignoreDirEvents=False)) | |
wm.addBaseWatch( | |
"/dropbox", (pyinotify.ALL_EVENTS), rec=True, auto_add=True) | |
notifier.start() | |
raw_input("Press Enter to quit...\n") | |
notifier.stop() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment