Package omero
[hide private]
[frames] | no frames]

Source Code for Package omero

 1  #!/usr/bin/env python 
 2  # -*- coding: utf-8 -*- 
 3  """ 
 4     Primary OmeroPy types 
 5   
 6     Classes: 
 7        - omero.client    -- Main OmeroPy connector object 
 8   
 9     Copyright 2007, 2008 Glencoe Software, Inc. All rights reserved. 
10     Use is subject to license terms supplied in LICENSE.txt 
11   
12  """ 
13   
14   
15  from omero_version import omero_version 
16  from omero_version import ice_compatibility as compat 
17  import Ice 
18  import os 
19  _sys = __import__("sys") 
20   
21  try: 
22      vers = Ice.stringVersion() 
23      vers = vers.split(".") 
24      compat = compat.split(".") 
25      if compat[0:2] != vers[0:2]: 
26          msg = """ 
27   
28          ERROR: Ice version mismatch! 
29   
30          Your OMERO code has been compiled using Ice version %s 
31          but you seem to have Ice version %s installed. If you need 
32          help understanding this issue, please send this error message 
33          to the OME community: 
34   
35          http://www.openmicroscopy.org/site/community 
36   
37          Debugging Info: 
38          -------------- 
39          VERSION=%s 
40          PYTHONPATH=%s 
41          """ % (".".join(compat), ".".join(vers), omero_version, \ 
42                 os.path.pathsep.join(_sys.path)) 
43          raise Exception(msg) 
44  finally: 
45      del omero_version 
46      del compat 
47      del vers 
48      del Ice 
49      del os 
50   
51  __import_style__ = None 
52   
53 -def client_wrapper(*args, **kwargs):
54 """ 55 Returns an instance of L{omero.gateway.BlitzGateway} created with all arguments passed to this method 56 57 @return: See above 58 """ 59 import omero.gateway 60 return omero.gateway.BlitzGateway(*args, **kwargs)
61
62 -def client(*args, **kwargs):
63 import omero.clients 64 return omero.clients.BaseClient(*args, **kwargs)
65
66 -class ClientError(Exception):
67 """ 68 Top of client exception hierarchy. 69 """ 70 pass
71
72 -class UnloadedEntityException(ClientError):
73 pass
74
75 -class UnloadedCollectionException(ClientError):
76 pass
77 78 # 79 # Workaround for warning messages produced in 80 # code-generated Ice files. 81 # 82 if _sys.version_info[:2] == (2, 6): 83 import warnings 84 warnings.filterwarnings( 85 action='ignore', 86 message='BaseException.message has been deprecated as of Python 2.6', 87 category=DeprecationWarning) 88