home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyo (Python 2.6)
-
- import logging
- log = logging.getLogger('aol_sp')
- import hooks
- import util.net as net
- import mail.smtp as smtp
- import services.service_provider as SP
-
- class AOLServiceProvider(SP.EmailPasswordServiceProvider):
-
- def update_info(self, kwds):
- super(AOLServiceProvider, self).update_info(kwds)
- self.updatefreq = kwds.get('updatefreq', 300)
-
-
- def get_options(self, type):
- options = super(AOLServiceProvider, self).get_options(type)
- if type == 'email':
- email_address = options.get('email_address', None)
- if email_address is not None:
- options['username'] = email_address
-
- username = options.get('username', options.get('name'))
- if username is not None:
- username = ''.join(username.split()).lower()
- username = str(net.EmailAddress(username, 'aol.com'))
- options['name'] = options['username'] = username
-
-
- options['updatefreq'] = self.updatefreq
- return options
-
-
- def add_account_email(self, acct):
- retval = super(AOLServiceProvider, self).add_account_email(acct = acct)
- log.info("Changing %r's username from %r to %r", acct, acct.username, self.email_address)
- acct.name = self.email_address
-
- try:
- (pw, smtppw) = smtp.SMTPEmailAccount._unglue_pw(acct.password)
- except ValueError:
- pass
-
- self.password = pw
- return retval
-
-
-