From 18f313666e47ed39372142c86490629ceba7f07f Mon Sep 17 00:00:00 2001 From: Pelle Nilsson Date: Mon, 3 Jun 2013 23:45:31 +0200 Subject: [PATCH] Do not crash when there are gaps in section numbering. --- output.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/output.py b/output.py index 4cddf59..54a1735 100644 --- a/output.py +++ b/output.py @@ -11,11 +11,6 @@ class OutputFormat (object): def __str__(self): return ".%s: %s" % (self.extension, self.name) - def write(self, book, output): - self.write_begin(book, output) - self.write_shuffled_sections(book.shuffle(), output) - self.write_end(book, output) - def write_begin(self, book, output): print >> output, self.load_template("begin") % { 'max' : book.max @@ -23,7 +18,8 @@ class OutputFormat (object): def write_shuffled_sections(self, shuffled_sections, output): for p in shuffled_sections.as_list[1:]: - self.write_section(p, shuffled_sections, output) + if p: + self.write_section(p, shuffled_sections, output) def write_section(self, section, shuffled_sections, output): refs = []