def __init__( self ): PyTestSimpleCui.__init__( self ) self.color = 'green' self.root = Tk() self.root.title("pytestgui") self.width = self.root.winfo_screenwidth() - 300 self.barFrame = Frame( self.root , bd=2 , relief='sunken' ) self.barFrame.pack( fill='x' , expand=1 , side='top' , padx=1 , pady=1 ) self.canvas=Canvas(self.barFrame, width=self.width, height=20) self.canvas.pack() self.scale=self.canvas.create_rectangle(0, 0, 0, 20, fill=self.color, outline=self.color ) self.descFrame = Frame( self.root ) self.descFrame.pack( fill='x' , expand=1 , side='bottom' ) self.test = Desc( self.descFrame , 'test_Normal' , self.width ) self.testTime = Time( self.descFrame , '0:00' ) self.testSuite = Desc( self.descFrame , 'Test_Good' , self.width ) self.testSuiteTime = Time( self.descFrame , '0:00' ) self.total = Desc( self.descFrame , '100 of 100' , self.width ) self.testTotalTime = Time( self.descFrame , '0:00' ) self.count = 0 self.quit = False self.testDescription = "" self.suiteDescription = "" self.testsCount = 999 self.updateRequested = False thread.start_new_thread( self.root.mainloop , () ) time.sleep( 0.01 ) self.centerWindow()
def __init__(self): PyTestSimpleCui.__init__(self) self.color = 'green' self.root = Tk() self.root.title("pytestgui") self.width = self.root.winfo_screenwidth() - 300 self.barFrame = Frame(self.root, bd=2, relief='sunken') self.barFrame.pack(fill='x', expand=1, side='top', padx=1, pady=1) self.canvas = Canvas(self.barFrame, width=self.width, height=20) self.canvas.pack() self.scale = self.canvas.create_rectangle(0, 0, 0, 20, fill=self.color, outline=self.color) self.descFrame = Frame(self.root) self.descFrame.pack(fill='x', expand=1, side='bottom') self.test = Desc(self.descFrame, 'test_Normal', self.width) self.testTime = Time(self.descFrame, '0:00') self.testSuite = Desc(self.descFrame, 'Test_Good', self.width) self.testSuiteTime = Time(self.descFrame, '0:00') self.total = Desc(self.descFrame, '100 of 100', self.width) self.testTotalTime = Time(self.descFrame, '0:00') self.count = 0 self.quit = False self.testDescription = "" self.suiteDescription = "" self.testsCount = 999 self.updateRequested = False thread.start_new_thread(self.root.mainloop, ()) time.sleep(0.01) self.centerWindow()
def leaveWorld(self, description): self.quit = True self.askForUpdate() time.sleep(0.2) return PyTestSimpleCui.leaveWorld(self, description)
def enterSuite(self, description): self.suiteDescription = description self.askForUpdate() return PyTestSimpleCui.enterSuite(self, description)
def enterTest(self, description): self.count += 1 self.testDescription = description self.askForUpdate() return PyTestSimpleCui.enterTest(self, description)
def failTest(self, fullPath, lineNum, message): self.color = 'red' self.askForUpdate() return PyTestSimpleCui.failTest(self, fullPath, lineNum, message)
def enterWorld(self, description): self.testsCount = self._countTests() self.askForUpdate() return PyTestSimpleCui.enterWorld(self, description)
def failTest( self, fullPath, lineNum, message ): self.color = 'red' self.askForUpdate() return PyTestSimpleCui.failTest( self , fullPath , lineNum , message )
def enterWorld( self, description ): self.testsCount = self._countTests() self.askForUpdate() return PyTestSimpleCui.enterWorld( self , description )
def leaveWorld( self , description ): self.quit = True self.askForUpdate() time.sleep( 0.2 ) return PyTestSimpleCui.leaveWorld( self , description )
def enterSuite( self , description ): self.suiteDescription = description self.askForUpdate() return PyTestSimpleCui.enterSuite( self , description )
def enterTest( self, description ): self.count += 1 self.testDescription = description; self.askForUpdate() return PyTestSimpleCui.enterTest( self , description )