no login required for this server/class def getpassword(self)pass no login required for this server/class ###############################################################################specialized subclasses ###############################################################################class mailsenderauth(mailsender)""use for servers that require login authorizationclientchoose mailsender or mailsenderauth super class based on mailconfig smtpuser setting (none?""smtppassword none eon classnot selfshared by poss instances def __init__(selfsmtpserver=nonesmtpuser=none)mailsender __init__(selfsmtpserverself smtpuser smtpuser or mailconfig smtpuser #self smtppassword none emakes pymailgui ask for each senddef authenticateserver(selfserver)server login(self smtpuserself smtppassworddef getpassword(self)""get smtp auth password if not yet knownmay be called by superclass autoor client manualnot needed until sendbut don' run in gui threadget from client-side file or subclass method ""if not self smtppasswordtrylocalfile open(mailconfig smtppasswdfilemailsenderauth smtppassword localfile readline()[:- self trace('local file passwordrepr(self smtppassword)exceptmailsenderauth smtppassword self asksmtppassword( def asksmtppassword(self)assert false'subclass must define methodclass mailsenderauthconsole(mailsenderauth)def asksmtppassword(self)import getpass prompt 'password for % on % ?(self smtpuserself smtpservernamereturn getpass getpass(promptclass silentmailsender(silentmailtoolmailsender)pass replaces trace client-side scripting