[Python-checkins] python/dist/src/Lib/idlelib ColorDelegator.py, 1.13, 1.14 NEWS.txt, 1.31, 1.32

kbk at users.sourceforge.net kbk at users.sourceforge.net
Sun Mar 14 23:26:55 EST 2004


Update of /cvsroot/python/python/dist/src/Lib/idlelib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6358
Modified Files:
	ColorDelegator.py NEWS.txt 
Log Message:
1. Bug in Patch 805830 fixed by Nigel Rowe
2. Convert 1/0 to True/False
3. Fix a couple of long lines
M ColorDelegator.py
M NEWS.txt
Index: ColorDelegator.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/idlelib/ColorDelegator.py,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** ColorDelegator.py	8 Mar 2004 18:15:30 -0000	1.13
--- ColorDelegator.py	15 Mar 2004 04:26:37 -0000	1.14
***************
*** 7,16 ****
 from configHandler import idleConf
 
! #$ event <<toggle-auto-coloring>>
! #$ win <Control-slash>
! #$ unix <Control-slash>
! 
! DEBUG = 0
! 
 
 def any(name, list):
--- 7,11 ----
 from configHandler import idleConf
 
! DEBUG = False
 
 def any(name, list):
***************
*** 21,25 ****
 builtinlist = [str(name) for name in dir(__builtin__)
 if not name.startswith('_')]
! builtin = r"([^\\.]\b|^)" + any("BUILTIN", builtinlist) + r"\b"
 comment = any("COMMENT", [r"#[^\n]*"])
 sqstring = r"(\b[rR])?'[^'\\\n]*(\\.[^'\\\n]*)*'?"
--- 16,22 ----
 builtinlist = [str(name) for name in dir(__builtin__)
 if not name.startswith('_')]
! # self.file = file("file") :
! # 1st 'file' colorized normal, 2nd as builtin, 3rd as comment
! builtin = r"([^.'\"\\]\b|^)" + any("BUILTIN", builtinlist) + r"\b"
 comment = any("COMMENT", [r"#[^\n]*"])
 sqstring = r"(\b[rR])?'[^'\\\n]*(\\.[^'\\\n]*)*'?"
***************
*** 28,32 ****
 dq3string = r'(\b[rR])?"""[^"\\]*((\\.|"(?!""))[^"\\]*)*(""")?'
 string = any("STRING", [sq3string, dq3string, sqstring, dqstring])
! return kw + "|" + builtin + "|" + comment + "|" + string + "|" + any("SYNC", [r"\n"])
 
 prog = re.compile(make_pat(), re.S)
--- 25,30 ----
 dq3string = r'(\b[rR])?"""[^"\\]*((\\.|"(?!""))[^"\\]*)*(""")?'
 string = any("STRING", [sq3string, dq3string, sqstring, dqstring])
! return kw + "|" + builtin + "|" + comment + "|" + string +\
! "|" + any("SYNC", [r"\n"])
 
 prog = re.compile(make_pat(), re.S)
***************
*** 87,92 ****
 
 after_id = None
! allow_colorizing = 1
! colorizing = 0
 
 def notify_range(self, index1, index2=None):
--- 85,90 ----
 
 after_id = None
! allow_colorizing = True
! colorizing = False
 
 def notify_range(self, index1, index2=None):
***************
*** 96,100 ****
 return
 if self.colorizing:
! self.stop_colorizing = 1
 if DEBUG: print "stop colorizing"
 if self.allow_colorizing:
--- 94,98 ----
 return
 if self.colorizing:
! self.stop_colorizing = True
 if DEBUG: print "stop colorizing"
 if self.allow_colorizing:
***************
*** 110,115 ****
 if DEBUG: print "cancel scheduled recolorizer"
 self.after_cancel(after_id)
! self.allow_colorizing = 0
! self.stop_colorizing = 1
 if close_when_done:
 if not self.colorizing:
--- 108,113 ----
 if DEBUG: print "cancel scheduled recolorizer"
 self.after_cancel(after_id)
