Changeset 2132
- Timestamp:
- 03/06/07 13:27:29 (2 years ago)
- Files:
-
- pyreadline/branches/refactor/doc/ChangeLog (modified) (1 diff)
- pyreadline/branches/refactor/pyreadline/clipboard/__init__.py (modified) (2 diffs)
- pyreadline/branches/refactor/pyreadline/clipboard/win32_clipboard.py (moved) (moved from pyreadline/branches/refactor/pyreadline/clipboard/clipboard.py) (1 diff)
- pyreadline/branches/refactor/pyreadline/configuration/pyreadlineconfig.ini (modified) (2 diffs)
- pyreadline/branches/refactor/pyreadline/console/__init__.py (modified) (1 diff)
- pyreadline/branches/refactor/pyreadline/keysyms/__init__.py (modified) (2 diffs)
- pyreadline/branches/refactor/pyreadline/modes/basemode.py (modified) (2 diffs)
- pyreadline/branches/refactor/pyreadline/modes/emacs.py (modified) (2 diffs)
- pyreadline/branches/refactor/pyreadline/rlmain.py (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
pyreadline/branches/refactor/doc/ChangeLog
r1899 r2132 1 2007-03-06 Jörgen Stenarson <jorgen.stenarson -at- bostream.nu> 2 * Changed tests for ironpython 3 * Added possibility to bind ctrl-c to a function 4 * Refactor clipboard handling 5 * Restructured example config file 6 1 7 2006-11-15 Jörgen Stenarson <jorgen.stenarson -at- bostream.nu> 2 8 * moved ironpython specifics from emacs.py->readline to a hook_wrapper pyreadline/branches/refactor/pyreadline/clipboard/__init__.py
r1877 r2132 1 1 import sys 2 2 success=False 3 in_ironpython=sys.version.startswith("IronPython") 4 3 in_ironpython="IronPython" in sys.version 5 4 if in_ironpython: 6 5 try: … … 11 10 else: 12 11 try: 13 from clipboard import GetClipboardText,SetClipboardText12 from win32_clipboard import GetClipboardText,SetClipboardText 14 13 success=True 15 14 except ImportError: 16 pass15 raise 17 16 18 19 20 21 17 22 18 def send_data(lists): pyreadline/branches/refactor/pyreadline/clipboard/win32_clipboard.py
r1419 r2132 14 14 # 15 15 # 16 17 16 18 17 ################################################################################### pyreadline/branches/refactor/pyreadline/configuration/pyreadlineconfig.ini
r1898 r2132 4 4 bind_exit_key("Control-z") 5 5 6 #Commands for moving 7 bind_key("Home", "beginning_of_line")8 bind_key("End", "end_of_line")9 bind_key("Left", "backward_char")10 bind_key("Control-b", "backward_char")11 bind_key("Right", "forward_char")12 bind_key("Control-f", "forward_char")13 bind_key("Alt-f", "forward_word")14 bind_key("Alt-b", "backward_word")15 bind_key("Clear", "clear_screen")16 bind_key("Control-l", "clear_screen")17 bind_key("Control-a", "beginning_of_line")18 bind_key("Control-e", "end_of_line")19 #bind_key("Control-l", "redraw_current_line")6 #Commands for moving 7 bind_key("Home", "beginning_of_line") 8 bind_key("End", "end_of_line") 9 bind_key("Left", "backward_char") 10 bind_key("Control-b", "backward_char") 11 bind_key("Right", "forward_char") 12 bind_key("Control-f", "forward_char") 13 bind_key("Alt-f", "forward_word") 14 bind_key("Alt-b", "backward_word") 15 bind_key("Clear", "clear_screen") 16 bind_key("Control-l", "clear_screen") 17 bind_key("Control-a", "beginning_of_line") 18 bind_key("Control-e", "end_of_line") 19 #bind_key("Control-l", "redraw_current_line") 20 20 21 21 #Commands for Manipulating the History 22 bind_key("Return", "accept_line") 23 bind_key("Control-p", "previous_history") 24 bind_key("Control-n", "next_history") 25 bind_key("Up", "history_search_backward") 26 bind_key("Down", "history_search_forward") 27 bind_key("Alt-<", "beginning_of_history") 28 bind_key("Alt->", "end_of_history") 29 bind_key("Control-r", "reverse_search_history") 30 bind_key("Control-s", "forward_search_history") 31 bind_key("Alt-p", "non_incremental_reverse_search_history") 32 bind_key("Alt-n", "non_incremental_forward_search_history") 22 bind_key("Return", "accept_line") 23 bind_key("Control-p", "previous_history") 24 bind_key("Control-n", "next_history") 25 bind_key("Up", "history_search_backward") 26 bind_key("Down", "history_search_forward") 27 bind_key("Alt-<", "beginning_of_history") 28 bind_key("Alt->", "end_of_history") 29 bind_key("Control-r", "reverse_search_history") 30 bind_key("Control-s", "forward_search_history") 31 bind_key("Alt-p", "non_incremental_reverse_search_history") 32 bind_key("Alt-n", "non_incremental_forward_search_history") 33 34 bind_key("Control-z", "undo") 35 bind_key("Control-_", "undo") 33 36 34 37 #Commands for Changing Text 35 bind_key("Delete", "delete_char") 36 bind_key("Control-d", "delete_char") 37 bind_key("BackSpace", "backward_delete_char") 38 #bind_key("Control-Shift-v", "quoted_insert") 39 bind_key("Control-space", "self_insert") 38 bind_key("Delete", "delete_char") 39 bind_key("Control-d", "delete_char") 40 bind_key("BackSpace", "backward_delete_char") 41 #bind_key("Control-Shift-v", "quoted_insert") 42 bind_key("Control-space", "self_insert") 43 bind_key("Control-BackSpace", "backward_delete_word") 40 44 41 45 #Killing and Yanking 42 bind_key("Control-k", "kill_line")43 bind_key("Control-shift-k", "kill_whole_line")44 bind_key("Escape", "kill_whole_line")45 bind_key("Meta-d", "kill_word")46 bind_key("Control-w", "unix_word_rubout")47 bind_key("Meta-Delete", "backward_kill_word")46 bind_key("Control-k", "kill_line") 47 bind_key("Control-shift-k", "kill_whole_line") 48 bind_key("Escape", "kill_whole_line") 49 bind_key("Meta-d", "kill_word") 50 bind_key("Control-w", "unix_word_rubout") 51 bind_key("Meta-Delete", "backward_kill_word") 48 52 49 53 #Copy paste 50 bind_key("Control-m", "set_mark") 51 bind_key("Control-q", "copy_region_to_clipboard") 52 bind_key("Control-v", "paste") 53 bind_key("Alt-v", "ipython_paste") 54 bind_key("Control-y", "paste") 55 bind_key("Control-z", "undo") 56 bind_key("Control-_", "undo") 57 bind_key('Control-Shift-v', "paste_mulitline_code") 54 bind_key("Shift-Right", "forward_char_extend_selection") 55 bind_key("Shift-Left", "backward_char_extend_selection") 56 bind_key("Shift-Control-Right", "forward_word_extend_selection") 57 bind_key("Shift-Control-Left", "backward_word_extend_selection") 58 bind_key("Control-m", "set_mark") 59 60 bind_key("Control-Shift-x", "copy_selection_to_clipboard") 61 #bind_key("Control-c", "copy_selection_to_clipboard") #Needs allow_ctrl_c(True) below to be uncommented 62 bind_key("Control-q", "copy_region_to_clipboard") 63 bind_key('Control-Shift-v', "paste_mulitline_code") 64 bind_key("Control-x", "cut_selection_to_clipboard") 65 66 bind_key("Control-v", "paste") 67 bind_key("Control-y", "paste") 68 bind_key("Alt-v", "ipython_paste") 58 69 59 70 #Unbinding keys: 60 71 #un_bind_key("Home") 61 62 63 #new keybindings64 bind_key("Shift-Right", "forward_char_extend_selection")65 bind_key("Shift-Left", "backward_char_extend_selection")66 bind_key("Shift-Control-Right", "forward_word_extend_selection")67 bind_key("Shift-Control-Left", "backward_word_extend_selection")68 bind_key("Control-BackSpace", "backward_delete_word")69 bind_key("Control-x", "cut_selection_to_clipboard")70 bind_key("Control-Shift-x", "copy_selection_to_clipboard")71 72 72 73 73 #Other … … 77 77 completer_delims(" \t\n\"\\'`@$><=;|&{(?") 78 78 debug_output("off") 79 #allow_ctrl_c(True) #(Allows use of ctrl-c as copy key, still propagate keyboardinterrupt when not waiting for input) 79 80 80 81 history_filename("~/.pythonhistory") pyreadline/branches/refactor/pyreadline/console/__init__.py
r1877 r2132 2 2 3 3 success=False 4 in_ironpython= sys.version.startswith("IronPython")4 in_ironpython="IronPython" in sys.version 5 5 6 6 if in_ironpython: pyreadline/branches/refactor/pyreadline/keysyms/__init__.py
r1895 r2132 2 2 3 3 success=False 4 in_ironpython= sys.version.startswith("IronPython")4 in_ironpython="IronPython" in sys.version 5 5 6 6 if in_ironpython: … … 9 9 success=True 10 10 except ImportError,x: 11 pass11 raise 12 12 else: 13 13 try: pyreadline/branches/refactor/pyreadline/modes/basemode.py
r1895 r2132 15 15 import pyreadline.clipboard as clipboard 16 16 from pyreadline.error import ReadlineError,GetSetError 17 in_ironpython= sys.version.startswith("IronPython")17 in_ironpython="IronPython" in sys.version 18 18 19 19 class BaseMode(object): … … 49 49 argument_reset=property(_argreset) 50 50 51 allow_ctrl_c=property(*_gs("allow_ctrl_c")) 51 52 l_buffer=property(*_gs("l_buffer")) 52 53 next_meta=property(*_gs("next_meta")) pyreadline/branches/refactor/pyreadline/modes/emacs.py
r1899 r2132 22 22 23 23 return "(%s,%s,%s,%s,%x)"%k 24 in_ironpython= sys.version.startswith("IronPython")24 in_ironpython="IronPython" in sys.version 25 25 26 26 … … 45 45 while 1: 46 46 self._update_line() 47 event = c.getkeypress() 47 try: 48 event = c.getkeypress() 49 except KeyboardInterrupt: 50 from pyreadline.keysyms.common import KeyPress 51 from pyreadline.console.event import Event 52 event=Event(0,0) 53 event.char="c" 54 event.keyinfo=KeyPress("c",shift=False,control=True,meta=False,keyname=None) 55 log_sock("KBDIRQ") 56 if self.allow_ctrl_c: 57 pass 58 else: 59 raise 48 60 if self.next_meta: 49 61 self.next_meta = False pyreadline/branches/refactor/pyreadline/rlmain.py
r1895 r2132 22 22 from modes import editingmodes 23 23 24 in_ironpython= sys.version.startswith("IronPython")24 in_ironpython="IronPython" in sys.version 25 25 if in_ironpython:#ironpython does not provide a prompt string to readline 26 26 import System … … 55 55 self.next_meta = False # True to force meta on next character 56 56 self.tabstop = 4 57 self.allow_ctrl_c=False 57 58 58 59 self.begidx = 0 … … 86 87 87 88 self.paste_line_buffer=[] 88 89 89 90 90 #Below is for refactoring, raise errors when using old style attributes … … 354 354 def sethistorylength(length): 355 355 self._history.history_length=int(length) 356 356 def allow_ctrl_c(mode): 357 log_sock("allow_ctrl_c:%s:%s"%(self.allow_ctrl_c,mode)) 358 self.allow_ctrl_c=mode 357 359 def setbellstyle(mode): 358 360 self.bell_style=mode … … 394 396 "set_prompt_color":set_prompt_color, 395 397 "set_input_color":set_input_color, 398 "allow_ctrl_c":allow_ctrl_c, 396 399 } 397 400 if os.path.isfile(inputrcpath):
