(gtype)
return '<unknown type>'
Map a gtype to the name of the Python type we use to represent it.
Map a gtype to the name of the Python type we use to represent it.
Map a gtype to the name of the Python type we use to represent it .
def gtype_to_python(gtype):
        """Map a gtype to the name of the Python type we use to represent it.

        """

        fundamental = gobject_lib.g_type_fundamental(gtype)

        # enums can be strings or class members ... we want to generate a union
        # type
        if fundamental == GValue.genum_type:
            name = type_name(gtype)
            if name.startswith('Vips'):
                name = name[4:]
            return "Union[str, %s]" % name
        if gtype in GValue._gtype_to_python:
            return GValue._gtype_to_python[gtype]
        if fundamental in GValue._gtype_to_python:
            return GValue._gtype_to_python[fundamental]
        return '<unknown type>'
def gtype_to_python ( gtype ) : fundamental = gobject_lib . g_type_fundamental ( gtype ) # enums can be strings or class members ... we want to generate a union # type if fundamental == GValue . genum_type : name = type_name ( gtype ) if name . startswith ( 'Vips' ) : name = name [ 4 : ] return "Union[str, %s]" % name if gtype in GValue . _gtype_to_python : return GValue . _gtype_to_python [ gtype ] if fundamental in GValue . _gtype_to_python : return GValue . _gtype_to_python [ fundamental ] return '<unknown type>'