chiark / gitweb /
Added reset profile function, preperation for "simple" mode
authordaid <daid303@gmail.com>
Wed, 21 Mar 2012 17:22:00 +0000 (18:22 +0100)
committerdaid <daid303@gmail.com>
Wed, 21 Mar 2012 17:22:00 +0000 (18:22 +0100)
SkeinPyPy/newui/profile.py

index 3c1ec2acdcce7986188e697f1c8dfd202ab30217..5a3e40363e3fc04d987cba780da2773c2d7522e8 100644 (file)
@@ -69,14 +69,20 @@ def getDefaultProfilePath():
        return os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(__file__)), "../current_profile.ini"))\r
 \r
 def loadGlobalProfile(filename):\r
-       "Read a configuration file as global config"\r
+       #Read a configuration file as global config\r
        global globalProfileParser\r
        globalProfileParser = ConfigParser.ConfigParser()\r
        globalProfileParser.read(filename)\r
 \r
 def saveGlobalProfile(filename):\r
+       #Save the current profile to an ini file\r
        globalProfileParser.write(open(filename, 'w'))\r
 \r
+def resetGlobalProfile():\r
+       #Create an empty profile with no settings, so everything gets default settings.\r
+       global globalProfileParser\r
+       globalProfileParser = ConfigParser.ConfigParser()\r
+\r
 def getProfileSetting(name):\r
        if name in profileDefaultSettings:\r
                default = profileDefaultSettings[name]\r