12 |
self.fraggleXML = fraggleParserXML.create(self) |
self.fraggleXML = fraggleParserXML.create(self) |
13 |
|
|
14 |
def __init__(self,parent): |
def __init__(self,parent): |
15 |
|
self.engine = parent |
16 |
|
self.configList = {} |
17 |
self.__init_fraggle_xml__() |
self.__init_fraggle_xml__() |
18 |
self.restoreProfiles() |
self.restoreProfiles() |
19 |
|
self.prefsfile = os.path.join(self.engine.getDefaultDir(), 'prefs.xml') |
20 |
|
|
21 |
#def savePrefs(): |
#def savePrefs(): |
22 |
|
|
23 |
|
|
25 |
self.configList = {'username': username,'password': password,'url': url,'retrieval': retrieval} |
self.configList = {'username': username,'password': password,'url': url,'retrieval': retrieval} |
26 |
|
|
27 |
def getConfig(self): |
def getConfig(self): |
28 |
|
if not self.configList: |
29 |
|
self.loadConfig(self.prefsfile) |
30 |
return self.configList |
return self.configList |
|
|
|
31 |
|
|
32 |
def loadConfig(self,inputLocation): |
def loadConfig(self,inputLocation): |
33 |
self.configList = self.fraggleXML.unmarshalXML(inputLocation) |
self.configList = self.fraggleXML.unmarshalXML(inputLocation) |
34 |
|
|
|
|
|
35 |
def saveConfig(self): |
def saveConfig(self): |
36 |
engine = FraggleEngine() |
#self.fraggleXML.marshalXML(self.profileDictionary, self.prefsfile) |
37 |
|
self.fraggleXML.marshalXML(self.configList, self.prefsfile) |
|
prefsfile = os.path.join(engine.getDefaultDir(), 'prefs.xml') |
|
|
#self.fraggleXML.marshalXML(self.profileDictionary, prefsfile) |
|
|
self.fraggleXML.marshalXML(self.configList, prefsfile) |
|
38 |
|
|
39 |
def saveProfiles(self): |
def saveProfiles(self): |
40 |
engine = FraggleEngine() |
profilesTemp = os.path.join(self.engine.getDefaultDir(), 'profiles.xml') |
|
profilesTemp = os.path.join(engine.getDefaultDir(), 'profiles.xml') |
|
41 |
self.fraggleXML.marshalXML(self.profileDictionary, profilesTemp) |
self.fraggleXML.marshalXML(self.profileDictionary, profilesTemp) |
42 |
#print self.profileDictionary |
#print self.profileDictionary |
43 |
|
|
44 |
def restoreProfiles(self): |
def restoreProfiles(self): |
45 |
engine = FraggleEngine() |
profiles = os.path.join(self.engine.getDefaultDir(), 'profiles.xml') |
|
profiles = os.path.join(engine.getDefaultDir(), 'profiles.xml') |
|
46 |
self.profileDictionary = self.fraggleXML.unmarshalXML(profiles) |
self.profileDictionary = self.fraggleXML.unmarshalXML(profiles) |
47 |
#print self.profileDictionary |
#print self.profileDictionary |
48 |
|
|
92 |
self.profileDictionary.pop(self.profileDictionary.index(profileId)) |
self.profileDictionary.pop(self.profileDictionary.index(profileId)) |
93 |
except IndexError: |
except IndexError: |
94 |
pass |
pass |
95 |
|
|
96 |
|
|
97 |
|
|