Closed raphink closed 12 years ago
In some cases, styles only have one name. The simple fix for this is:
--- a/odplib/preso.py
+++ b/odplib/preso.py
@@ -200,7 +200,11 @@ class Preso(object):
def set_template(self, style_file):
style = zipwrap.ZipWrap(style_file)
- title_name, normal_name = list(self.get_master_page_names(style.cat('content.xml')))[:2]
+ names = list(self.get_master_page_names(style.cat('content.xml')))[:2]
+ if len(names) == 2:
+ title_name, normal_name = names
+ else:
+ title_name, normal_name = names[0], names[0]
self.master_page_name_cover = title_name
self.master_page_name_normal = normal_name
When using
rst2odp
with the--template-file
option, some templates fail to apply:Other templates work fine though.
This is on Ubuntu 12.04 with LibreOffice 3.5.3, using
rst2odp
from git (@ 3eb80009fdb70915f65631fda59bcdf0c3c96873).