1 |
joko |
1.3 |
import os |
2 |
|
|
|
3 |
xabbu |
1.1 |
import fraggleParserXML |
4 |
joko |
1.3 |
from fraggleEngine import * |
5 |
xabbu |
1.1 |
|
6 |
xabbu |
1.2 |
def create(parent): |
7 |
|
|
return fraggleCtlPreferences(parent) |
8 |
|
|
|
9 |
xabbu |
1.1 |
class fraggleCtlPreferences: |
10 |
|
|
|
11 |
xabbu |
1.2 |
def __init_fraggle_xml__(self): |
12 |
|
|
self.fraggleXML = fraggleParserXML.create(self) |
13 |
xabbu |
1.1 |
|
14 |
|
|
|
15 |
xabbu |
1.4 |
|
16 |
|
|
|
17 |
xabbu |
1.1 |
def __init__(self,parent): |
18 |
|
|
self.__init_fraggle_xml__() |
19 |
|
|
|
20 |
|
|
|
21 |
|
|
#def savePrefs(): |
22 |
|
|
|
23 |
|
|
|
24 |
xabbu |
1.2 |
def setConfig(self,username,password,url,retrieval): |
25 |
|
|
self.configList = {'username': username,'password': password,'url': url,'retrieval': retrieval} |
26 |
|
|
|
27 |
|
|
def getConfig(self): |
28 |
|
|
return self.configList |
29 |
|
|
|
30 |
xabbu |
1.4 |
|
31 |
|
|
def loadConfig(self,inputLocation): |
32 |
|
|
self.configList = self.fraggleXML.unmarshalXML(inputLocation) |
33 |
|
|
|
34 |
|
|
|
35 |
xabbu |
1.2 |
def saveConfig(self): |
36 |
joko |
1.3 |
engine = FraggleEngine() |
37 |
|
|
prefsfile = os.path.join(engine.getDefaultDir(), 'prefs.xml') |
38 |
|
|
self.fraggleXML.marshalXML(self.configList, prefsfile) |
39 |
|
|
|
40 |
xabbu |
1.4 |
|