ome / omero-py

Python project containing Ice remoting code for OMERO
https://www.openmicroscopy.org/omero
GNU General Public License v2.0
20 stars 33 forks source link

omero.scripts: prepare scripts for use of CLI #186

Closed joshmoore closed 4 years ago

joshmoore commented 4 years ago

User-scripts should be able to simply create an omero.cli.CLI instance and perform operations w/o needing to re-login. For import, this requires passing the omero.host property setting.

see: https://lists.openmicroscopy.org.uk/pipermail/ome-users/2014-September/004783.html

joshmoore commented 4 years ago

cc: @sukunis

I'll open a PR next about ome/openmicroscopy with an integration test.

jburel commented 4 years ago

wrote a little python script to import a file

import omero.scripts
import omero.cli
cli = omero.cli.CLI()
cli.loadplugins()
c = omero.scripts.client("example.py")
cli._client = c.createClient(secure = True)
cli.invoke(["import", "/Users/jmarie/Desktop/s.png"])
joshmoore commented 4 years ago

With https://github.com/ome/openmicroscopy/pull/6222 merged, shall we get this in?

Edit: actually, why is that passing in https://latest-ci.openmicroscopy.org/jenkins/job/OMERO-test-integration/286/ without this merged in?

joshmoore commented 4 years ago

https://latest-ci.openmicroscopy.org/jenkins/job/OMERO-test-integration/286/testReport/OmeroPy.test.integration.scriptstest.test_cli/TestCLI/testCLI/ failed to fail:

STDOUT:
I am the script named 4c9a9167-77a8-4bf6-bcff-c1f63ac653d7
Session session-2db587a0-e1e0-4037-91a8-f17d3a86b6d0/22af84a3-e236-4bc4-a890-21fb3246647b -t -e 1.1 @ BlitzAdapters
Previously logged in to localhost:14064 as root

STDERR:
Active client found
stdin is not a terminal: cannot request server
!! 04/03/20 03:44:59.689 error: communicator not destroyed during global destruction.
joshmoore commented 4 years ago

see https://github.com/ome/openmicroscopy/pull/6232

joshmoore commented 4 years ago

Stricter tests now passing.