comparison src/plugins/plugin_misc_maildir.py @ 471:6cd04adddaea

core: exceptions moved to core plugin group blog: group blog now manage public microblogs
author Goffi <goffi@goffi.org>
date Wed, 04 Apr 2012 00:06:44 +0200
parents 1c1d1a4994c4
children 2a072735e459
comparison
equal deleted inserted replaced
470:5c916b99d0f6 471:6cd04adddaea
31 from email.charset import Charset 31 from email.charset import Charset
32 import os,os.path 32 import os,os.path
33 from cStringIO import StringIO 33 from cStringIO import StringIO
34 from twisted.internet import reactor 34 from twisted.internet import reactor
35 import pdb 35 import pdb
36 from sat.exceptions import * 36 from sat.core.exceptions import ProfileUnknownError
37 from sat.memory.persistent import PersistentBinaryDict 37 from sat.memory.persistent import PersistentBinaryDict
38 38
39 39
40 from zope.interface import implements 40 from zope.interface import implements
41 41
105 """Create and return a MailboxUser instance 105 """Create and return a MailboxUser instance
106 @param boxname: name of the box 106 @param boxname: name of the box
107 @param observer: method to call when a NewMessage arrive""" 107 @param observer: method to call when a NewMessage arrive"""
108 profile = self.host.memory.getProfileName(profile_key) 108 profile = self.host.memory.getProfileName(profile_key)
109 if not profile: 109 if not profile:
110 raise ProfileUnknownError 110 raise ProfileUnknownError(profile_key)
111 if not self.__mailboxes[profile].has_key(boxname): 111 if not self.__mailboxes[profile].has_key(boxname):
112 self.__mailboxes[profile][boxname]=MailboxUser(self, boxname, observer, profile=profile) 112 self.__mailboxes[profile][boxname]=MailboxUser(self, boxname, observer, profile=profile)
113 else: 113 else:
114 if observer: 114 if observer:
115 self.addObserver(observer, profile, boxname) 115 self.addObserver(observer, profile, boxname)