VirtualMailManager/mailbox.py
branchv0.6.x
changeset 326 8f8d9c4c8332
parent 323 d58cc465dc61
child 366 d6573da35b5f
equal deleted inserted replaced
325:06c0457036a0 326:8f8d9c4c8332
    13 import re
    13 import re
    14 from binascii import a2b_base64, b2a_base64
    14 from binascii import a2b_base64, b2a_base64
    15 from subprocess import Popen, PIPE
    15 from subprocess import Popen, PIPE
    16 
    16 
    17 from VirtualMailManager.account import Account
    17 from VirtualMailManager.account import Account
    18 from VirtualMailManager.common import is_dir
    18 from VirtualMailManager.common import lisdir
    19 from VirtualMailManager.errors import VMMError
    19 from VirtualMailManager.errors import VMMError
    20 from VirtualMailManager.constants import VMM_ERROR
    20 from VirtualMailManager.constants import VMM_ERROR
    21 
    21 
    22 
    22 
    23 __all__ = ('new', 'Maildir', 'SingleDbox', 'MultiDbox',
    23 __all__ = ('new', 'Maildir', 'SingleDbox', 'MultiDbox',
    92     def __init__(self, account):
    92     def __init__(self, account):
    93         """
    93         """
    94         Creates a new mailbox instance.
    94         Creates a new mailbox instance.
    95         Use one of the `Maildir`, `SingleDbox` or `MultiDbox` classes.
    95         Use one of the `Maildir`, `SingleDbox` or `MultiDbox` classes.
    96         """
    96         """
    97         assert isinstance(account, Account)
    97         assert isinstance(account, Account) and lisdir(account.home)
    98         is_dir(account.home)
       
    99         self._user = account
    98         self._user = account
   100         self._boxes = []
    99         self._boxes = []
   101         self._root = self._user.mail_location.directory
   100         self._root = self._user.mail_location.directory
   102         self._sep = '/'
   101         self._sep = '/'
   103         os.chdir(self._user.home)
   102         os.chdir(self._user.home)