37 from _ctypes import FreeLibrary as dlclose |
37 from _ctypes import FreeLibrary as dlclose |
38 elif os.name == "posix": |
38 elif os.name == "posix": |
39 from _ctypes import dlopen, dlclose |
39 from _ctypes import dlopen, dlclose |
40 |
40 |
41 import traceback |
41 import traceback |
|
42 |
|
43 |
42 def get_last_traceback(tb): |
44 def get_last_traceback(tb): |
43 while tb.tb_next: |
45 while tb.tb_next: |
44 tb = tb.tb_next |
46 tb = tb.tb_next |
45 return tb |
47 return tb |
46 |
48 |
47 lib_ext ={ |
49 lib_ext ={ |
48 "linux2":".so", |
50 "linux2":".so", |
49 "win32":".dll", |
51 "win32":".dll", |
50 }.get(sys.platform, "") |
52 }.get(sys.platform, "") |
51 |
53 |
|
54 |
52 def PLCprint(message): |
55 def PLCprint(message): |
53 sys.stdout.write("PLCobject : "+message+"\n") |
56 sys.stdout.write("PLCobject : "+message+"\n") |
54 sys.stdout.flush() |
57 sys.stdout.flush() |
|
58 |
55 |
59 |
56 class PLCObject(pyro.ObjBase): |
60 class PLCObject(pyro.ObjBase): |
57 def __init__(self, workingdir, daemon, argv, statuschange, evaluator, pyruntimevars): |
61 def __init__(self, workingdir, daemon, argv, statuschange, evaluator, pyruntimevars): |
58 pyro.ObjBase.__init__(self) |
62 pyro.ObjBase.__init__(self) |
59 self.evaluator = evaluator |
63 self.evaluator = evaluator |