scoped_name#
- static Support.scoped_name(obj: Any) ContextManager #
Allow for the use of
with
to shorten APIs.In the EnSight and PyEnsight APIs, the interfaces can become lengthy. This class makes it possible to shorten APIs for modules, classes, and namespaces.
Examples
>>> sn = s.ensight.utils.support.scoped_name >>> with sn(s.ensight.objs.core) as core, sn(s.ensight.objs.enums) as enums: >>> print(core.PARTS.find(True, enums.VISIBLE)) >>> sn = ensight.utils.support.scoped_name >>> with sn(ensight.objs.core) as core, sn(ensight.objs.enums) as enums: >>> print(core.PARTS.find(True, enums.VISIBLE))