Commits

Jason R. Coombs  committed c59e024

Added support for editing [Content-Types]
Bumped to 0.4.1-dev
Fixed indentation

  • Participants
  • Parent commits f315ec1

Comments (0)

Files changed (3)

File openpack/basepack.py

 		self.id = self._validate_id(id)
 		self.mode = self._validate_mode(mode or "Internal")
 		self.type = reltype
-   
+
 	def __repr__(self):
 		args = (self.source, self.target, self.type, self.id, self.mode)
 		return "Relationship(%r, %r, %r, %r, %r)" % args
 		def __set__(self, instance, value):
 			return
 	relationships = relationships()
-  
+
 	def dump(self):
 		rels = Element(self.xmlns + 'Relationships', nsmap={None:self.xmlns.strip('{}')})
 		for rel in self:

File openpack/editor.py

 def part_edit(path, reformat_xml):
 	file, ipath = find_file(path)
 	pkg = Package.from_file(file)
-	part = pkg['/'+ipath]
+	if ipath.startswith('[Content-Types]'):
+		part = pkg.content_types
+	else:
+		part = pkg['/'+ipath]
 	data = part.dump()
 	if reformat_xml:
 		data = etree.tostring(etree.fromstring(data), pretty_print=True)
 setup(
 	name="openpack",
 	author="Christian Wyglendowski (YouGov), Jason R. Coombs (YouGov)",
-	version="0.4",
+	version="0.4.1-dev",
 	packages=['openpack'],
 	install_requires=[
 		'lxml',