runtime/PLCObject.py
changeset 1831 56b48961cc68
parent 1783 3311eea28d56
child 1832 0f1081928d65
equal deleted inserted replaced
1830:e598d1acf354 1831:56b48961cc68
   275     def PythonRuntimeInit(self):
   275     def PythonRuntimeInit(self):
   276         MethodNames = ["init", "start", "stop", "cleanup"]
   276         MethodNames = ["init", "start", "stop", "cleanup"]
   277         self.python_runtime_vars = globals().copy()
   277         self.python_runtime_vars = globals().copy()
   278         self.python_runtime_vars.update(self.pyruntimevars)
   278         self.python_runtime_vars.update(self.pyruntimevars)
   279 
   279 
   280         class PLCSafeGlobals:
   280         class PLCSafeGlobals(object):
   281             def __getattr__(_self, name):
   281             def __getattr__(_self, name):
   282                 try:
   282                 try:
   283                     t = self.python_runtime_vars["_"+name+"_ctype"]
   283                     t = self.python_runtime_vars["_"+name+"_ctype"]
   284                 except KeyError:
   284                 except KeyError:
   285                     raise KeyError("Try to get unknown shared global variable : %s" % name)
   285                     raise KeyError("Try to get unknown shared global variable : %s" % name)