]>
code.delx.au - offlineimap/blob - offlineimap/head/offlineimap/repository/LocalStatus.py
1 # Local status cache repository support
2 # Copyright (C) 2002 John Goerzen
3 # <jgoerzen@complete.org>
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; version 2 of the License.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 from Base
import BaseRepository
19 from offlineimap
import folder
22 class LocalStatusRepository(BaseRepository
):
23 def __init__(self
, directory
, accountname
):
24 self
.directory
= directory
26 self
.accountname
= accountname
31 def getfolderfilename(self
, foldername
):
32 return os
.path
.join(self
.directory
, foldername
)
34 def makefolder(self
, foldername
):
36 file = open(self
.getfolderfilename(foldername
), "ab")
38 # Invalidate the cache.
43 for folder
in os
.listdir(self
.directory
):
44 retval
.append(folder
.LocalStatus
.LocalStatusFolder(self
.directory
,
45 folder
, self
, self
.accountname
))
48 def getfolder(self
, foldername
):
49 return folder
.LocalStatus
.LocalStatusFolder(self
.directory
, foldername
,
50 self
, self
.accountname
)