4 from gtkdictbrowser import GtkDictBrowser
11 if len(sys.argv) != 2:
12 print "Usage: gdbtool <tdbfile>"
16 t = tdb.open(sys.argv[1])
18 print "gtdbtool: error opening %s: %s" % (sys.argv[1], t)
23 db = GtkDictBrowser(t)
25 def display_key_x00(key):
26 """Remove \x00 from all keys as they mucks up GTK."""
27 return string.replace(key, "\x00", "")
29 db.register_get_key_text_fn(display_key_x00)
31 db.build_ui('gtdbtool')
33 # Override Python's handling of ctrl-c so we can break out of the
34 # gui from the command line.
37 signal.signal(signal.SIGINT, signal.SIG_DFL)