ID 232531 - Certain functions from `NodegraphAPI.Xio` module are not exposed via `__all__` list, and the list references module functions that don't exist, preventing wildcard imports

Follow

Problem summary:

The setter equivalent of the NodegraphAPI.Xio.Parameter_getValueDict() function -- Parameter_setValueDict() -- is not currently exposed via the __all__ list at the top of the module. This means that the function cannot currently be used, without explicitly importing (it from) the Xio module.

Furthermore, a couple of functions are named in the __all__ list that don't actually exist. This prevents wildcard imports from the Xio module.
The undefined functions are:

  • GetDocumentFromKatanaFile()
  • GetNodeFromNodegraphNode()
  • GetNodegraphNodeFromNode()
  • CreateDocumentFromNodeList()

Steps to reproduce:

Case 1: Execute the following call in a Python tab:

help(NodegraphAPI.Xio.Parameter_setValueDict)
Case 2: Execute the following call in a Python tab:

from NodegraphAPI.Xio import *

Expected behaviour:

Case 1: Help text including the docstring of the function is meant to be printed to the Python tab's result area.

Case 2: All functions (and other code objects) that are named in the __all__ list of the Xio module are available to use under their respective names.

Actual behaviour:

Case 1: A Python exception is raised, with the following error message:


AttributeError: '_VirtualModule' object has no attribute 'Parameter_setValueDict'
Case 2: A Python exception is raised, with the following error message:

AttributeError: 'module' object has no attribute 'GetDocumentFromKatanaFile'

Workaround:

Case 1: The function can be used after manually importing the Xio module, like so:


import NodegraphAPI.Xio

The function can also be imported manually from the Xio module, like so:


from NodegraphAPI.Xio import Parameter_setValueDict
No workaround is available for case 2.

Reproduced versions/platforms:

  • KATANA 1.0v1 / Linux
  • KATANA 2.1v4 / Linux

    We're sorry to hear that

    Please tell us why