[pyrepl-checkins] r5435 - in pyrepl: branch/pyrepl-rework-n branch/pyrepl-rework-n/pyrepl trunk/pyrepl trunk/pyrepl/pyrepl

mwh at codespeak.net mwh at codespeak.net
Mon Jul 5 15:48:23 MEST 2004


Author: mwh
Date: Mon Jul  5 15:48:22 2004
New Revision: 5435

Added:
   pyrepl/branch/pyrepl-rework-n/
      - copied from r5020, pyrepl/trunk/pyrepl/
Modified:
   pyrepl/branch/pyrepl-rework-n/README
   pyrepl/branch/pyrepl-rework-n/pyrepl/keymap.py
   pyrepl/branch/pyrepl-rework-n/pyrepl/unix_console.py
   pyrepl/trunk/pyrepl/README
   pyrepl/trunk/pyrepl/pyrepl/unix_console.py
Log:
create a branch for the n'th reworking of pyrepl's fundamental
internals.


Modified: pyrepl/branch/pyrepl-rework-n/README
==============================================================================
--- pyrepl/trunk/pyrepl/README	(original)
+++ pyrepl/branch/pyrepl-rework-n/README	Mon Jul  5 15:48:22 2004
@@ -86,7 +86,7 @@
  + Changes to the init file handling.
  + Sundry code reorganization.  Libraries built on top of pyrepl will
    probably require small modifications (but I'm not sure anyone has
-   written  any of these yet!).
+   written any of these yet!).
  + A prototypical pygame console.
            -- see CHANGES for more details and older news
 

Modified: pyrepl/branch/pyrepl-rework-n/pyrepl/keymap.py
==============================================================================
--- pyrepl/trunk/pyrepl/pyrepl/keymap.py	(original)
+++ pyrepl/branch/pyrepl-rework-n/pyrepl/keymap.py	Mon Jul  5 15:48:22 2004
@@ -68,34 +68,10 @@
     'v':'\v'
     }
 
-_keynames = {
-    'backspace': 'backspace',
-    'delete':    'delete',
-    'down':      'down',
-    'end':       'end',
-    'enter':     '\r',
-    'escape':    '\033',
-    'f1' : 'f1',   'f2' : 'f2',   'f3' : 'f3',   'f4' : 'f4',
-    'f5' : 'f5',   'f6' : 'f6',   'f7' : 'f7',   'f8' : 'f8',
-    'f9' : 'f9',   'f10': 'f10',  'f11': 'f11',  'f12': 'f12',
-    'f13': 'f13',  'f14': 'f14',  'f15': 'f15',  'f16': 'f16',
-    'f17': 'f17',  'f18': 'f18',  'f19': 'f19',  'f20': 'f20',
-    'home':      'home',
-    'insert':    'insert',
-    'left':      'left',
-    'page down': 'page down',
-    'page up':   'page up',
-    'return':    '\r',
-    'right':     'right',
-    'space':     ' ',
-    'tab':       '\t',
-    'up':        'up',
-    }
-
 class KeySpecError(Exception):
     pass
 
-def _parse_key1(key, s):
+def _parse_key1(key, keys, s):
     ctrl = 0
     meta = 0
     ret = ''
@@ -140,11 +116,11 @@
                               "unterminated \\< starting at char %d of %s"%(
                         s + 1, repr(key))                        
                 ret = key[s+2:t].lower()
-                if ret not in _keynames:
+                if ret not in keys.keynames():
                     raise KeySpecError, \
                               "unrecognised keyname `%s' at char %d of %s"%(
                         ret, s + 2, repr(key))
-                ret = _keynames[ret]
+                #ret = _keynames[ret]
                 s = t + 1
             else:
                 raise KeySpecError, \
@@ -163,11 +139,11 @@
         ret = [ret]
     return ret, s
 
-def parse_keys(key):
+def parse_keys(key, keys):
     s = 0
     r = []
     while s < len(key):
-        k, s = _parse_key1(key, s)
+        k, s = _parse_key1(key, keys, s)
         r.extend(k)
     return r
 

Modified: pyrepl/branch/pyrepl-rework-n/pyrepl/unix_console.py
==============================================================================
--- pyrepl/trunk/pyrepl/pyrepl/unix_console.py	(original)
+++ pyrepl/branch/pyrepl-rework-n/pyrepl/unix_console.py	Mon Jul  5 15:48:22 2004
@@ -81,10 +81,8 @@
             self.input_fd = f_in.fileno()
 
         if isinstance(f_out, int):
-            self.output = os.fdopen(f_out)
             self.output_fd = f_out
         else:
-            self.output = f_out
             self.output_fd = f_out.fileno()
         
         self.pollob = poll()

Modified: pyrepl/trunk/pyrepl/README
==============================================================================
--- pyrepl/trunk/pyrepl/README	(original)
+++ pyrepl/trunk/pyrepl/README	Mon Jul  5 15:48:22 2004
@@ -86,7 +86,7 @@
  + Changes to the init file handling.
  + Sundry code reorganization.  Libraries built on top of pyrepl will
    probably require small modifications (but I'm not sure anyone has
-   written  any of these yet!).
+   written any of these yet!).
  + A prototypical pygame console.
            -- see CHANGES for more details and older news
 

Modified: pyrepl/trunk/pyrepl/pyrepl/unix_console.py
==============================================================================
--- pyrepl/trunk/pyrepl/pyrepl/unix_console.py	(original)
+++ pyrepl/trunk/pyrepl/pyrepl/unix_console.py	Mon Jul  5 15:48:22 2004
@@ -81,10 +81,8 @@
             self.input_fd = f_in.fileno()
 
         if isinstance(f_out, int):
-            self.output = os.fdopen(f_out)
             self.output_fd = f_out
         else:
-            self.output = f_out
             self.output_fd = f_out.fileno()
         
         self.pollob = poll()


More information about the pyrepl-checkins mailing list