forked from ome/omero-py
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrunTables.py
46 lines (37 loc) · 1.23 KB
/
runTables.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# OMERO Tables Runner
# Copyright 2009 Glencoe Software, Inc. All Rights Reserved.
# Use is subject to license terms supplied in LICENSE.txt
#
if __name__ == "__main__":
import sys
import Ice
import omero
import omero.clients
import omero.tables
from omero.util import Dependency
# Logging hack
omero.tables.TablesI.__module__ = "omero.tables"
omero.tables.TableI.__module__ = "omero.tables"
class TablesDependency(Dependency):
def __init__(self):
Dependency.__init__(self, "tables")
def get_version(self, target):
self.target = target
ver = "%s, hdf=%s" % (target.__version__, self.optional("hdf5", 1))
return ver
def optional(self, key, idx):
try:
x = self.target.whichLibVersion(key)
if x is not None:
return x[idx]
else:
return "unknown"
except:
return "error"
app = omero.util.Server(
omero.tables.TablesI, "TablesAdapter", Ice.Identity("Tables", ""),
dependencies=(Dependency("numpy"), TablesDependency()))
sys.exit(app.main(sys.argv))