comparison src/plugins/plugin_misc_imap.py @ 588:beaf6bec2fcd

Remove every old-style class.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Fri, 18 Jan 2013 17:55:35 +0100
parents 952322b1d490
children e629371a28d3
comparison
equal deleted inserted replaced
587:952322b1d490 588:beaf6bec2fcd
47 "main": "IMAP_server", 47 "main": "IMAP_server",
48 "handler": "no", 48 "handler": "no",
49 "description": _("""Create an Imap server that you can use to read your "normal" type messages""") 49 "description": _("""Create an Imap server that you can use to read your "normal" type messages""")
50 } 50 }
51 51
52 class IMAP_server(): 52 class IMAP_server(object):
53 #TODO: connect profile on mailbox request, once password is accepted 53 #TODO: connect profile on mailbox request, once password is accepted
54 54
55 params = """ 55 params = """
56 <params> 56 <params>
57 <general> 57 <general>
73 info(_("Launching IMAP server on port %d"), port) 73 info(_("Launching IMAP server on port %d"), port)
74 74
75 self.server_factory = ImapServerFactory(self.host) 75 self.server_factory = ImapServerFactory(self.host)
76 reactor.listenTCP(port, self.server_factory) 76 reactor.listenTCP(port, self.server_factory)
77 77
78 class Message(): 78 class Message(object):
79 implements(imap4.IMessage) 79 implements(imap4.IMessage)
80 80
81 def __init__(self, uid, flags, mess_fp): 81 def __init__(self, uid, flags, mess_fp):
82 debug('Message Init') 82 debug('Message Init')
83 self.uid=uid 83 self.uid=uid
149 """ 149 """
150 debug('getSubPart') 150 debug('getSubPart')
151 return TypeError 151 return TypeError
152 152
153 153
154 class SatMailbox: 154 class SatMailbox(object):
155 implements(imap4.IMailbox) 155 implements(imap4.IMailbox)
156 156
157 def __init__(self,host,name,profile): 157 def __init__(self,host,name,profile):
158 self.host = host 158 self.host = host
159 self.listeners=set() 159 self.listeners=set()
387 387
388 def _emptyMailbox(self, name, id): 388 def _emptyMailbox(self, name, id):
389 return SatMailbox(self.host,name,self.profile) 389 return SatMailbox(self.host,name,self.profile)
390 390
391 391
392 class ImapRealm: 392 class ImapRealm(object):
393 implements(portal.IRealm) 393 implements(portal.IRealm)
394 394
395 def __init__(self,host): 395 def __init__(self,host):
396 self.host = host 396 self.host = host
397 397
400 profile=avatarID.decode('utf-8') 400 profile=avatarID.decode('utf-8')
401 if imap4.IAccount not in interfaces: 401 if imap4.IAccount not in interfaces:
402 raise NotImplementedError 402 raise NotImplementedError
403 return imap4.IAccount, ImapSatAccount(self.host,profile), lambda:None 403 return imap4.IAccount, ImapSatAccount(self.host,profile), lambda:None
404 404
405 class SatProfileCredentialChecker: 405 class SatProfileCredentialChecker(object):
406 """ 406 """
407 This credential checker check against SàT's profile and associated jabber's password 407 This credential checker check against SàT's profile and associated jabber's password
408 Check if the profile exists, and if the password is OK 408 Check if the profile exists, and if the password is OK
409 Return the profile as avatarId 409 Return the profile as avatarId
410 """ 410 """