Commit ce30a27f by Calen Pennington

Small changes to make xml dump into as few files as possible

parent 10b417c8
...@@ -149,10 +149,15 @@ class HtmlDescriptor(XmlDescriptor, EditingDescriptor): ...@@ -149,10 +149,15 @@ class HtmlDescriptor(XmlDescriptor, EditingDescriptor):
write just <html filename="" [meta-attrs="..."]> to filename.xml, and the html write just <html filename="" [meta-attrs="..."]> to filename.xml, and the html
string to filename.html. string to filename.html.
''' '''
# If the file is a single html document, just use it directly
try: try:
return etree.fromstring(self.definition['data']) return etree.fromstring(self.definition['data'])
except etree.XMLSyntaxError: except etree.XMLSyntaxError:
pass # Otherwise, try wrapping it in a single html tag, and returning that
try:
return etree.fromstring("<html>%s</html>" % self.definition['data'])
except etree.XMLSyntaxError:
pass
# Not proper format. Write html to file, return an empty tag # Not proper format. Write html to file, return an empty tag
pathname = name_to_pathname(self.url_name) pathname = name_to_pathname(self.url_name)
......
...@@ -326,7 +326,7 @@ class XmlDescriptor(XModuleDescriptor): ...@@ -326,7 +326,7 @@ class XmlDescriptor(XModuleDescriptor):
NOTE: Do not override this without a good reason. It is here NOTE: Do not override this without a good reason. It is here
specifically for customtag... specifically for customtag...
""" """
return True return False
def export_to_xml(self, resource_fs): def export_to_xml(self, resource_fs):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment