|
@@ -3,6 +3,7 @@
|
|
|
import DirectNotifyGlobal
|
|
import DirectNotifyGlobal
|
|
|
import Datagram
|
|
import Datagram
|
|
|
from MsgTypes import *
|
|
from MsgTypes import *
|
|
|
|
|
+import PythonUtil
|
|
|
|
|
|
|
|
# These are stored here so that the distributed classes we load on the fly
|
|
# These are stored here so that the distributed classes we load on the fly
|
|
|
# can be exec'ed in the module namespace as if we imported them normally.
|
|
# can be exec'ed in the module namespace as if we imported them normally.
|
|
@@ -22,19 +23,22 @@ class ClientDistUpdate:
|
|
|
self.divisors = []
|
|
self.divisors = []
|
|
|
self.deriveTypesFromParticle(dcField)
|
|
self.deriveTypesFromParticle(dcField)
|
|
|
# Figure out our function pointer
|
|
# Figure out our function pointer
|
|
|
- try:
|
|
|
|
|
- exec("import " + cdc.name, moduleGlobals, moduleLocals)
|
|
|
|
|
- self.func = eval(cdc.name + "." + cdc.name + "." + self.name)
|
|
|
|
|
- # Only catch name and attribute errors
|
|
|
|
|
- # as all other errors are legit errors
|
|
|
|
|
- except ImportError, e:
|
|
|
|
|
- self.notify.warning("Unable to import %s.py: %s" % (cdc.name, e))
|
|
|
|
|
- self.func = None
|
|
|
|
|
- except (NameError, AttributeError), e:
|
|
|
|
|
- #self.notify.warning(cdc.name + "." + self.name +
|
|
|
|
|
- # " does not exist")
|
|
|
|
|
|
|
+ if not PythonUtil.findPythonModule(cdc.name):
|
|
|
|
|
+ # The ClientDistClass already reported this warning.
|
|
|
|
|
+ #self.notify.warning("%s.py does not exist." % (cdc.name))
|
|
|
self.func = None
|
|
self.func = None
|
|
|
- return None
|
|
|
|
|
|
|
+
|
|
|
|
|
+ else:
|
|
|
|
|
+ exec("import " + cdc.name, moduleGlobals, moduleLocals)
|
|
|
|
|
+ try:
|
|
|
|
|
+ self.func = eval(cdc.name + "." + cdc.name + "." + self.name)
|
|
|
|
|
+ # Only catch name and attribute errors
|
|
|
|
|
+ # as all other errors are legit errors
|
|
|
|
|
+ except (NameError, AttributeError), e:
|
|
|
|
|
+ #self.notify.warning(cdc.name + "." + self.name + " does not exist")
|
|
|
|
|
+ self.func = None
|
|
|
|
|
+
|
|
|
|
|
+ return
|
|
|
|
|
|
|
|
def deriveTypesFromParticle(self, dcField):
|
|
def deriveTypesFromParticle(self, dcField):
|
|
|
dcFieldAtomic = dcField.asAtomicField()
|
|
dcFieldAtomic = dcField.asAtomicField()
|