#NEWLINE# def main( ) : #NEWLINE# #INDENT# path = os . path . dirname ( sys . argv [ 0 ] ) #NEWLINE# if path : #NEWLINE# #INDENT# path = ( path + '/' ) #NEWLINE# #UNINDENT# config = ConfigParser . RawConfigParser ( allow_no_value = True ) #NEWLINE# config . read ( ( path + 'config' ) ) #NEWLINE# host = config . get ( 'client' , 'hostAddr' ) #NEWLINE# port = config . getint ( 'client' , 'hostPort' ) #NEWLINE# logPath = config . get ( 'common' , 'logPath' ) #NEWLINE# verbose = config . get ( 'common' , 'verbose' ) #NEWLINE# if ( ( verbose == 'True' ) or ( verbose == 'true' ) ) : #NEWLINE# #INDENT# verbose = True #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# verbose = False #NEWLINE# #UNINDENT# logger . init ( logPath , ( 'client-' + str ( datetime . datetime . now ( ) ) ) ) #NEWLINE# logger . debugFlag = verbose #NEWLINE# node = WorkingNode ( ) #NEWLINE# node . connect ( host , port ) #NEWLINE# node . readConfig ( ) #NEWLINE# node . run ( ) #NEWLINE# while node . isActive : #NEWLINE# #INDENT# time . sleep ( 0.5 ) #NEWLINE# #UNINDENT# node . disconnect ( )