Added reset profile function, preperation for "simple" mode
This commit is contained in:
parent
25be736935
commit
77b16b5ccf
1 changed files with 7 additions and 1 deletions
|
@ -69,14 +69,20 @@ def getDefaultProfilePath():
|
||||||
return os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(__file__)), "../current_profile.ini"))
|
return os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(__file__)), "../current_profile.ini"))
|
||||||
|
|
||||||
def loadGlobalProfile(filename):
|
def loadGlobalProfile(filename):
|
||||||
"Read a configuration file as global config"
|
#Read a configuration file as global config
|
||||||
global globalProfileParser
|
global globalProfileParser
|
||||||
globalProfileParser = ConfigParser.ConfigParser()
|
globalProfileParser = ConfigParser.ConfigParser()
|
||||||
globalProfileParser.read(filename)
|
globalProfileParser.read(filename)
|
||||||
|
|
||||||
def saveGlobalProfile(filename):
|
def saveGlobalProfile(filename):
|
||||||
|
#Save the current profile to an ini file
|
||||||
globalProfileParser.write(open(filename, 'w'))
|
globalProfileParser.write(open(filename, 'w'))
|
||||||
|
|
||||||
|
def resetGlobalProfile():
|
||||||
|
#Create an empty profile with no settings, so everything gets default settings.
|
||||||
|
global globalProfileParser
|
||||||
|
globalProfileParser = ConfigParser.ConfigParser()
|
||||||
|
|
||||||
def getProfileSetting(name):
|
def getProfileSetting(name):
|
||||||
if name in profileDefaultSettings:
|
if name in profileDefaultSettings:
|
||||||
default = profileDefaultSettings[name]
|
default = profileDefaultSettings[name]
|
||||||
|
|
Loading…
Reference in a new issue