mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 16:58:40 -04:00
fixed import problem on client publish
This commit is contained in:
parent
130215ba73
commit
8f4057fbd5
@ -19,6 +19,17 @@ class ClientDistClass:
|
||||
self.number = dcClass.getNumber()
|
||||
self.name = dcClass.getName()
|
||||
|
||||
# Import the class, and store the constructor
|
||||
try:
|
||||
exec("import " + self.name, moduleGlobals, moduleLocals)
|
||||
except ImportError, e:
|
||||
self.notify.warning("Unable to import %s.py: %s" % (self.name, e))
|
||||
self.constructor = None
|
||||
return
|
||||
self.constructor = eval(self.name + "." + self.name)
|
||||
|
||||
"""
|
||||
# This does not seem to work on the client publish
|
||||
stuff = ihooks.current_importer.get_loader().find_module(self.name)
|
||||
if not stuff:
|
||||
self.notify.warning("Unable to import %s.py" % (self.name))
|
||||
@ -27,6 +38,7 @@ class ClientDistClass:
|
||||
module = __import__(self.name, moduleGlobals, moduleLocals)
|
||||
# The constructor is really the classObj, which is of course callable
|
||||
self.constructor = getattr(module, self.name, None)
|
||||
"""
|
||||
|
||||
self.allFields = self.parseFields(dcClass)
|
||||
self.allCDU = self.createAllCDU(self.allFields, self.constructor)
|
||||
|
Loading…
x
Reference in New Issue
Block a user