runtime/PLCObject.py
changeset 391 9b1801ef99b5
parent 368 86ecd8374dae
child 398 31d08063b5d6
equal deleted inserted replaced
390:44909ffb2cc6 391:9b1801ef99b5
   210         self.python_threads_vars["_runtime_begin"] = []
   210         self.python_threads_vars["_runtime_begin"] = []
   211         self.python_threads_vars["_runtime_cleanup"] = []
   211         self.python_threads_vars["_runtime_cleanup"] = []
   212         
   212         
   213         for filename in os.listdir(self.workingdir):
   213         for filename in os.listdir(self.workingdir):
   214             name, ext = os.path.splitext(filename)
   214             name, ext = os.path.splitext(filename)
   215             if name.startswith("runtime") and ext == ".py":
   215             if name.upper().startswith("RUNTIME") and ext.upper() == ".PY":
   216                 try:
   216                 try:
   217                     # TODO handle exceptions in runtime.py
   217                     # TODO handle exceptions in runtime.py
   218                     # pyfile may redefine _runtime_cleanup
   218                     # pyfile may redefine _runtime_cleanup
   219                     # or even call _PythonThreadProc itself.
   219                     # or even call _PythonThreadProc itself.
   220                     execfile(os.path.join(self.workingdir, filename), self.python_threads_vars)
   220                     execfile(os.path.join(self.workingdir, filename), self.python_threads_vars)