--- nfo/projects/netfraggle/bin/fraggleCtlPreferences.py 2004/08/25 13:53:48 1.1 +++ nfo/projects/netfraggle/bin/fraggleCtlPreferences.py 2004/08/25 21:43:53 1.4 @@ -1,9 +1,17 @@ +import os + import fraggleParserXML +from fraggleEngine import * +def create(parent): + return fraggleCtlPreferences(parent) + class fraggleCtlPreferences: - def __init_fraggle_xml__(): - self.fraggleXML = fraggleParserXML.create() + def __init_fraggle_xml__(self): + self.fraggleXML = fraggleParserXML.create(self) + + def __init__(self,parent): @@ -13,6 +21,20 @@ #def savePrefs(): - def setConfig(username,password,url,retrieval): - configList = [username,password,url,retrieval) - \ No newline at end of file + def setConfig(self,username,password,url,retrieval): + self.configList = {'username': username,'password': password,'url': url,'retrieval': retrieval} + + def getConfig(self): + 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.configList, prefsfile) + +