From b77d343bc846c2049a4cffb1dfd65eb49d1728b4 Mon Sep 17 00:00:00 2001 From: "Steven M. Gava" Date: Sat, 2 Mar 2002 07:16:21 +0000 Subject: First work on making config changes dynamic, dynamic theme changes --- Lib/idlelib/configHandler.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'Lib/idlelib/configHandler.py') diff --git a/Lib/idlelib/configHandler.py b/Lib/idlelib/configHandler.py index 9db712031f..82bf6d27ad 100644 --- a/Lib/idlelib/configHandler.py +++ b/Lib/idlelib/configHandler.py @@ -110,6 +110,13 @@ class IdleUserConfParser(IdleConfParser): self.set(section,option,value) return 1 + def RemoveFile(self): + """ + Removes the user config file from disk if it exists. + """ + if os.path.exists(self.file): + os.remove(self.file) + def Save(self): """ If config isn't empty, write file to disk. If config is empty, @@ -119,8 +126,7 @@ class IdleUserConfParser(IdleConfParser): cfgFile=open(self.file,'w') self.write(cfgFile) else: - if os.path.exists(self.file): - os.remove(self.file) + self.RemoveFile() class IdleConf: """ -- cgit v1.2.1