equal
deleted
inserted
replaced
273 """ |
273 """ |
274 |
274 |
275 __slots__ = () |
275 __slots__ = () |
276 |
276 |
277 |
277 |
278 def __get_mailbox_class(mbfmt): |
|
279 if mbfmt == 'maildir': |
|
280 return Maildir |
|
281 elif mbfmt == 'mdbox': |
|
282 return MultiDbox |
|
283 elif mbfmt == 'sdbox': |
|
284 return SingleDbox |
|
285 raise ValueError('unsupported mailbox format: %r' % mbfmt) |
|
286 |
|
287 |
|
288 def new(account): |
278 def new(account): |
289 """Create a new Mailbox instance for the given Account.""" |
279 """Create a new Mailbox instance for the given Account.""" |
290 return __get_mailbox_class(account.mail_location.mbformat)(account) |
280 mbfmt = account.mail_location.mbformat |
|
281 if mbfmt == 'maildir': |
|
282 return Maildir(account) |
|
283 elif mbfmt == 'mdbox': |
|
284 return MultiDbox(account) |
|
285 elif mbfmt == 'sdbox': |
|
286 return SingleDbox(account) |
|
287 raise ValueError('unsupported mailbox format: %r' % mbfmt) |
291 |
288 |
292 del cfg_dget |
289 del cfg_dget |