diff options
Diffstat (limited to 'purgeObsolete.py')
-rwxr-xr-x | purgeObsolete.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/purgeObsolete.py b/purgeObsolete.py index 4491eec..48173ec 100755 --- a/purgeObsolete.py +++ b/purgeObsolete.py @@ -19,10 +19,10 @@ debug=False class SimpleDate(GregorianCalendar): def __init__(self): pass - + def getDate(): return self.getTime() - + def decrease(self,howMuch,unit="m"): pass @@ -42,7 +42,7 @@ class ArchivedFolder(object): def __init__(self,store,name): self.folder = store.store.getDefaultFolder().getFolder(name) self.folder.open(Folder.READ_WRITE) - + def purgeOld(self,dateLimit): toBeDeleted = [] for msg in self.folder.getMessages(): @@ -59,7 +59,7 @@ class ArchivedStore(object): >>> len(folderList)>0 1 >>> myStore.store.close() - + and >>> myStore = ArchivedStore(paramServer="zimbra") >>> folder = ArchivedFolder(myStore,"INBOX/bugzilla/xgl") @@ -81,7 +81,7 @@ class ArchivedStore(object): print >> sys.stderr, "Cannot get Store" raise - conffile = os.path.expanduser("~/.bugzillarc") + conffile = os.path.expanduser("~/.bugzillarc") if paramServer: config = ConfigParser.ConfigParser() config.read([conffile]) @@ -109,7 +109,7 @@ class ArchivedStore(object): (host,user,password) self.__login(host,user,password) - + def __login(self,server,user,password): try: self.store.connect(server,user,password) @@ -138,12 +138,12 @@ def main(): myStore = ArchivedStore(paramServer="zimbra") folder = ArchivedFolder(myStore,"INBOX/bugzilla/xgl") - + unreadTerm = FlagTerm(Flags(Flags.Flag.SEEN),True) dateTerm = ReceivedDateTerm(ComparisonTerm.LT,JD3MAgo) searchTerm = AndTerm(unreadTerm,dateTerm) msgsFound = folder.folder.search(searchTerm) - + print len(msgsFound) myStore.store.close() |