From 727b2ca5a99a91b210877bee1026f3c7b15a8dd4 Mon Sep 17 00:00:00 2001 From: David Rose Date: Tue, 23 Feb 2010 00:44:29 +0000 Subject: [PATCH] don't report error messages for panda3d.blah --- direct/src/showutil/FreezeTool.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/direct/src/showutil/FreezeTool.py b/direct/src/showutil/FreezeTool.py index ab7c193d1d..f95e058d9a 100644 --- a/direct/src/showutil/FreezeTool.py +++ b/direct/src/showutil/FreezeTool.py @@ -18,6 +18,7 @@ except ImportError: import direct from pandac.PandaModules import * from pandac.extension_native_helpers import dll_suffix, dll_ext +import panda3d # Check to see if we are running python_d, which implies we have a # debug build, and we have to build the module with debug options. @@ -1312,6 +1313,22 @@ class PandaModuleFinder(modulefinder.ModuleFinder): finding the libpandaexpress etc. modules that interrogate produces. """ + def __init__(self, *args, **kw): + modulefinder.ModuleFinder.__init__(self, *args, **kw) + + def import_module(self, partname, fqname, parent): + if parent and parent.__name__ == 'panda3d': + # A special case: map a reference to the "panda3d.blah" + # module into the appropriate Panda3D dll. + m = getattr(panda3d, partname, None) + if m: + libname = m.__libraries__[-1] + partname = libname + fqname = libname + parent = None + + return modulefinder.ModuleFinder.import_module(self, partname, fqname, parent) + def find_module(self, name, path, parent=None): try: return modulefinder.ModuleFinder.find_module(self, name, path, parent = parent)