Task #5852 (closed)
Opened 13 years ago
Closed 13 years ago
Bug: BlitzGateway fails if no port passed
Reported by: | jamoore | Owned by: | wmoore |
---|---|---|---|
Priority: | minor | Milestone: | OMERO-Beta4.3.2 |
Component: | General | Version: | n.a. |
Keywords: | n.a. | Cc: | cneves |
Resources: | n.a. | Referenced By: | n.a. |
References: | n.a. | Remaining Time: | 0.0d |
Sprint: | n.a. |
Description
In [6]: conn = BlitzGateway("root", "ome", host = "localhost") --------------------------------------------------------------------------- TypeError Traceback (most recent call last) /Users/moore/GlencoeSoftware.git/git/omero.git/components/tools/OmeroPy/<ipython console> in <module>() /Users/moore/git/components/tools/OmeroPy/build/lib/omero/gateway/__init__.py in __init__(self, username, passwd, client_obj, group, clone, try_super, host, port, extra_config, secure, anonymous, useragent) 1165 self._proxies = NoProxies() 1166 if self.c is None: -> 1167 self._resetOmeroClient() 1168 else: 1169 # if we already have client initialised, we can go ahead and create our services. /Users/moore/git/components/tools/OmeroPy/build/lib/omero/gateway/__init__.py in _resetOmeroClient(self) 1451 """ 1452 if self.host is not None: -> 1453 self.c = omero.client(host=str(self.host), port=int(self.port))#, pmap=['--Ice.Config='+','.join(self.ice_config)]) 1454 else: 1455 self.c = omero.client(pmap=['--Ice.Config='+','.join(self.ice_config)]) TypeError: int() argument must be a string or a number, not 'NoneType' In [7]:
Change History (11)
comment:1 Changed 13 years ago by wmoore
comment:2 Changed 13 years ago by jmoore
Yes & no. If there's no other way to do it, then cool. But you will ultimately start rewriting omero.clients.BaseClient. We should clearly define the responsibilities of these classes.
comment:3 Changed 13 years ago by cneves
The reasoning behind the current implementation is that you either want the config files to have the values, or you want to pass them in. If there is a default to follow and you just want to pass in the host, then let the user facing programs that use the library fill in the blanks, not add that to the library responsibilities.
But that is just my mindset on the library approach, not something carved in stone, so if there's a strong disagreement I'll be happy to discuss. What is the use case for this anyway?
comment:4 Changed 13 years ago by jmoore
One use case (certainly where I discovered this) is "interpreter usability". I opened an interpreter, and if we're telling people to use BlitzGateway?, I want there to be a s little to type as necessary. I was even hoping that since all the values go into the constructor, I didn't even have to call connect() (one of the larger design flaws of omero.client with createSession).
comment:5 Changed 13 years ago by jmoore
- Milestone changed from OMERO-Beta4.3 to OMERO-Beta4.3.2
comment:6 Changed 13 years ago by wmoore
Hi guys, any consensus on what we want to do with this?
comment:7 Changed 13 years ago by jmoore
I don't think so, Will. We should probably schedule a voice discussion.
comment:8 Changed 13 years ago by wmoore
Maybe we can discuss on web meeting tomorrow?
comment:9 Changed 13 years ago by wmoore
Consensus in web meeting was to allow client to retrieve the port from config if not specified (simply leave it unset in omero.client).
comment:10 Changed 13 years ago by wmoore
wjm:~ will$ python Python 2.5.1 (r251:54863, May 5 2011, 18:37:34) [GCC 4.0.1 (Apple Inc. build 5465)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> from omero.gateway import BlitzGateway >>> conn = BlitzGateway('will', 'ome', host='localhost') >>> conn.connect() True >>> for p in conn.getObjects("Plate"): ... print p.name, p.id ... 12132846 384_CellCarrier 151 mdb - test - Insight 262
comment:11 Changed 13 years ago by Will Moore <will@…>
- Remaining Time set to 0
- Resolution set to fixed
- Status changed from new to closed
(In [7f455f385d703ddbbc02fc91f5925ffd05590136/ome.git] on branch develop) Blitz gateway port not required. Closes #5852
Use omero.constants.GLACIER2PORT for port if not specified.