I am writing a script to process some images and re-upload the results to OMERO. It seemed as though the command line importer available OMERO.server/bin/omero did not have all of the features I wanted (cannot specify dataset), so I wrote a separate importer in python that makes use of both the CLI class in lib/python/omero/cli.py to upload images, and a Blitz gateway connection to attach files, add description etc. The importer calls: cli.invoke(import_args) ; where cli is a CLI instance, and import_args is a list of arguments.
However, when I call my python importer from a shell script (using a session key for authentication), the script stalls: presumably because it is being prompted for confirmation, something like this:-
Server: [servername] <- requires confirmation, although it already has the value
Username: [username] <- requires confirmation, although it already has the value
If I run my importer from a shell prompt and hit enter a couple of times, it manages to use the session key to authenticate and upload the image + attachments no problem. I even tried: echo "\n\n" | my_importer arg1 ... argn ; but no cigar (running a second time does not require confirmations - something about the session is stored in ~/omero ??)
I now realise the CLI class is calling some java code via the import.py plugin, but is there any way to tell the java importer code that this is not an interactive session, and to please just import the image, no questions asked? Or is there an easier way to script image uploads that I am missing?
PS. is this the correct place to post questions, or do you prefer the mailing list(s)?