def Main():
    cgiEnv = lib_common.CgiEnv()

    grph = cgiEnv.GetGraph()

    # TODO: The dependency network is huge, so we put a limit, for the moment.
    maxCnt = 0

    try:
        modudeps = lib_modules.Dependencies()
    except:
        errorMsg = sys.exc_info()[1]
        lib_common.ErrorMessageHtml("Caught:" + str(errorMsg))

    for module_name in modudeps:

        # NOT TOO MUCH NODES: BEYOND THIS, IT IS FAR TOO SLOW, UNUSABLE.
        # HARDCODE_LIMIT
        maxCnt += 1
        if maxCnt > 2000:
            break

        file_parent = lib_modules.ModuleToNode(module_name)
        file_child = None
        for module_dep in modudeps[module_name]:

            # print ( module_name + " => " + module_dep )

            # This generates a directed acyclic graph,
            # but not a tree in the general case.
            file_child = lib_modules.ModuleToNode(module_dep)

            grph.add((file_parent, pc.property_module_dep, file_child))
        # TODO: Ugly trick, otherwise nodes without connections are not displayed.
        # TODO: I think this is a BUG in the dot file generation. Or in RDF ?...
        if file_child is None:
            grph.add((file_parent, pc.property_information,
                      lib_common.NodeLiteral("")))

    # Splines are rather slow.
    if maxCnt > 100:
        layoutType = "LAYOUT_XXX"
    else:
        layoutType = "LAYOUT_SPLINE"
    cgiEnv.OutCgiRdf(layoutType)
Beispiel #2
0
def Main():
	cgiEnv = lib_common.CgiEnv()

	moduFilNam = cgiEnv.GetId()

	grph = cgiEnv.GetGraph()

	modudeps = lib_modules.Dependencies()

	for module_name in modudeps:
		file_parent = lib_modules.ModuleToNode(module_name)
		file_child = None
		for module_dep in modudeps[ module_name ]:
			if ( moduFilNam == module_name ) or ( moduFilNam == module_dep ):
				file_child = lib_modules.ModuleToNode(module_dep)

				grph.add( ( file_parent, pc.property_module_dep, file_child ) )
		# TODO: Ugly trick, otherwise nodes without connections are not displayed.
		# TODO: I think this is a BUG in the dot file generation. Or in RDF ?...
		if ( file_child is None ) and ( moduFilNam == module_name ) :
			grph.add( ( file_parent, pc.property_information, lib_common.NodeLiteral("") ) )

	cgiEnv.OutCgiRdf("LAYOUT_SPLINE")