3 from random
import uniform
5 from sys
import stderr
as err
11 def wrapper(*args
, **kwargs
):
12 try: return f(*args
, **kwargs
)
15 log("error: " + str(f
))
18 # FIXME: make fail nicely if text_cb are not defined
19 class Temp(pytx
.List
):
20 def __init__(self
, flags
):
21 pytx
.List
.__init
__(self
, flags
)
23 def text_cb(self
, data
):
24 return [str(i
) for i
in data
]
27 def idle_cb(self
, bla
= False):
30 self
.add(i
, [chr(int(uniform(97,102))), "penny smells", i
])
35 def bind_cb(self
, ch
, key
):
39 cols
, ascd
= self
.sort_get()
40 if 0 < ch
-48 < len(self
.widths
) + 1:
41 self
.sort_set(ch
-49, ascd
)
43 self
.sort_set(cols
, not ascd
)
50 self
.widths_set([5,15,5])
51 self
.titles_set(["chars", "strings", "ints"])
54 b1
= pytx
.Box(pytx
.ROOT|pytx
.VERT|pytx
.BORDER
)
55 b2
= pytx
.Box(pytx
.HORZ|pytx
.BORDER
)
56 l1
= Temp(pytx
.FOCUS|pytx
.SCROLL|pytx
.TITLES|pytx
.HIGHLIGHT|pytx
.SEPARATOR|pytx
.BORDER
)
57 l2
= Temp(pytx
.BORDER
)
58 l3
= Temp(pytx
.BORDER
)
70 if __name__
== "__main__":