_backwardscompatibilityhelper Module

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[source]

Bases: Exception

paraview._backwardscompatibilityhelper.GetProxy(module, key, **kwargs)[source]

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)[source]

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.

Will raise NotSupportedException if the property was deprecated and paraview compatibility version is newer than that deprecation version.

Will raise Continue to 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)[source]

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:

  1. 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.

  2. 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)[source]