This module includes methods to examine and upgrade the current EnSight license. At all times, the EnSight client has a current license state called its 'capability'. Each level of capability has a specific set of 'features' that are allowed. Most users select the 'capability' level by selecting a different icon at startup or using a command line flag. The actual checking out of a license is done based on 'capability' levels. It is important to note that during an EnSight session, the capability level can be increased (more features enabled), but it can never be downgraded. The enspyqtgui_int module provides a number of value and methods for querying the license state and requesting a new capability level.
A simple example to get the current license capability would be:
cap = enspyqtgui_int.licensecapability()
if (cap == enspyqtgui_int.LICENSE_GOLD):
print("You have an EnSight Gold license checked out!")
There are a number of capability levels defined in this module. The common ones include:
There are some licensing states that have been deprecated or are used for internal purposes. These include:
personality = enspyqtgui_int.licensepersonality([full=0])
There are a number of personalities (i.e. main product name):
- "CEI Task"
- "Auto Post"
There are also a long list of supported features:
There are also a number of methods in the module including:
- bool = licensehasfeature(feature|[features]) - This method takes a feature or a list of features and checks to see if that feature is enabled for the current license capability. It returns a boolean or a list of boolean values (one for each feature passed).
- bool = licensecaphasfeature(capability,feature|[features]) - This method takes a capability level and a feature or a list of features and checks to see if that feature is enabled for that license capability. It returns a boolean or a list of boolean values (one for each feature passed).
- cap = licensedefault() - Returns the capability that was specified when the EnSight session was started. For example, based on the command line parameters specified.
- cap = licensecapability([name=0]) - Returns the current capability level. If name != 0, then a string name is returned instead of the integer enum.
- personality = licensepersonality([full=0]) - Returns the current personality as a string. If full != 0, then the full name is returned (personality + flavor "EnSight HPC").
- newcap = licenseupgrade(cap) - Requests that the current capability level be raised to at least the level specified by 'cap' (basically that all the features enabled by 'cap' are available). If the call fails to upgrade the license, this method throws an exception, otherwise, it returns the resulting capability level, which may be higher than the requested level (e.g. you request LICENSE_LITE but the session already has LICENSE_GOLD, no license change is made and the returned capability is LICENSE_GOLD).
An example (which prints [False, False]):
cap = enspyqtgui_int.LICENSE_LITE
feats = [enspyqtgui_int.FEATURE_FX,enspyqtgui_int.FEATURE_PARALLEL_RENDERING]