I test the invoke login with cli import and get the following error:
- Code: Select all
File "./script", line 82, in upload_to_omero_cli
cli.invoke(cmd)
File "/home/omero/OMERO.server-5.3.5-ice36-b73/lib/python/omero/cli.py", line 992, in invoke
stop = self.onecmd(line, previous_args)
File "/home/omero/OMERO.server-5.3.5-ice36-b73/lib/python/omero/cli.py", line 1069, in onecmd
self.execute(line, previous_args)
File "/home/omero/OMERO.server-5.3.5-ice36-b73/lib/python/omero/cli.py", line 1151, in execute
args.func(args)
File "/home/omero/OMERO.server-5.3.5-ice36-b73/lib/python/omero/plugins/import.py", line 480, in importer
command_args = CommandArguments(self.ctx, args)
File "/home/omero/OMERO.server-5.3.5-ice36-b73/lib/python/omero/plugins/import.py", line 114, in __init__
self.set_login_arguments(ctx, args)
File "/home/omero/OMERO.server-5.3.5-ice36-b73/lib/python/omero/plugins/import.py", line 229, in set_login_arguments
client = ctx.conn(args)
File "/home/omero/OMERO.server-5.3.5-ice36-b73/lib/python/omero/cli.py", line 1327, in conn
self.controls["sessions"].login(args)
File "/home/omero/OMERO.server-5.3.5-ice36-b73/lib/python/omero/plugins/sessions.py", line 406, in login
server, name, port = self._get_server(store, name, port)
File "/home/omero/OMERO.server-5.3.5-ice36-b73/lib/python/omero/plugins/sessions.py", line 886, in _get_server
rv = self.ctx.input("Server: [%s:%s]" % (defserver, port))
File "/home/omero/OMERO.server-5.3.5-ice36-b73/lib/python/omero/cli.py", line 555, in input
rv = raw_input(prompt)
EOFError: EOF when reading a line
!! 06/21/18 13:07:03.763 error: communicator not destroyed during global destruction.
Script:
- Code: Select all
def upload_to_omero_cli(conn,imagePath,imgSrc):
dataset = imgSrc.getParent()
# import via cli
client = conn.c
cmd = "import %s -d %s" % (imagePath, dataset.id)
print cmd
cli = omero.cli.CLI()
cli.loadplugins()
cli.set_client(client)
#invoke login
cli.invoke("hql -q 'select g.name from ExperimenterGroup g'")
cli.invoke(cmd)
Regards,
Susanne