[ create a new paste ] login | about

Link: http://codepad.org/0Hlvmp1b    [ raw code | fork ]

Python, pasted on Dec 27:
class Input:
    def __init__(self,term):
        self.term = term
        self.size = self.term.get_cols_rows()
        self.input = urwid.Edit()
        self.filler = urwid.Filler(self.input)
        self.canvas = self.filler.render( self.size, focus=True )
        self.term.draw_screen(self.size,self.canvas)
        reactor.addReader(self)

    def fileno(self):
        return 0

    def logPrefix(self):
        return 'CursesClient'

    def doRead(self):
        keys = self.term.get_input_nonblocking()
        for key in keys:
            if key == 'window resize':
                self.size = self.term.get_cols_rows()
            elif key == 'enter':
                text = self.input.get_edit_text()
                controller.sendMsg('dev',text)
                self.input.set_edit_text('')
            else:
                self.filler.keypress(self.size, key)
    
term = urwid.raw_display.Screen()
term.run_wrapper(lambda: Input(term))



Traceback (most recent call last):
  File "./keckz.py", line 44, in <module>
    f.startKeckz(f.host, f.view)
  File "./keckz.py", line 38, in startKeckz
    controllerKeckz.Kekzcontroller(View).startConnection(host,23002)
  File "/home/arch/keckz/trunk/controllerKeckz.py", line 13, in __init__
    self.view = interface(self)
  File "/home/arch/keckz/trunk/urwid_cli.py", line 21, in __init__
    self.term.run_wrapper(lambda: Input(self.term))
  File "/usr/lib/python2.6/site-packages/urwid/raw_display.py", line 212, in run_wrapper
    return fn()
  File "/home/arch/keckz/trunk/urwid_cli.py", line 21, in <lambda>
    self.term.run_wrapper(lambda: Input(self.term))
  File "/home/arch/keckz/trunk/urwid_cli.py", line 55, in __init__
    self.term.draw_screen(self.size,self.canvas)
  File "/usr/lib/python2.6/site-packages/urwid/raw_display.py", line 579, in draw_screen
    assert self.palette.has_key(a), `a`
AssertionError: None


Create a new paste based on this one


Comments: