def update(self):
        """ Updates the error display, fetching all new messages from the notify
        stream """

        if not self._notify_stream:
            self._init_notify()

        while self._notify_stream.is_text_available():
            line = self._notify_stream.get_line().strip()
            if "warning" in line:
                RPObject.global_warn("Panda3D", line)
                # self.add_warning(line)
            elif "error" in line:
                RPObject.global_error("Panda3D", line)
                self.add_error(line)
            else:
                RPObject.global_debug("Panda3D", line)
    def update(self):
        """ Updates the error display, fetching all new messages from the notify
        stream """

        if not self._notify_stream:
            self._init_notify()

        while self._notify_stream.is_text_available():
            line = self._notify_stream.get_line().strip()
            if "warning" in line:
                RPObject.global_warn("Panda3D", line)
                # self.add_warning(line)
            elif "error" in line:
                RPObject.global_error("Panda3D", line)
                self.add_error(line)
            else:
                RPObject.global_debug("Panda3D", line)
Exemplo n.º 3
0
    "PSSMCameraRig",
    "IESDataset",
    "TagStateManager",
]

# Classes which should get imported and renamed
classes_to_import_and_rename = {
    "RPPointLight": "PointLight",
    "RPSpotLight": "SpotLight"
}

native_module = None

# If the module was built, use it, otherwise use the python wrappers
if NATIVE_CXX_LOADED:
    RPObject.global_debug("CORE", "Using native core module")
    from rpcore.native import native_ as _native_module  # pylint: disable=wrong-import-position
else:
    from rpcore import pynative as _native_module  # pylint: disable=wrong-import-position
    RPObject.global_debug("CORE", "Using simulated python-wrapper module")

# Import all classes
for v in classes_to_import + list(classes_to_import_and_rename.keys()):
    if hasattr(_native_module, v):
        v_name = classes_to_import_and_rename[v] if v in classes_to_import_and_rename else v
        globals()[v_name] = getattr(_native_module, v)
    else:
        print("ERROR: could not import class", v, "from", _native_module.__name__)

# Don't export all variables, only the required ones
__all__ = classes_to_import + list(classes_to_import_and_rename.values()) + ["NATIVE_CXX_LOADED"]
Exemplo n.º 4
0
    "GPUCommandList",
    "ShadowManager",
    "InternalLightManager",
    "PSSMCameraRig",
    "IESDataset",
    "TagStateManager",
]

# Classes which should get imported and renamed
classes_to_import_and_rename = {
    "RPPointLight": "PointLight",
    "RPSpotLight": "SpotLight"
}

_native_module = importlib.import_module(modulepath)
RPObject.global_debug('CORE', 'Using native module "{}"'.format(modulepath))

# Import all classes
imported = []
for v in (classes_to_import + list(classes_to_import_and_rename.keys())):
    if hasattr(_native_module, v):
        v_name = classes_to_import_and_rename[
            v] if v in classes_to_import_and_rename else v
        globals()[v_name] = getattr(_native_module, v)
        imported.append(v)
    else:
        print("ERROR: could not import class", v, "from",
              _native_module.__name__)

# Don't export all variables, only the required ones
__all__ = imported + ["NATIVE_CXX_LOADED"]