--- nfo/projects/netfraggle/bin/fraggleCtlPreferences.py 2004/08/29 22:52:40 1.5 +++ nfo/projects/netfraggle/bin/fraggleCtlPreferences.py 2004/09/01 21:43:30 1.7 @@ -12,9 +12,12 @@ self.fraggleXML = fraggleParserXML.create(self) def __init__(self,parent): + self.engine = parent + self.configList = {} self.__init_fraggle_xml__() self.restoreProfiles() - + self.prefsfile = os.path.join(self.engine.getDefaultDir(), 'prefs.xml') + #def savePrefs(): @@ -22,29 +25,24 @@ self.configList = {'username': username,'password': password,'url': url,'retrieval': retrieval} def getConfig(self): + if not self.configList: + self.loadConfig(self.prefsfile) return self.configList - def loadConfig(self,inputLocation): self.configList = self.fraggleXML.unmarshalXML(inputLocation) - def saveConfig(self): - engine = FraggleEngine() - - prefsfile = os.path.join(engine.getDefaultDir(), 'prefs.xml') - #self.fraggleXML.marshalXML(self.profileDictionary, prefsfile) - self.fraggleXML.marshalXML(self.configList, prefsfile) + #self.fraggleXML.marshalXML(self.profileDictionary, self.prefsfile) + self.fraggleXML.marshalXML(self.configList, self.prefsfile) def saveProfiles(self): - engine = FraggleEngine() - profilesTemp = os.path.join(engine.getDefaultDir(), 'profiles.xml') + profilesTemp = os.path.join(self.engine.getDefaultDir(), 'profiles.xml') self.fraggleXML.marshalXML(self.profileDictionary, profilesTemp) #print self.profileDictionary def restoreProfiles(self): - engine = FraggleEngine() - profiles = os.path.join(engine.getDefaultDir(), 'profiles.xml') + profiles = os.path.join(self.engine.getDefaultDir(), 'profiles.xml') self.profileDictionary = self.fraggleXML.unmarshalXML(profiles) #print self.profileDictionary @@ -94,4 +92,6 @@ self.profileDictionary.pop(self.profileDictionary.index(profileId)) except IndexError: pass + + \ No newline at end of file