Package omero :: Package util :: Module upgrade_check :: Class UpgradeCheck
[hide private]
[frames] | no frames]

Class UpgradeCheck

source code


Port of Java UpgradeCheck: https://trac.openmicroscopy.org.uk/omero/browser/trunk/components/common/src/ome/system/UpgradeCheck.java

>>> from omero.util.upgrade_check import UpgradeCheck
>>> uc = UpgradeCheck("doctest")
>>> uc.run()
>>> uc.isUpgradeNeeded()
False
>>> uc.isExceptionThrown()
False
>>> uc = UpgradeCheck("doctest", version = "0.0.0")
>>> uc.run()
>>> uc.isUpgradeNeeded()
True
>>> uc.isExceptionThrown()
False
>>>
>>> uc = UpgradeCheck("doctest", url = "http://some-completely-unknown-host.abcd/")
>>> uc.run()
>>> uc.isUpgradeNeeded()
False
>>> uc.isExceptionThrown()
True
Instance Methods [hide private]
 
__init__(self, agent, url="http://upgrade.openmicroscopy.org.uk/", version=omero_version, timeout=DEFAULT_TIMEOUT)
:
source code
 
isUpgradeNeeded(self) source code
 
getUpgradeUrl(self) source code
 
isExceptionThrown(self) source code
 
getExceptionThrown(self) source code
 
_set(self, results, e) source code
 
run(self)
If the {@link #url} has been set to null or the empty string, then no upgrade check will be performed (silently).
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  DEFAULT_TIMEOUT = 10* 1000
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, agent, url="http://upgrade.openmicroscopy.org.uk/", version=omero_version, timeout=DEFAULT_TIMEOUT)
(Constructor)

source code 

:

   agent   := Name of the agent which is accessing the registry. This will
              be appended to "OMERO." in order to adhere to the registry
              API.
   url     := Connection information for the upgrade check.
              None or empty string disables check. Defaults to upgrade.openmicroscopy.org.uk
   version := Version to check against the returned value.
              Defaults to current version as specified in omero_version.py.
   timeout := How long to wait for the HTTP GET
Overrides: object.__init__

run(self)

source code 

If the {@link #url} has been set to null or the empty string, then no upgrade check will be performed (silently). If however the string is an invalid URL, a warning will be printed.

This method should <em>never</em> throw an exception.