Beispiel #1
0
    def __init__(self, mimetype, add_generator=True):
        self.mimetype = mimetype
        self.childobjects = []
        self._extra = []
        self.folder = "" # Always empty for toplevel documents
        self.topnode = Document(mimetype=self.mimetype)
        self.topnode.ownerDocument = self

        self.clear_caches()

        self.Pictures = {}
        self.meta = Meta()
        self.topnode.addElement(self.meta)
        if add_generator:
            self.meta.addElement(meta.Generator(text=TOOLSVERSION))
        self.scripts = Scripts()
        self.topnode.addElement(self.scripts)
        self.fontfacedecls = FontFaceDecls()
        self.topnode.addElement(self.fontfacedecls)
        self.settings = Settings()
        self.topnode.addElement(self.settings)
        self.styles = Styles()
        self.topnode.addElement(self.styles)
        self.automaticstyles = AutomaticStyles()
        self.topnode.addElement(self.automaticstyles)
        self.masterstyles = MasterStyles()
        self.topnode.addElement(self.masterstyles)
        self.body = Body()
        self.topnode.addElement(self.body)
Beispiel #2
0
 def __replaceGenerator(self):
     """ Section 3.1.1: The application MUST NOT export the original identifier
         belonging to the application that created the document.
     """
     for m in self.meta.childNodes[:]:
         if m.qname == (METANS, u'generator'):
             self.meta.removeChild(m)
     self.meta.addElement(meta.Generator(text=TOOLSVERSION))
Beispiel #3
0
    def __init__(self, mimetype):
        self.mimetype = mimetype
        self.childobjects = []
        self.folder = ""  # Always empty for toplevel documents

        self.Pictures = {}
        self.meta = Meta()
        self.meta.addElement(meta.Generator(text=TOOLSVERSION))
        self.scripts = Scripts()
        self.fontfacedecls = FontFaceDecls()
        self.settings = Settings()
        self.styles = Styles()
        self.automaticstyles = AutomaticStyles()
        self.masterstyles = MasterStyles()
        self.body = Body()
Beispiel #4
0
    def __init__(self, mimetype, add_generator=True):
        """
        the constructor
        @param mimetype a unicode string
        @param add_generator a boolean
        """
        assert (type(mimetype) == type(u""))
        assert (isinstance(add_generator, True .__class__))

        self.mimetype = mimetype
        self.childobjects = []
        self._extra = []
        self.folder = u""  # Always empty for toplevel documents
        self.topnode = Document(mimetype=self.mimetype)
        self.topnode.ownerDocument = self

        self.clear_caches()

        self.Pictures = {}
        self.meta = Meta()
        self.topnode.addElement(self.meta)
        if add_generator:
            self.meta.addElement(meta.Generator(text=TOOLSVERSION))
        self.scripts = Scripts()
        self.topnode.addElement(self.scripts)
        self.fontfacedecls = FontFaceDecls()
        self.topnode.addElement(self.fontfacedecls)
        self.settings = Settings()
        self.topnode.addElement(self.settings)
        self.styles = Styles()
        self.topnode.addElement(self.styles)
        self.automaticstyles = AutomaticStyles()
        self.topnode.addElement(self.automaticstyles)
        self.masterstyles = MasterStyles()
        self.topnode.addElement(self.masterstyles)
        self.body = Body()
        self.topnode.addElement(self.body)