[pywin32-checkins] pywin32/Pythonwin/pywin/scintilla formatter.py, 1.12, 1.13
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Roger U. <ru...@us...> - 2008-02-25 07:46:10
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17377 Modified Files: formatter.py Log Message: Save default backgrounds as -1 Index: formatter.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/formatter.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** formatter.py 22 Feb 2008 01:22:59 -0000 1.12 --- formatter.py 25 Feb 2008 07:46:13 -0000 1.13 *************** *** 189,207 **** if style.aliased is None: self.SavePreference(style.name, str(style.format)) ! if style.background is not None: ! bg_name = style.name + " background" ! self.SavePreference(bg_name, style.background) # May be None def SavePreference(self, name, value): if value is None: ! hkey = win32ui.GetAppRegistryKey() ! try: ! subkey = win32api.RegOpenKey(hkey, "Format", 0, win32con.KEY_SET_VALUE) ! except win32api.error, (rc, fn, msg): ! if rc != winerror.ERROR_FILE_NOT_FOUND: ! raise ! subkey.Close() ! else: ! win32ui.WriteProfileVal("Format", name, value) # An abstract formatter --- 189,200 ---- if style.aliased is None: self.SavePreference(style.name, str(style.format)) ! bg_name = style.name + " background" ! self.SavePreference(bg_name, style.background) # May be None def SavePreference(self, name, value): + ## LoadPreference uses -1 to indicate default if value is None: ! value=-1 ! win32ui.WriteProfileVal("Format", name, value) # An abstract formatter |