def __init__(self, gi_extension): Formatter.__init__(self, gi_extension) self._order_by_parent = True self._symbol_formatters.update( { GIClassSymbol: self._format_class_symbol, GIStructSymbol: self._format_class_symbol, }) self._ordering.insert(self._ordering.index(ClassSymbol) + 1, GIClassSymbol) self._ordering.insert(self._ordering.index(GIClassSymbol) + 1, GIStructSymbol) self.__annotation_parser = GIAnnotationParser()
def __init__(self, extension): self.__tmpdir = TemporaryDirectory() with open(os.path.join(self.__tmpdir.name, "padtemplate.html"), "w") as _: _.write(GstPadTemplateSymbol.TEMPLATE) with open(os.path.join(self.__tmpdir.name, "enumtemplate.html"), "w") as _: _.write(GstNamedConstantValue.TEMPLATE) with open(os.path.join(self.__tmpdir.name, "plugins.html"), "w") as _: _.write(GstPluginsSymbol.TEMPLATE) with open(os.path.join(self.__tmpdir.name, "plugin.html"), "w") as _: _.write(GstPluginSymbol.TEMPLATE) with open(os.path.join(self.__tmpdir.name, "element.html"), "w") as _: _.write(GstElementSymbol.TEMPLATE) Formatter.__init__(self, extension) self._order_by_parent = True self._ordering.insert(0, GstPluginSymbol) self._ordering.insert(1, GstElementSymbol) self._ordering.insert( self._ordering.index(ClassSymbol) + 1, GIClassSymbol) self._ordering.insert( self._ordering.index(GIClassSymbol) + 1, GstPadTemplateSymbol) self._ordering.insert( self._ordering.index(GstPadTemplateSymbol) + 1, GstPluginsSymbol) self._ordering.insert( self._ordering.index(InterfaceSymbol) + 1, GIInterfaceSymbol) self._ordering.append(GstNamedConstantsSymbols) self._symbol_formatters.update({ GstPluginsSymbol: self._format_plugins_symbol, GstPluginSymbol: self._format_plugin_symbol, GstPadTemplateSymbol: self._format_pad_template_symbol, GstElementSymbol: self._format_element_symbol, GstNamedConstantsSymbols: self._format_enum, GIClassSymbol: self._format_class_symbol, GIInterfaceSymbol: self._format_interface_symbol, GstNamedConstantValue: self._format_name_constant_value, }) self.gi_languages = []