#NEWLINE# def checkWork( self ) : #NEWLINE# #INDENT# finished = 0 #NEWLINE# fullDataRead = [ ] #NEWLINE# while 1 : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# ( buffer , bytesToRead , result ) = win32pipe . PeekNamedPipe ( self . pipe , 1 ) #NEWLINE# if ( not bytesToRead ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# ( hr , data ) = win32file . ReadFile ( self . pipe , bytesToRead , None ) #NEWLINE# fullDataRead . append ( data ) #NEWLINE# #UNINDENT# except win32api . error : #NEWLINE# #INDENT# finished = 1 #NEWLINE# break #NEWLINE# #UNINDENT# #UNINDENT# dataBuf = '' . join ( fullDataRead ) #NEWLINE# if dataBuf : #NEWLINE# #INDENT# self . receivedCallback ( dataBuf ) #NEWLINE# #UNINDENT# if finished : #NEWLINE# #INDENT# self . cleanup ( ) #NEWLINE# #UNINDENT# return len ( dataBuf )