def do_compile(self,line): ''' compile will translate the openspeak (.ospk) file into TestON test script (python). It will receive the openspeak file path as input and will generate equivalent test-script file in the same directory. usage: ----- teston>compile /home/openflow/TestON/PoxTest.ospk Auto-generated test-script file is /home/openflow/TestON/PoxTest.py ''' from core import openspeak openspeak = openspeak.OpenSpeak() openspeakfile = line if os.path.exists(openspeakfile) : openspeak.compiler(openspeakfile=openspeakfile,writetofile=1) print "Auto-generated test-script file is "+ re.sub("ospk","py",openspeakfile,0) else: print 'There is no such file : '+line
def do_compile(self,line): ''' compile will translate the openspeak (.ospk) file into TestON test script (python). It will receive the openspeak file path as input and will generate equivalent test-script file in the same directory. usage: ----- teston>compile /home/openflow/TestON/PoxTest.ospk Auto-generated test-script file is /home/openflow/TestON/PoxTest.py ''' from core import openspeak openspeak = openspeak.OpenSpeak() openspeakfile = line if os.path.exists(openspeakfile) : openspeak.compiler(openspeakfile=openspeakfile,writetofile=1) print "Auto-generated test-script file is "+ re.sub("ospk","py",openspeakfile,0) else: print 'There is no such file : '+line