Index: mhlib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/mhlib.py,v retrieving revision 1.34 diff -u -r1.34 mhlib.py --- mhlib.py 4 Jun 2002 02:17:04 -0000 1.34 +++ mhlib.py 13 Feb 2003 09:39:03 -0000 @@ -123,19 +123,22 @@ """Return the path (the name of the collection's directory).""" return self.path + def getcontextfile(self): + """Return the name of the context file.""" + fn = os.environ.get('MHCONTEXT', 'context') + if not os.path.isabs(fn): + fn = os.path.join(self.getpath(), fn) + return fn + def getcontext(self): """Return the name of the current folder.""" - context = pickline(os.path.join(self.getpath(), 'context'), - 'Current-Folder') + context = pickline(self.getcontextfile(), 'Current-Folder') if not context: context = 'inbox' return context def setcontext(self, context): """Set the name of the current folder.""" - fn = os.path.join(self.getpath(), 'context') - f = open(fn, "w") - f.write("Current-Folder: %s\n" % context) - f.close() + updateline(self.getcontextfile(), 'Current-Folder', context) def listfolders(self): """Return the names of the top-level folders."""