def __init__(self, parent, numShown=5, debug=None): self.parent = parent self.numShown = int(numShown) self.debug = debug self.filename = getHomeDirectory() + os.sep + ".kodos" + os.sep + "recent_files" self.__recent_files = [] self.__indecies = [] self.load()
def getRecentContexts(self): """return the last active context""" contexts = self.getValue(Preferences.RECENTCONTEXTS, [util.getHomeDirectory()]) cxts = [] for context in contexts: ncontext = util.normalizePath(context) if not ncontext in cxts: cxts.append(ncontext) return cxts
def loadDefaultPreferences(self): self.setRecentContext(util.getHomeDirectory())
def getPreferenceFilename(self): """return the full path to the global preference file""" f = os.path.join(util.getHomeDirectory(), Preferences.PREFERENCEFILE) return f