MCPcopy
hub / github.com/OfflineIMAP/offlineimap / __init__

Method __init__

offlineimap/repository/Maildir.py:26–48  ·  view source on GitHub ↗

Initialize a MaildirRepository object. Takes a path name to the directory holding all the Maildir directories.

(self, reposname, account)

Source from the content-addressed store, hash-verified

24
25class MaildirRepository(BaseRepository):
26 def __init__(self, reposname, account):
27 """Initialize a MaildirRepository object. Takes a path name
28 to the directory holding all the Maildir directories."""
29
30 BaseRepository.__init__(self, reposname, account)
31
32 self.root = self.getlocalroot()
33 self.folders = None
34 self.ui = getglobalui()
35 self.debug("MaildirRepository initialized, sep is %s"% repr(self.getsep()))
36 self.folder_atimes = []
37
38 # Create the top-level folder if it doesn't exist
39 if not os.path.isdir(self.root):
40 os.makedirs(self.root, 0o700)
41
42 # Create the keyword->char mapping
43 self.keyword2char = dict()
44 for c in 'abcdefghijklmnopqrstuvwxyz':
45 confkey = 'customflag_' + c
46 keyword = self.getconf(confkey, None)
47 if keyword is not None:
48 self.keyword2char[keyword] = c
49
50 def _append_folder_atimes(self, foldername):
51 """Store the atimes of a folder's new|cur in self.folder_atimes"""

Callers

nothing calls this directly

Calls 5

getlocalrootMethod · 0.95
debugMethod · 0.95
getsepMethod · 0.95
getglobaluiFunction · 0.90
getconfMethod · 0.80

Tested by

no test coverage detected