Beispiel #1
0
    def asXml(self):
        line = self.getSourceReference().getLineNumber()

        result = TreeXML.Element("node",
                                 kind=self.__class__.__name__,
                                 line="%s" % line)

        compat_line = self.getCompatibleSourceReference().getLineNumber()

        if compat_line != line:
            result.attrib["compat_line"] = str(compat_line)

        for key, value in iterItems(self.getDetailsForDisplay()):
            result.set(key, str(value))

        for name, children in self.getVisitableNodesNamed():
            role = TreeXML.Element("role", name=name)

            result.append(role)

            if children is None:
                role.attrib["type"] = "none"
            elif type(children) not in (list, tuple):
                role.append(children.asXml())
            else:
                role.attrib["type"] = "list"

                for child in children:
                    role.append(child.asXml())

        return result
Beispiel #2
0
    def asXml(self):
        result = TreeXML.Element("node",
                                 kind=self.__class__.__name__,
                                 line="%s" %
                                 self.getSourceReference().getLineNumber())

        for key, value in iterItems(self.getDetails()):
            value = str(value)

            if value.startswith("<") and value.endswith(">"):
                value = value[1:-1]

            result.set(key, str(value))

        for name, children in self.getVisitableNodesNamed():
            if type(children) not in (list, tuple):
                children = (children, )

            role = TreeXML.Element("role", name=name)

            result.append(role)

            for child in children:
                if child is not None:
                    role.append(child.asXml())

        return result
Beispiel #3
0
def writeCompilationReport(report_filename):
    active_modules_info = getModuleInclusionInfos()

    root = TreeXML.Element("nuitka-compilation-report")

    for module in getDoneModules():
        active_module_info = active_modules_info[module]

        root.append(
            TreeXML.Element(
                "module",
                name=module.getFullName(),
                kind=module.__class__.__name__,
                reason=active_module_info.reason,
            ))

    putTextFileContents(filename=report_filename,
                        contents=TreeXML.toString(root))

    general.info("Compilation report in file %r." % report_filename)
Beispiel #4
0
def writeCompilationReport(report_filename):
    active_modules_info = getModuleInclusionInfos()

    root = TreeXML.Element("nuitka-compilation-report")

    for module in getDoneModules():
        active_module_info = active_modules_info[module]

        root.append(
            TreeXML.Element(
                "module",
                name=module.getFullName(),
                kind=module.__class__.__name__,
                reason=active_module_info.reason,
            ))

    for included_datafile in getIncludedDataFiles():
        if included_datafile.kind == "data_file":
            root.append(
                TreeXML.Element(
                    "data_file",
                    name=included_datafile.dest_path,
                    source=included_datafile.source_path,
                    reason=included_datafile.reason,
                    tags=",".join(included_datafile.tags),
                ))
        elif included_datafile.kind == "data_blob":
            root.append(
                TreeXML.Element(
                    "data_blob",
                    name=included_datafile.dest_path,
                    reason=included_datafile.reason,
                    tags=",".join(included_datafile.tags),
                ))

    putTextFileContents(filename=report_filename,
                        contents=TreeXML.toString(root))

    general.info("Compilation report in file %r." % report_filename)