Exemple #1
0
 def runs_tparm():
     with rffi.scoped_str2charp("xterm") as ll_term:
         fficurses.rpy_curses_setupterm(ll_term, 1)
     with rffi.scoped_str2charp("cup") as ll_capname:
         cup = fficurses.rpy_curses_tigetstr(ll_capname)
         res = fficurses.rpy_curses_tparm(cup, 5, 3, 0, 0, 0, 0, 0, 0,
                                          0)
         return rffi.charp2str(res)
Exemple #2
0
def setupterm(space, w_termname=None, fd=-1):
    if fd == -1:
        w_stdout = space.getattr(space.getbuiltinmodule('sys'),
                                 space.newtext('stdout'))
        fd = space.int_w(space.call_function(space.getattr(w_stdout,
                                             space.newtext('fileno'))))
    if space.is_none(w_termname):
        termname = None
    else:
        termname = space.text_w(w_termname)

    with rffi.scoped_str2charp(termname) as ll_term:
        fd = rffi.cast(rffi.INT, fd)
        ll_errmsg = fficurses.rpy_curses_setupterm(ll_term, fd)
    if ll_errmsg:
        raise curses_error(space, rffi.charp2str(ll_errmsg))

    space.fromcache(ModuleInfo).setupterm_called = True
Exemple #3
0
 def runs_ctgetstr():
     with rffi.scoped_str2charp("xterm") as ll_term:
         fficurses.rpy_curses_setupterm(ll_term, 1)
     with rffi.scoped_str2charp("cup") as ll_capname:
         ll = fficurses.rpy_curses_tigetstr(ll_capname)
         return rffi.charp2str(ll)
Exemple #4
0
 def runs_setupterm():
     null = lltype.nullptr(rffi.CCHARP.TO)
     fficurses.rpy_curses_setupterm(null, 1)