#NEWLINE# def setDefaults( self , defaults ) : #NEWLINE# #INDENT# if ( not defaults . has_key ( 'port' ) ) : #NEWLINE# #INDENT# defaults [ 'port' ] = str ( pb . portno ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( defaults [ 'port' ] , ( int , long ) ) : #NEWLINE# #INDENT# defaults [ 'port' ] = str ( defaults [ 'port' ] ) #NEWLINE# #UNINDENT# #UNINDENT# for ( k , v ) in defaults . iteritems ( ) : #NEWLINE# #INDENT# if ( k in self . fields ) : #NEWLINE# #INDENT# widget = getattr ( self , ( '_%sEntry' % ( k , ) ) ) #NEWLINE# widget . set_text ( v )