Internal module used by paraview.servermanager to help warn about properties changed or removed.
If the compatibility version is less than the version where a particular property was removed, getattr and setattr should ideally continue to work as before or return a value of appropriate form so old code doesn’t fail. Otherwise getattr and setattr should throw the NotSupportedException with appropriate debug message.
- exception paraview._backwardscompatibilityhelper.Continue¶
- paraview._backwardscompatibilityhelper.GetProxy(module, key, **kwargs)¶
Returns the compatibility version set by the user. If the compatibility version is set, it also checks if the compatibility version is greater or less than the current version and prints a warning.
- paraview._backwardscompatibilityhelper.getattr(proxy, pname)¶
Attempts to emulate getattr() when called using a deprecated property name for a proxy.
Will return a reasonable stand-in if the property was deprecated and the paraview compatibility version was set to a version older than when the property was deprecated.
NotSupportedExceptionif the property was deprecated and paraview compatibility version is newer than that deprecation version.
Continueto indicate the property name is unaffected by any API deprecation and the caller should follow normal code execution paths.
Provide backwards compatibility for color lookup table name changes.
- paraview._backwardscompatibilityhelper.setattr(proxy, pname, value)¶
Attempts to emulate setattr() when called using a deprecated name for a proxy property.
For properties that are no longer present on a proxy, the code should do the following:
If compatibility_version is less than the version in which the property was removed, attempt to handle the request and raise Continue to indicate that the request has been handled. If it is too complicated to support the old API, then it is acceptable to raise a warning message, but don’t raise an exception.
If compatibility version is >= the version in which the property was removed, raise NotSupportedException with details including suggestions to update the script.
- paraview._backwardscompatibilityhelper.setattr_fix_value(proxy, pname, value, setter_func)¶