Skip to content

Instantly share code, notes, and snippets.

@joshmoore
Last active April 1, 2019 15:46
Show Gist options
  • Save joshmoore/9768d02568d8a166f2babfa7ef5875fe to your computer and use it in GitHub Desktop.
Save joshmoore/9768d02568d8a166f2babfa7ef5875fe to your computer and use it in GitHub Desktop.
OMERO DropBox Test
docker run -ti --rm --entrypoint=python -v $PWD:/dropbox openmicroscopy/omero-server /dropbox/test.py
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