def __init__(self, **kw): self.namespaces = {} if "nsmap" not in kw: kw["nsmap"] = {} else: self.namespaces = kw["nsmap"] self.factory = _ElementMaker(**kw)
ContentType.Default = Default del Default class Override(ContentType): """An Override content type, based on a part name.""" key_name = 'PartName' ContentType.Override = Override del Override # Construct E, a convient namespace for making elements in the OOXML # namespaces. E = type('E', (object,), dict( (key, _ElementMaker(namespace=namespace, nsmap=ooxml_namespaces)) for key, namespace in ooxml_namespaces.items() )) class CoreProperties(Part): """ Core properties on a package, has attributes like 'title', and 'subject' """ content_type = ("application/" "vnd.openxmlformats-package.core-properties+xml") rel_type = ("http://schemas.openxmlformats.org/package/2006/" "relationships/metadata/core-properties") title = '' subject = '' creator = ''