check_license(panel=None,
token=license.MATERIALSCIENCE_MAIN,
name="",
as_validator=False)
|
|
Check if a valid token exists
- Parameters:
panel (schrodinger.ui.qt.appframework.AppFramework) - panel to use to put up an error dialog if no license
token (schrodinger.utils.license constant) - A token type from the schrodinger.utils.license module, such as
MATERIALSCIENCE_MAIN or MATERIALSCIENCE_GA
name (str) - The user-identifiable name for the token - used for error
messages. If not provided, the string used in the license module
for this token (if one exists) will be used.
as_validator (bool) - If True, this function will work as an AF2 validation method.
Instead of posting a dialog or printing a message for a failed
license check, it will return (False, error_message).
- Returns: bool or (bool, str)
- True if valid license exists. If no valid license exists, False
will be returned by default, but (False, msg) will be returned if
as_validator=True. Note that (False, msg) evalutes to True so
must be handled by the calling routine as not a boolean if
as_validator=True.
|