Ejemplo n.º 1
0
def get_dump(typelib_path, skip_abi):
    with open(typelib_path, "rb") as h:
        data = h.read()

    typelib = GITypelib.new_from_memory(data)
    repo = GIRepository.get_default()
    namespace = repo.load_typelib(typelib, 0)
    infos = repo.get_infos(namespace)
    l = handle_list(infos, skip_abi=skip_abi)
    return json.dumps(l, indent=2)
Ejemplo n.º 2
0
def get_dump(typelib_path, skip_abi):
    with open(typelib_path, "rb") as h:
        data = h.read()

    typelib = GITypelib.new_from_memory(data)
    repo = GIRepository.get_default()
    namespace = repo.load_typelib(typelib, 0)
    infos = repo.get_infos(namespace)
    l = handle_list(infos, skip_abi=skip_abi)
    return json.dumps(l, indent=2)
Ejemplo n.º 3
0
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.

from ctypes import byref
import sys

sys.path.insert(0, '..')

from pgi.clib.gir import GIRepository, GIRepositoryLoadFlags
from pgi.clib.gir import GIArgument
from pgi.clib.glib import GErrorPtr
from pgi.clib.gobject import g_type_init

g_type_init()

repo = GIRepository.get_default()
repo.require("GLib", "2.0", GIRepositoryLoadFlags.LAZY)

function_info = repo.find_by_name("GLib", "warn_message")
if not function_info:
    raise Exception

in_args_type = GIArgument * 5
in_args = in_args_type(
    GIArgument(v_string="GITYPES"),
    GIArgument(v_string=__file__),
    GIArgument(v_uint=42),
    GIArgument(v_string="main"),
    GIArgument(v_string="hello world"),
)
retval = GIArgument()
Ejemplo n.º 4
0
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.

from ctypes import byref
import sys
sys.path.insert(0, '..')

from pgi.clib.gir import GIRepository, GIRepositoryLoadFlags
from pgi.clib.gir import GIArgument
from pgi.clib.glib import GErrorPtr
from pgi.clib.gobject import g_type_init

g_type_init()

repo = GIRepository.get_default()
repo.require("GLib", "2.0", GIRepositoryLoadFlags.LAZY)

function_info = repo.find_by_name("GLib", "warn_message")
if not function_info:
    raise Exception

in_args_type = GIArgument * 5
in_args = in_args_type(GIArgument(v_string="GITYPES"),
                       GIArgument(v_string=__file__),
                       GIArgument(v_uint=42),
                       GIArgument(v_string="main"),
                       GIArgument(v_string="hello world"),
)
retval = GIArgument()