Changeset 1382
- Timestamp:
- 06/27/06 15:20:12 (2 years ago)
- Files:
-
- pyreadline/trunk/doc/ChangeLog (modified) (1 diff)
- pyreadline/trunk/pyreadline/configuration/pyreadlineconfig.ini (modified) (1 diff)
- pyreadline/trunk/pyreadline/console.py (modified) (2 diffs)
- pyreadline/trunk/pyreadline/rlmain.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
pyreadline/trunk/doc/ChangeLog
r1379 r1382 1 2006-06-27 Jörgen Stenarson <jorgen.stenarson -at- bostream.nu> 2 * Changes from yesterday were not correct. Resulted in invisible docstrings 3 when using ? in ipython. 4 * ANSI sequence Esc[0m in write_color will now result in a white color with no 5 attributes (same as in cygwin). But the color of input text is controlled 6 set_input_color in config file with default same as dos-color was when 7 launching python. set_prompt_color controls prompt and raw_input text 8 and also defaults to same as dos-color was when launching python. 9 Unfortunately I have not found a way to control color of text that is printed 10 with a print statement. 11 1 12 2006-06-26 Jörgen Stenarson <jorgen.stenarson -at- bostream.nu> 2 13 * Changes to ansi handling to preserve initial consoles color pyreadline/trunk/pyreadline/configuration/pyreadlineconfig.ini
r1292 r1382 70 70 history_filename("~/.pythonhistory") 71 71 history_length(200) #value of -1 means no limit 72 73 #set_input_color("yellow") #set color of input text 74 #set_prompt_color("red") #set color of prompt and raw_input text pyreadline/trunk/pyreadline/console.py
r1379 r1382 196 196 self.inputHookPtr = c_int.from_address(addressof(self.pythondll.PyOS_InputHook)).value 197 197 setattr(Console, 'PyMem_Malloc', self.pythondll.PyMem_Malloc) 198 def exit(): 199 self.SetConsoleTextAttribute(self.hout, self.saveattr) 200 self.SetConsoleMode(self.hin, self.inmode) 201 self.FreeConsole() 202 import atexit 203 atexit.register(exit) 204 198 205 199 206 def __del__(self): … … 313 320 if m: 314 321 for part in m.group(1).split(";"): 315 if part == "0": # No text attribute 316 attr = 0322 if part == "0": # No text attribute but white 323 attr = 7 317 324 elif part == "7": # switch on reverse 318 325 attr |= 0x4000 pyreadline/trunk/pyreadline/rlmain.py
r1292 r1382 51 51 self.console = console.Console() 52 52 self.size = self.console.size() 53 self.prompt_color = None54 self.command_color = None53 self.prompt_color = self.console.saveattr 54 self.command_color = self.console.saveattr 55 55 self.key_dispatch = {} 56 56 self.exit_dispatch = {} … … 1224 1224 logger.start_log(on,filename) 1225 1225 logger.log("STARTING LOG") 1226 def set_prompt_color(color): 1227 trtable={"black":0,"darkred":4,"darkgreen":2,"darkyellow":6,"darkblue":1,"darkmagenta":5,"darkcyan":3,"gray":7, 1228 "red":4+8,"green":2+8,"yellow":6+8,"blue":1+8,"magenta":5+8,"cyan":3+8,"white":7+8} 1229 self.prompt_color=trtable.get(color.lower(),7) 1230 1231 def set_input_color(color): 1232 trtable={"black":0,"darkred":4,"darkgreen":2,"darkyellow":6,"darkblue":1,"darkmagenta":5,"darkcyan":3,"gray":7, 1233 "red":4+8,"green":2+8,"yellow":6+8,"blue":1+8,"magenta":5+8,"cyan":3+8,"white":7+8} 1234 self.command_color=trtable.get(color.lower(),7) 1235 1236 1226 1237 loc={"branch":release.branch, 1227 1238 "bind_key":bind_key, … … 1235 1246 "debug_output":debug_output, 1236 1247 "history_filename":sethistoryfilename, 1237 "history_length":sethistorylength} 1248 "history_length":sethistorylength, 1249 "set_prompt_color":set_prompt_color, 1250 "set_input_color":set_input_color,} 1238 1251 if os.path.isfile(inputrcpath): 1239 1252 try:
