comparison MoinMoin/action/SlideShow.py @ 5094:180956b08fa2

action.Slideshow: fixed bug for no headings of level 1
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Sat, 12 Sep 2009 20:38:51 +0200
parents f17dd8cc0347
children c365adadb7f7
comparison
equal deleted inserted replaced
5093:939ccb653aad 5094:180956b08fa2
110 110
111 # Slide accessing methods map 1 based slides to 0 based index. 111 # Slide accessing methods map 1 based slides to 0 based index.
112 112
113 def titleAt(self, number): 113 def titleAt(self, number):
114 """ Return the title of slide number """ 114 """ Return the title of slide number """
115 return self.slideIndex()[number - 1][0] 115 try:
116 return self.slideIndex()[number - 1][0]
117 except IndexError:
118 return 1
116 119
117 def bodyAt(self, number): 120 def bodyAt(self, number):
118 """ Return the body of slide number """ 121 """ Return the body of slide number """
119 start, end = self.slideIndex()[number - 1][1:] 122 try:
120 return self.get_raw_body()[start:end] 123 start, end = self.slideIndex()[number - 1][1:]
124 return self.get_raw_body()[start:end]
125 except IndexError:
126 return self.get_raw_body()
121 127
122 # Private ---------------------------------------------------------------- 128 # Private ----------------------------------------------------------------
123 129
124 def slideIndex(self): 130 def slideIndex(self):
125 if self._slideIndex is None: 131 if self._slideIndex is None: