Ejemplo n.º 1
0
    def from_enum(gtype, enum_value):
        """Turn an int back into an enum string.

        """

        pointer = vips_lib.vips_enum_nick(gtype, enum_value)
        if pointer == ffi.NULL:
            raise Error('value not in enum')

        return _to_string(pointer)
Ejemplo n.º 2
0
    def from_enum(gtype, enum_value):
        """Turn an int back into an enum string.

        """

        cstr = vips_lib.vips_enum_nick(gtype, enum_value)
        if cstr == 0:
            raise Error('value not in enum')

        return _to_string(ffi.string(cstr))