Exemplo n.º 1
0
def tparm(fmt, i1=0, i2=0, i3=0, i4=0, i5=0, i6=0, i7=0, i8=0, i9=0):
    args = [ffi.cast("int", i) for i in (i1, i2, i3, i4, i5, i6, i7, i8, i9)]
    # fmt is expected to be a byte string; CPython 3.x complains
    # "TypeError: 'str' does not support the buffer interface", but we
    # can do better.
    if isinstance(fmt, str):
        # error message modeled on "TypeError: must be str, not bytes"
        # that you get if you call curses.tigetstr(b'...') on CPython 3.x
        raise TypeError('must be bytes, not str')
    result = lib.tparm(fmt, *args)
    if result == ffi.NULL:
        raise error("tparm() returned NULL")
    return ffi.string(result)
Exemplo n.º 2
0
def tparm(fmt, i1=0, i2=0, i3=0, i4=0, i5=0, i6=0, i7=0, i8=0, i9=0):
    args = [ffi.cast("int", i) for i in (i1, i2, i3, i4, i5, i6, i7, i8, i9)]
    # fmt is expected to be a byte string; CPython 3.x complains
    # "TypeError: 'str' does not support the buffer interface", but we
    # can do better.
    if isinstance(fmt, str):
        # error message modeled on "TypeError: must be str, not bytes"
        # that you get if you call curses.tigetstr(b'...') on CPython 3.x
        raise TypeError('must be bytes, not str')
    result = lib.tparm(fmt, *args)
    if result == ffi.NULL:
        raise error("tparm() returned NULL")
    return ffi.string(result)
Exemplo n.º 3
0
def tparm(fmt, i1=0, i2=0, i3=0, i4=0, i5=0, i6=0, i7=0, i8=0, i9=0):
    args = [ffi.cast("int", i) for i in (i1, i2, i3, i4, i5, i6, i7, i8, i9)]
    result = lib.tparm(fmt, *args)
    if result == ffi.NULL:
        raise error("tparm() returned NULL")
    return ffi.string(result)
Exemplo n.º 4
0
def tparm(fmt, i1=0, i2=0, i3=0, i4=0, i5=0, i6=0, i7=0, i8=0, i9=0):
    args = [ffi.cast("int", i) for i in (i1, i2, i3, i4, i5, i6, i7, i8, i9)]
    result = lib.tparm(fmt, *args)
    if result == ffi.NULL:
        raise error("tparm() returned NULL")
    return ffi.string(result)