/usr/share/pyshared/tolk/widget_state.py is in apertium-tolk 0.2-2.2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | import gtk
from simplegeneric import generic
@generic
def dump_state(widget):
raise NotImplementedError
@generic
def load_state(widget, dct):
raise NotImplementedError
@dump_state.when_type(gtk.Widget)
def widget_dump_state(widget):
return {}
@load_state.when_type(gtk.Widget)
def widget_load_state(widget, dct):
pass
@dump_state.when_type(gtk.Window)
def window_dump_state(w):
return { "x_size": w.get_size()[0],
"y_size": w.get_size()[1],
"x_pos": w.get_position()[0],
"y_pos": w.get_position()[1] }
@load_state.when_type(gtk.Window)
def window_load_state(w, p):
w.move(int(p["x_pos"]), int(p["y_pos"]))
w.resize(int(p["x_size"]), int(p["y_size"]))
@dump_state.when_type(gtk.Paned)
def paned_dump_state(w):
return { "position": w.get_position() }
@load_state.when_type(gtk.Paned)
def paned_load_state(w, p):
w.set_position(int(p["position"]))
|