! self.allow_colorizing = False
! self.stop_colorizing = True
 if close_when_done:
 if not self.colorizing:
***************
*** 126,135 ****
 if self.allow_colorizing and self.colorizing:
 if DEBUG: print "stop colorizing"
! self.stop_colorizing = 1
 self.allow_colorizing = not self.allow_colorizing
 if self.allow_colorizing and not self.colorizing:
 self.after_id = self.after(1, self.recolorize)
 if DEBUG:
! print "auto colorizing turned", self.allow_colorizing and "on" or "off"
 return "break"
 
--- 124,134 ----
 if self.allow_colorizing and self.colorizing:
 if DEBUG: print "stop colorizing"
! self.stop_colorizing = True
 self.allow_colorizing = not self.allow_colorizing
 if self.allow_colorizing and not self.colorizing:
 self.after_id = self.after(1, self.recolorize)
 if DEBUG:
! print "auto colorizing turned",\
! self.allow_colorizing and "on" or "off"
 return "break"
 
***************
*** 146,151 ****
 return
 try:
! self.stop_colorizing = 0
! self.colorizing = 1
 if DEBUG: print "colorizing..."
 t0 = time.clock()
--- 145,150 ----
 return
 try:
! self.stop_colorizing = False
! self.colorizing = True
 if DEBUG: print "colorizing..."
 t0 = time.clock()
***************
*** 154,158 ****
 if DEBUG: print "%.3f seconds" % (t1-t0)
 finally:
! self.colorizing = 0
 if self.allow_colorizing and self.tag_nextrange("TODO", "1.0"):
 if DEBUG: print "reschedule colorizing"
--- 153,157 ----
 if DEBUG: print "%.3f seconds" % (t1-t0)
 finally:
! self.colorizing = False
 if self.allow_colorizing and self.tag_nextrange("TODO", "1.0"):
 if DEBUG: print "reschedule colorizing"
***************
*** 165,169 ****
 def recolorize_main(self):
 next = "1.0"
! while 1:
 item = self.tag_nextrange("TODO", next)
 if not item:
--- 164,168 ----
 def recolorize_main(self):
 next = "1.0"
! while True:
 item = self.tag_nextrange("TODO", next)
 if not item:
***************
*** 180,184 ****
 next = head
 lines_to_get = 1
! ok = 0
 while not ok:
 mark = next
--- 179,183 ----
 next = head
 lines_to_get = 1
! ok = False
 while not ok:
 mark = next
***************
*** 212,216 ****
 # color all the "as" words on same line;
 # cheap approximation to the truth
! while 1:
 m1 = self.asprog.match(chars, b)
 if not m1:
--- 211,215 ----
 # color all the "as" words on same line;
 # cheap approximation to the truth
! while True:
 m1 = self.asprog.match(chars, b)
 if not m1:
***************
*** 225,229 ****
 chars = ""
 else:
! ok = 0
 if not ok:
 # We're in an inconsistent state, and the call to
--- 224,228 ----
 chars = ""
 else:
! ok = False
 if not ok:
 # We're in an inconsistent state, and the call to
Index: NEWS.txt
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/idlelib/NEWS.txt,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -d -r1.31 -r1.32
*** NEWS.txt	8 Mar 2004 18:15:30 -0000	1.31
--- NEWS.txt	15 Mar 2004 04:26:37 -0000	1.32
***************
*** 4,8 ****
--- 4,13 ----
 *Release date: XX-XXX-2004*
 
+ - If the normal background is changed via Configure/Highlighting, it will update 
+ immediately, thanks to the previously mentioned patch.
+ 
 - Add a highlight theme for builtin keywords. Python Patch 805830 Nigel Rowe
+ This also fixed IDLEfork bug [ 693418 ] Normal text background color not refreshed
+ and Python bug [897872 ] Unknown color name on HP-UX
 
 - rpc.py:SocketIO - Large modules were generating large pickles when downloaded


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /