Exemplo n.º 1
0
def main(argv):
    ns_list = set([n.split("-")[0] for n in get_gir_files().keys()])
    for p in PROJECTS:
        ns_list -= set(p.namespaces)

    print "Missing:"
    print sorted(ns_list)

    pool = Pool(20)
    for content, project in pool.imap_unordered(fetch, PROJECTS):
        for ns in project.namespaces:
            path = get_doap_path(ns)
            with open(path, 'wb') as h:
                h.write(content)
Exemplo n.º 2
0
def main(argv):
    ns_list = set([n.split("-")[0] for n in get_gir_files().keys()])
    for p in PROJECTS:
        ns_list -= set(p.namespaces)

    print "Missing:"
    print sorted(ns_list)

    pool = Pool(20)
    for content, project in pool.imap_unordered(fetch, PROJECTS):
        for ns in project.namespaces:
            path = get_doap_path(ns)
            with open(path, "wb") as h:
                h.write(content)
Exemplo n.º 3
0
def print_missing():
    """print modules that are present but not included in the build list
    or the blacklist
    """

    print "Searching for missing modules.."

    girs = get_gir_files()

    missing = set(BUILD) - set(girs.keys())
    if missing:
        print "Missing girs: %r" % missing

    bl_depend = set()

    if "check" in sys.argv[1:]:
        blacklist = set(BLACKLIST)
        missing = set()
        for key, path in girs.items():
            if key not in BUILD and key not in BLACKLIST:
                ns = get_namespace(*key.split("-"))
                deps = set(["-".join(d) for d in ns.get_all_dependencies()])
                if deps & blacklist:
                    bl_depend.add(key)
                    continue
                missing.add(key)

    if bl_depend:
        print "Depending on blacklisted modules:"
        for key in bl_depend:
            print "\"%s\"," % key

    if missing:
        print "..missing:"
    else:
        print "..none missing."
    for key in sorted(missing):
        print "\"%s\"," % key

    if missing or bl_depend:
        raise SystemExit(1)
Exemplo n.º 4
0
def print_missing():
    """print modules that are present but not included in the build list
    or the blacklist
    """

    print "Searching for missing modules.."

    girs = get_gir_files()

    missing = set(BUILD) - set(girs.keys())
    if missing:
        print "Missing girs: %r" % missing

    bl_depend = set()

    if "check" in sys.argv[1:]:
        blacklist = set(BLACKLIST)
        missing = set()
        for key, path in girs.items():
            if key not in BUILD and key not in BLACKLIST:
                ns = get_namespace(*key.split("-"))
                deps = set(["-".join(d) for d in ns.get_all_dependencies()])
                if deps & blacklist:
                    bl_depend.add(key)
                    continue
                missing.add(key)

    if bl_depend:
        print "Depending on blacklisted modules:"
        for key in bl_depend:
            print "\"%s\"," % key

    if missing:
        print "..missing:"
    else:
        print "..none missing."
    for key in sorted(missing):
        print "\"%s\"," % key

    if missing or bl_depend:
        raise SystemExit(1)
Exemplo n.º 5
0
def main(argv):
    parser = argparse.ArgumentParser(
        description='Create a sphinx environ')
    parser.add_argument('source',
                        help='path to where the resulting source should be')
    parser.add_argument('target',
                        help='path to where the resulting build should be')
    parser.add_argument('namespace',
                        help='namespace including version e.g. Gtk-3.0')
    parser.add_argument('--devhelp', action='store_true')

    try:
        args = parser.parse_args(argv[1:])
    except SystemExit:
        raise SystemExit(1)

    if not args.namespace:
        print "No namespace given"
        raise SystemExit(1)

    # this catches the "pip install pgi" case
    if pgi.version_info[-1] != -1:
        print "atm pgi-docgen needs pgi trunk and not a stable release"
        print "Get it here: https://github.com/lazka/pgi"
        raise SystemExit(1)

    girs = get_gir_files()

    if args.namespace not in girs:
        print "GIR file for %s not found, aborting." % args.namespace
        raise SystemExit(1)

    gen = ModuleGenerator()
    namespace, version = args.namespace.split("-", 1)
    print "Create docs: Namespace=%s, Version=%s" % (namespace, version)
    gen.add_module(namespace, version)
    gen.write(args.source, args.target, args.devhelp)
Exemplo n.º 6
0
def main(argv):
    parser = argparse.ArgumentParser(description='Create a sphinx environ')
    parser.add_argument('source',
                        help='path to where the resulting source should be')
    parser.add_argument('target',
                        help='path to where the resulting build should be')
    parser.add_argument('namespace',
                        help='namespace including version e.g. Gtk-3.0')
    parser.add_argument('--devhelp', action='store_true')

    try:
        args = parser.parse_args(argv[1:])
    except SystemExit:
        raise SystemExit(1)

    if not args.namespace:
        print "No namespace given"
        raise SystemExit(1)

    # this catches the "pip install pgi" case
    if pgi.version_info[-1] != -1:
        print "atm pgi-docgen needs pgi trunk and not a stable release"
        print "Get it here: https://github.com/lazka/pgi"
        raise SystemExit(1)

    girs = get_gir_files()

    if args.namespace not in girs:
        print "GIR file for %s not found, aborting." % args.namespace
        raise SystemExit(1)

    gen = ModuleGenerator()
    namespace, version = args.namespace.split("-", 1)
    print "Create docs: Namespace=%s, Version=%s" % (namespace, version)
    gen.add_module(namespace, version)
    gen.write(args.source, args.target, args.devhelp)
Exemplo n.º 7
0
    "GdkX11-3.0": (),
    "GES-1.0": (
        "1.8.0", "ges_effect_new",
        "http://cgit.freedesktop.org/gstreamer/gst-editing-services/tree/ges/ges-effect.c?h=1.8.0#n267"),
    "GLib-2.0": (
        "2.54.2", "g_base64_decode_step",
        "https://gitlab.gnome.org/GNOME/glib/blob/2.54.2/glib/gbase64.c#L326"),
    # This is buggy..
    # "GExiv2-0.10": (
    # "0.10.3", "gexiv2_preview_image_new",
    # "https://gitlab.gnome.org/GNOME/gexiv2/blob/gexiv2-0.10.3/gexiv2/gexiv2-startup.cpp#L46"),
}


if __name__ == "__main__":
    for namespace, path in get_gir_files().items():
        if DATA.get(namespace):
            version, symbol, res = DATA[namespace]
            p = Project.for_namespace(namespace.split("-")[0])
            assert p.get_tag(version)
            func = p.get_source_func(namespace.split("-")[0], version)
            assert func
            symbols = {}
            for lib in parse_gir_shared_libs(path):
                symbols.update(get_line_numbers_for_name(lib))
            if symbol in symbols:
                symbol_path = symbols[symbol]
                func_res = func(symbol_path)
                assert func_res == res, (func_res, res)
                r = requests.get(res)
                assert r.ok
Exemplo n.º 8
0
    "GdkX11-3.0": (),
    "GES-1.0":
    ("1.8.0", "ges_effect_new",
     "http://cgit.freedesktop.org/gstreamer/gst-editing-services/tree/ges/ges-effect.c?h=1.8.0#n267"
     ),
    "GLib-2.0":
    ("2.54.2", "g_base64_decode_step",
     "https://gitlab.gnome.org/GNOME/glib/blob/2.54.2/glib/gbase64.c#L326"),
    # This is buggy..
    # "GExiv2-0.10": (
    # "0.10.3", "gexiv2_preview_image_new",
    # "https://gitlab.gnome.org/GNOME/gexiv2/blob/gexiv2-0.10.3/gexiv2/gexiv2-startup.cpp#L46"),
}

if __name__ == "__main__":
    for namespace, path in get_gir_files().items():
        if DATA.get(namespace):
            version, symbol, res = DATA[namespace]
            p = Project.for_namespace(namespace.split("-")[0])
            assert p.get_tag(version)
            func = p.get_source_func(namespace.split("-")[0], version)
            assert func
            symbols = {}
            for lib in parse_gir_shared_libs(path):
                symbols.update(get_line_numbers_for_name(lib))
            if symbol in symbols:
                symbol_path = symbols[symbol]
                func_res = func(symbol_path)
                assert func_res == res, (func_res, res)
                r = requests.get(res)
                assert r.ok
