Notice: In order to edit this ticket you need to be either: a Product Owner, The owner or the reporter of the ticket, or, in case of a Task not yet assigned, a team_member"

Task #4237 (closed)

Opened 9 years ago

Closed 8 years ago

Create client_wrapper from client

Reported by: jamoore Owned by: cneves
Priority: major Milestone: OMERO-Beta4.3
Component: OmeroPy Version: n.a.
Keywords: n.a. Cc: ajpatterson, wmoore
Resources: n.a. Referenced By: n.a.
References: n.a. Remaining Time: 0.0d
Sprint: 2011-05-19 (12)

Description (last modified by wmoore)

The use of the __init__(...client_obj...) parameter is unclear and seems to be ignored. If a client object is passed in, I would assume that resetClientObject does not get called or similar, but either way it should be documented

Change History (13)

comment:2 Changed 9 years ago by jburel

  • Sprint changed from 2011-02-10 (5) to 2011-02-24 (6)

Moved from sprint 2011-02-10 (5)

comment:3 Changed 9 years ago by wmoore

  • Description modified (diff)
  • Summary changed from Clarify use of client_obj arg to client_wrapper to Create client_wrapper from client

Tried creating a blitz client from client. See #4376

>>> import omero
>>> c = omero.client("localhost")
>>> s = c.createSession("root", "omero")

>>> import omero.gateway
>>> from omero import client_wrapper
>>> conn = client_wrapper(client_obj=c)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/will/Desktop/OMERO/dist/lib/python/omero/__init__.py", line 24, in client_wrapper
    return omero.gateway.BlitzGateway(*args, **kwargs)
  File "/Users/will/Desktop/OMERO/dist/lib/python/omero/gateway/__init__.py", line 1156, in __init__
    self._resetOmeroClient()
  File "/Users/will/Desktop/OMERO/dist/lib/python/omero/gateway/__init__.py", line 1449, in _resetOmeroClient
    self.c = omero.client(pmap=['--Ice.Config='+','.join(self.ice_config)])
  File "/Users/will/Desktop/OMERO/dist/lib/python/omero/__init__.py", line 28, in client
    return omero.clients.BaseClient(*args, **kwargs)
  File "/Users/will/Desktop/OMERO/dist/lib/python/omero/clients.py", line 122, in __init__
    self._initData(id)
  File "/Users/will/Desktop/OMERO/dist/lib/python/omero/clients.py", line 224, in _initData
    self.__ic = Ice.initialize(id)
  File "/opt/Ice-3.3.1/python/Ice.py", line 340, in initialize
    communicator = IcePy.Communicator(args, data)
Ice.EndpointParseException: exception ::Ice::EndpointParseException
{
    str = ssl  -p 4064 -h <"omero.host" not set>
}

comment:4 Changed 9 years ago by jburel

  • Sprint changed from 2011-02-24 (6) to 2011-03-10 (7)

Moved from sprint 2011-02-24 (6)

comment:5 Changed 9 years ago by jburel

  • Sprint changed from 2011-03-10 (7) to 2011-03-24 (8)

Moved from sprint 2011-03-10 (7)

comment:6 Changed 8 years ago by jburel

  • Sprint changed from 2011-03-24 (8) to 2011-04-07 (9)

Moved from sprint 2011-03-24 (8)

comment:7 Changed 8 years ago by cxallan

  • Sprint changed from 2011-04-07 (9) to 2011-04-21 (10)

Moved from sprint 2011-04-07 (9)

comment:8 Changed 8 years ago by jburel

  • Sprint changed from 2011-04-21 (10) to 2011-05-05 (11)

Moved from sprint 2011-04-21 (10)

comment:9 Changed 8 years ago by wmoore

This seems to work within scripting service, but not sure if it is best practice: E.g. try, finally, close etc.

    from omero.gateway import BlitzGateway

    suuid = session.getAdminService().getEventContext().sessionUuid
    host = client.ic.getProperties().getProperty('omero.host')
    port = client.ic.getProperties().getProperty('omero.port')
    print suuid, host, port

    conn = BlitzGateway(host=host, port=port, useragent="OMERO.script")
    conn.connect(sUuid=suuid)

comment:10 Changed 8 years ago by Will Moore <will@…>

(In [3b282d659be34d35ae392d1cf20779aa148a46a5/ome.git] on branch develop) Modifying BlitzGateway?.init() to support existing client_obj. See #4237

comment:11 Changed 8 years ago by Will Moore <will@…>

(In [804a8b226a104a2f5d39e991d09dcf35efd53b60/ome.git] on branch develop) Batch_Image_Export.py uses BlitzGateway?(client_obj=client). See #4237, #4376

comment:12 Changed 8 years ago by jburel

  • Sprint changed from 2011-05-05 (11) to 2011-05-19 (12)

Moved from sprint 2011-05-05 (11)

comment:13 Changed 8 years ago by wmoore

  • Remaining Time changed from 0.25 to 0
  • Resolution set to fixed
  • Status changed from new to closed

This is now working for me in scripts at least.

conn = BlitzGateway(client_obj=client)
Note: See TracTickets for help on using tickets. You may also have a look at Agilo extensions to the ticket.

1.3.13-PRO © 2008-2011 Agilo Software all rights reserved (this page was served in: 0.132796 sec.)

We're Hiring!