/[ascend]/trunk/pygtk/interface/preferences.py
ViewVC logotype

Diff of /trunk/pygtk/interface/preferences.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 190 by johnpye, Mon Jan 16 08:53:30 2006 UTC revision 294 by johnpye, Thu Feb 16 02:53:56 2006 UTC
# Line 75  class Preferences: Line 75  class Preferences:
75          self.ini.set("PreferredUnits",key,val)          self.ini.set("PreferredUnits",key,val)
76          #print "SET PREFERRED UNITS FOR %s TO %s" % ( key, val )          #print "SET PREFERRED UNITS FOR %s TO %s" % ( key, val )
77    
78        def getBoolPref(self,sect,key):
79            try:
80                _u = self.ini.get(sect,key)
81            except ConfigParser.NoSectionError:
82                return None
83            except ConfigParser.NoOptionError:
84                return None
85            if _u:
86                return True
87            return False
88    
89        def setBoolPref(self,sect,key,val):
90            if not self.ini.has_section(sect):
91                self.ini.add_section(sect)
92            if val:
93                val = "1"
94            else:
95                val = ""
96            self.ini.set(sect,key,val)
97    
98  # Test script:  # Test script:
99  def main():  def main():
100      x = Preferences();      x = Preferences();

Legend:
Removed from v.190  
changed lines
  Added in v.294

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22