Exemplo n.º 9
0
        ['Totem-1.0'],
    'https://git.gnome.org/browse/libgtop/plain/libgtop.doap':
        ['GTop-2.0'],
    'https://git.gnome.org/browse/libmediaart/plain/libmediaart.doap':
        ['MediaArt-1.0'],
    'https://git.gnome.org/browse/gegl/plain/gegl.doap':
        ['Gegl-0.3'],
}


def fetch(args):
    url, data = args
    print url
    resp = requests.get(url)
    return resp.content, data


if __name__ == '__main__':
    ns_list = set(get_gir_files().keys())
    for values in LIBS.values():
        ns_list -= set(values)

    print "Missing:"
    print sorted(ns_list)

    pool = Pool(20)
    for content, ns_list in pool.imap_unordered(fetch, LIBS.items()):
        for ns in ns_list:
            with open(os.path.join('data', 'doap', ns) + ".doap", 'wb') as h:
                h.write(content)
Exemplo n.º 10
0
import subprocess
import argparse

from pgidocgen.util import get_gir_files


if __name__ == "__main__":
    parser = argparse.ArgumentParser(
        description='List installed debian package names for gir files')

    parser.add_argument(
        'namespaces', nargs='+', help='list of namespaces '
        'including versions (e.g. "Gtk-3.0 GLib-2.0")')

    args = parser.parse_args()
    girs = get_gir_files()

    filtered = {}
    for name in args.namespaces:
        if name not in girs:
            print "GIR file for %s not found, aborting." % name
            raise SystemExit(1)
        filtered[name] = girs[name]

    mapping = {}

    packages = []
    for name, path in filtered.iteritems():
        out = subprocess.check_output(["dpkg", "-S", path])
        package = out.split(":", 1)[0]
        packages.append(package)
Exemplo n.º 11
0
import subprocess
import argparse

from pgidocgen.util import get_gir_files

if __name__ == "__main__":
    parser = argparse.ArgumentParser(
        description='List installed debian package names for gir files')

    parser.add_argument('namespaces',
                        nargs='+',
                        help='list of namespaces '
                        'including versions (e.g. "Gtk-3.0 GLib-2.0")')

    args = parser.parse_args()
    girs = get_gir_files()

    filtered = {}
    for name in args.namespaces:
        if name not in girs:
            print "GIR file for %s not found, aborting." % name
            raise SystemExit(1)
        filtered[name] = girs[name]

    mapping = {}

    packages = []
    for name, path in filtered.iteritems():
        out = subprocess.check_output(["dpkg", "-S", path])
        package = out.split(":", 1)[0]
        packages.append(package)
Exemplo n.º 12
0
    'https://git.gnome.org/browse/glade/plain/glade.doap': ['Gladeui-2.0'],
    'https://git.gnome.org/browse/totem/plain/totem.doap': ['Totem-1.0'],
    'https://git.gnome.org/browse/libgtop/plain/libgtop.doap': ['GTop-2.0'],
    'https://git.gnome.org/browse/libmediaart/plain/libmediaart.doap': [
        'MediaArt-1.0'
    ],
    'https://git.gnome.org/browse/gegl/plain/gegl.doap': ['Gegl-0.3'],
}


def fetch(args):
    url, data = args
    print url
    resp = requests.get(url)
    return resp.content, data


if __name__ == '__main__':
    ns_list = set(get_gir_files().keys())
    for values in LIBS.values():
        ns_list -= set(values)

    print "Missing:"
    print sorted(ns_list)

    pool = Pool(20)
    for content, ns_list in pool.imap_unordered(fetch, LIBS.items()):
        for ns in ns_list:
            with open(os.path.join('data', 'doap', ns) + ".doap", 'wb') as h:
                h.write(content)