Created
September 23, 2014 09:38
-
-
Save dpwrussell/bdf1a6ffae586c43ac89 to your computer and use it in GitHub Desktop.
Override a BlitzGateway wrapper
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ImageWrapper (omero.gateway.ImageWrapper): | |
""" | |
omero_model_ImageI class wrapper overwrite omero.gateway.ImageWrapper | |
""" | |
def getClientPath(self): | |
print 'This one being run' | |
qs = self._conn.getQueryService() | |
params = omero.sys.ParametersI() | |
params.addLong("iid", self.getId()) | |
query = "select fse from FilesetEntry fse join fse.fileset as fs "\ | |
"left outer join fs.images as image where image.id=:iid" | |
# this could be OMERO 4, so handle that | |
try: | |
r = qs.findAllByQuery(query, params, self._conn.SERVICE_OPTS) | |
paths = [fs.clientPath.val for fs in r] | |
path = os.path.commonprefix(paths) | |
except: | |
path = "" | |
return path | |
# Update the ref to ImageWrapper in BlitzGateway | |
print 'Updating the imagewrapper' | |
omero.gateway.ImageWrapper = ImageWrapper | |
omero.gateway.refreshWrappers() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment