tests/linux/test_svgui/methods.py
changeset 256 1da137b99948
parent 167 648449a9d778
child 261 5299c6746fa8
--- a/tests/linux/test_svgui/methods.py	Tue Oct 14 13:40:17 2008 +0200
+++ b/tests/linux/test_svgui/methods.py	Thu Oct 16 16:49:39 2008 +0200
@@ -1,11 +1,11 @@
-logger.write_error("Welcome to the Beremiz Demo\n\n")            
-logger.write("This demo provides a PLC working with the CANopen plugin\n")
-logger.write("""Some external programs are also provided:\n
+self.logger.write_error("Welcome to the Beremiz Demo\n\n")            
+self.logger.write("This demo provides a PLC working with the CANopen plugin\n")
+self.logger.write("""Some external programs are also provided:\n
 - a CAN TCP server to simulate the CANopen network
 - a virtual slave node to simulate input block
 - a virtual slave node to simulate output block
 """)
-logger.write("\nInfo: For this demo, %s plugin has some special methods to run external programs.\nThese methods are defined in methods.py\n" % (PlugName or "Root"))
+self.logger.write("\nInfo: For this demo, %s plugin has some special methods to run external programs.\nThese methods are defined in methods.py\n" % (PlugName or "Root"))
 #open_pdf(os.path.join(os.path.split(__file__)[0], "doc", "manual_beremiz.pdf"), pagenum=21)
 
 if wx.Platform == '__WXMSW__':
@@ -42,23 +42,23 @@
 
 
 def my_methods(self): 
-    def _Run(logger):        
+    def _Run():        
         # External programs list 
         # Launch them and get their pid
         for prog in self.listLaunchProg:
             logger.write("Starting %s\n" % prog['name'])
-            prog['pid'] = ProcessLogger(logger, prog['command'], no_gui=prog['no_gui'])
+            prog['pid'] = ProcessLogger(self.logger, prog['command'], no_gui=prog['no_gui'])
             prog['pid'].spin(
             		 timeout=200,
                      keyword = prog['keyword'],
                      kill_it = False)
         
-        PluginsRoot._Run(self,logger)
+        PluginsRoot._Run(self)
 
-    def _Stop(logger):
-        PluginsRoot._Stop(self,logger)
+    def _Stop():
+        PluginsRoot._Stop(self)
         for prog in self.listLaunchProg:
-            logger.write("Stopping %s\n" % prog['name'])
+            self.logger.write("Stopping %s\n" % prog['name'])
             prog['pid'].kill()
     
     return _Run, _Stop