Ejemplo n.º 1
0
 def settingsxml(self):
     """ Generates the settings.xml file """
     x = DocumentSettings()
     x.addElement(self.settings)
     xml=PolyglotStringIO()
     xml.write(_XMLPROLOGUE)
     x.toXml(0,xml)
     return xml.getvalue()
Ejemplo n.º 2
0
 def settingsxml(self):
     """ Generates the settings.xml file """
     x = DocumentSettings()
     x.addElement(self.settings)
     xml = PolyglotStringIO()
     xml.write(_XMLPROLOGUE)
     x.toXml(0, xml)
     return xml.getvalue()
Ejemplo n.º 3
0
 def metaxml(self):
     """ Generates the meta.xml file """
     self.__replaceGenerator()
     x = DocumentMeta()
     x.addElement(self.meta)
     xml=PolyglotStringIO()
     xml.write(_XMLPROLOGUE)
     x.toXml(0,xml)
     return xml.getvalue()
Ejemplo n.º 4
0
 def metaxml(self):
     """ Generates the meta.xml file """
     self.__replaceGenerator()
     x = DocumentMeta()
     x.addElement(self.meta)
     xml = PolyglotStringIO()
     xml.write(_XMLPROLOGUE)
     x.toXml(0, xml)
     return xml.getvalue()
Ejemplo n.º 5
0
    def _tag_args(self, level, *args):
        now = time.localtime()
        buf = PolyglotStringIO()
        tagged_args = []
        for arg in args:
            prints(time.strftime("%Y-%m-%d %H:%M:%S", now), file=buf, end=" ")
            buf.write("[")
            prints(level, file=buf, end="")
            buf.write("] ")
            prints(arg, file=buf, end="")

            tagged_args.append(buf.getvalue())
            buf.truncate(0)

        return tagged_args
Ejemplo n.º 6
0
 def stylesxml(self):
     """ Generates the styles.xml file """
     xml=PolyglotStringIO()
     xml.write(_XMLPROLOGUE)
     x = DocumentStyles()
     x.write_open_tag(0, xml)
     if self.fontfacedecls.hasChildNodes():
         self.fontfacedecls.toXml(1, xml)
     self.styles.toXml(1, xml)
     a = AutomaticStyles()
     a.write_open_tag(1, xml)
     for s in self._used_auto_styles([self.masterstyles]):
         s.toXml(2, xml)
     a.write_close_tag(1, xml)
     if self.masterstyles.hasChildNodes():
         self.masterstyles.toXml(1, xml)
     x.write_close_tag(0, xml)
     return xml.getvalue()
Ejemplo n.º 7
0
 def stylesxml(self):
     """ Generates the styles.xml file """
     xml = PolyglotStringIO()
     xml.write(_XMLPROLOGUE)
     x = DocumentStyles()
     x.write_open_tag(0, xml)
     if self.fontfacedecls.hasChildNodes():
         self.fontfacedecls.toXml(1, xml)
     self.styles.toXml(1, xml)
     a = AutomaticStyles()
     a.write_open_tag(1, xml)
     for s in self._used_auto_styles([self.masterstyles]):
         s.toXml(2, xml)
     a.write_close_tag(1, xml)
     if self.masterstyles.hasChildNodes():
         self.masterstyles.toXml(1, xml)
     x.write_close_tag(0, xml)
     return xml.getvalue()