#NEWLINE# def logfile( self , argv ) : #NEWLINE# #INDENT# 'logfile <name>\n    Sets the SMTP client log file. protocol messages are sent here. If the name\n    is called "close" then any current log file is closed. The special name\n    "stdout" may also be used. ' #NEWLINE# if ( len ( argv ) <= 1 ) : #NEWLINE# #INDENT# if self . _logfile : #NEWLINE# #INDENT# self . _print ( ( 'Current logfile is %r.' % ( self . _logfile . name , ) ) ) #NEWLINE# #UNINDENT# if self . _client : #NEWLINE# #INDENT# lf = self . _client . logfile . name #NEWLINE# self . _print ( ( 'Current SMTP logfile is %r.' % ( lf , ) ) ) #NEWLINE# #UNINDENT# return #NEWLINE# #UNINDENT# fname = argv [ 1 ] #NEWLINE# if ( self == 'close' ) : #NEWLINE# #INDENT# self . _logfile = None #NEWLINE# if self . _client : #NEWLINE# #INDENT# fo = self . _client . logfile #NEWLINE# if ( fo is not None ) : #NEWLINE# #INDENT# self . _client . set_logfile ( None ) #NEWLINE# if ( fo is not sys . stdout ) : #NEWLINE# #INDENT# fo . close ( ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( fname == 'stdout' ) : #NEWLINE# #INDENT# fo = sys . stdout #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# fo = open ( fname , 'w' ) #NEWLINE# #UNINDENT# #UNINDENT# self . _logfile = fo #NEWLINE# if self . _client : #NEWLINE# #INDENT# self . _client . set_logfile ( fo )