~certify-web-dev/twisted/certify-staging

« back to all changes in this revision

Viewing changes to twisted/manhole/ui/gtk2manhole.py

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2010-01-02 19:38:17 UTC
  • mfrom: (2.2.4 sid)
  • Revision ID: james.westby@ubuntu.com-20100102193817-jphp464ppwh7dulg
Tags: 9.0.0-1
* python-twisted: Depend on the python-twisted-* 9.0 packages.
* python-twisted: Depend on python-zope.interface only. Closes: #557781.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# -*- Python -*-
2
 
# $Id: gtk2manhole.py,v 1.9 2003/09/07 19:58:09 acapnotic Exp $
3
 
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
 
1
# -*- test-case-name: twisted.manhole.ui.test.test_gtk2manhole -*-
 
2
# Copyright (c) 2001-2009 Twisted Matrix Laboratories.
4
3
# See LICENSE for details.
5
4
 
6
 
 
7
 
"""Manhole client with a GTK v2.x front-end.
 
5
"""
 
6
Manhole client with a GTK v2.x front-end.
8
7
"""
9
8
 
10
9
__version__ = '$Revision: 1.9 $'[11:-2]
12
11
from twisted import copyright
13
12
from twisted.internet import reactor
14
13
from twisted.python import components, failure, log, util
 
14
from twisted.python.reflect import prefixedMethodNames
15
15
from twisted.spread import pb
16
16
from twisted.spread.ui import gtk2util
17
17
 
206
206
 
207
207
 
208
208
class ConsoleInput:
209
 
    toplevel, rkeymap = None, None 
 
209
    toplevel, rkeymap = None, None
210
210
    __debug = False
211
211
 
212
212
    def __init__(self, textView):
213
213
        self.textView=textView
214
214
        self.rkeymap = {}
215
215
        self.history = History()
216
 
        for name in dir(gtk.keysyms):
217
 
            try:
218
 
                self.rkeymap[getattr(gtk.keysyms, name)] = name
219
 
            except (TypeError, AttributeError):
220
 
                pass
 
216
        for name in prefixedMethodNames(self.__class__, "key_"):
 
217
            keysymName = name.split("_")[-1]
 
218
            self.rkeymap[getattr(gtk.keysyms, keysymName)] = keysymName
221
219
 
222
220
    def _on_key_press_event(self, entry, event):
223
221
        stopSignal = False
298
296
 
299
297
    def key_ctrl_shift_F9(self, entry, event):
300
298
        if self.__debug:
301
 
            import pdb; pdb.set_trace() 
 
299
            import pdb; pdb.set_trace()
302
300
 
303
301
    def clear(self):
304
302
        buffer = self.textView.get_buffer()