Show More
@@ -140,25 +140,23 b' class RevealHelpTransformer(ConfigurableTransformers):' | |||||
140 |
|
140 | |||
141 | def open_subsection(self): |
|
141 | def open_subsection(self): | |
142 | self.subsection_open = True |
|
142 | self.subsection_open = True | |
143 | #print('open subsection') |
|
|||
144 | return True |
|
143 | return True | |
145 |
|
144 | |||
146 | def open_section(self): |
|
145 | def open_section(self): | |
147 | self.section_open = True |
|
146 | self.section_open = True | |
148 | #print('open section') |
|
|||
149 | return True |
|
147 | return True | |
150 |
|
148 | |||
151 | def open_fragment(self): |
|
149 | def open_fragment(self): | |
152 | self.fragment_open = True |
|
150 | self.fragment_open = True | |
153 | #print('open fragment') |
|
|||
154 | return True |
|
151 | return True | |
155 |
|
152 | |||
|
153 | # could probaly write those maybe_close/open | |||
|
154 | # with a function functor | |||
156 | def maybe_close_section(self): |
|
155 | def maybe_close_section(self): | |
157 | """return True is already open, false otherwise |
|
156 | """return True is already open, false otherwise | |
158 | and change state to close |
|
157 | and change state to close | |
159 | """ |
|
158 | """ | |
160 | if self.section_open : |
|
159 | if self.section_open : | |
161 | #print('close section') |
|
|||
162 | self.section_open = False |
|
160 | self.section_open = False | |
163 | return True |
|
161 | return True | |
164 | else : |
|
162 | else : | |
@@ -170,7 +168,6 b' class RevealHelpTransformer(ConfigurableTransformers):' | |||||
170 | """ |
|
168 | """ | |
171 | if not self.section_open : |
|
169 | if not self.section_open : | |
172 | self.section_open = True |
|
170 | self.section_open = True | |
173 | #print('open section (m)') |
|
|||
174 | return True |
|
171 | return True | |
175 | else : |
|
172 | else : | |
176 | return False |
|
173 | return False | |
@@ -180,7 +177,6 b' class RevealHelpTransformer(ConfigurableTransformers):' | |||||
180 | and change state to close |
|
177 | and change state to close | |
181 | """ |
|
178 | """ | |
182 | if not self.subsection_open : |
|
179 | if not self.subsection_open : | |
183 | #print('open subsection (m)') |
|
|||
184 | self.subsection_open = True |
|
180 | self.subsection_open = True | |
185 | return True |
|
181 | return True | |
186 | else : |
|
182 | else : | |
@@ -191,7 +187,6 b' class RevealHelpTransformer(ConfigurableTransformers):' | |||||
191 | and change state to close |
|
187 | and change state to close | |
192 | """ |
|
188 | """ | |
193 | if self.subsection_open : |
|
189 | if self.subsection_open : | |
194 | #print('close subsection (m)') |
|
|||
195 | self.subsection_open = False |
|
190 | self.subsection_open = False | |
196 | return True |
|
191 | return True | |
197 | else : |
|
192 | else : | |
@@ -203,7 +198,6 b' class RevealHelpTransformer(ConfigurableTransformers):' | |||||
203 | """ |
|
198 | """ | |
204 | if self.fragment_open : |
|
199 | if self.fragment_open : | |
205 | self.fragment_open = False |
|
200 | self.fragment_open = False | |
206 | #print('close fragment (m)') |
|
|||
207 | return True |
|
201 | return True | |
208 | else : |
|
202 | else : | |
209 | return False |
|
203 | return False | |
@@ -213,11 +207,11 b' class RevealHelpTransformer(ConfigurableTransformers):' | |||||
213 | if ctype is None : |
|
207 | if ctype is None : | |
214 | cell.metadata.slideshow = {} |
|
208 | cell.metadata.slideshow = {} | |
215 | cell.metadata.slideshow['slide_type'] = None |
|
209 | cell.metadata.slideshow['slide_type'] = None | |
216 | if ctype == 'fragment': |
|
210 | elif ctype == 'fragment': | |
217 | cell.metadata.slideshow.close_fragment = self.maybe_close_fragment() |
|
211 | cell.metadata.slideshow.close_fragment = self.maybe_close_fragment() | |
218 | cell.metadata.slideshow.close_subsection = False |
|
212 | cell.metadata.slideshow.close_subsection = False | |
219 | cell.metadata.slideshow.close_section = False |
|
213 | cell.metadata.slideshow.close_section = False | |
220 |
|
214 | |||
221 | cell.metadata.slideshow.open_section = self.maybe_open_section() |
|
215 | cell.metadata.slideshow.open_section = self.maybe_open_section() | |
222 | cell.metadata.slideshow.open_subsection = self.maybe_open_subsection() |
|
216 | cell.metadata.slideshow.open_subsection = self.maybe_open_subsection() | |
223 | cell.metadata.slideshow.open_fragment = self.open_fragment() |
|
217 | cell.metadata.slideshow.open_fragment = self.open_fragment() | |
@@ -226,7 +220,7 b' class RevealHelpTransformer(ConfigurableTransformers):' | |||||
226 | cell.metadata.slideshow.close_fragment = self.maybe_close_fragment() |
|
220 | cell.metadata.slideshow.close_fragment = self.maybe_close_fragment() | |
227 | cell.metadata.slideshow.close_subsection = self.maybe_close_subsection() |
|
221 | cell.metadata.slideshow.close_subsection = self.maybe_close_subsection() | |
228 | cell.metadata.slideshow.close_section = False |
|
222 | cell.metadata.slideshow.close_section = False | |
229 |
|
223 | |||
230 | cell.metadata.slideshow.open_section = self.maybe_open_section() |
|
224 | cell.metadata.slideshow.open_section = self.maybe_open_section() | |
231 | cell.metadata.slideshow.open_subsection = self.open_subsection() |
|
225 | cell.metadata.slideshow.open_subsection = self.open_subsection() | |
232 | cell.metadata.slideshow.open_fragment = False |
|
226 | cell.metadata.slideshow.open_fragment = False | |
@@ -234,7 +228,7 b' class RevealHelpTransformer(ConfigurableTransformers):' | |||||
234 | cell.metadata.slideshow.close_fragment = self.maybe_close_fragment() |
|
228 | cell.metadata.slideshow.close_fragment = self.maybe_close_fragment() | |
235 | cell.metadata.slideshow.close_subsection = self.maybe_close_subsection() |
|
229 | cell.metadata.slideshow.close_subsection = self.maybe_close_subsection() | |
236 | cell.metadata.slideshow.close_section = self.maybe_close_section() |
|
230 | cell.metadata.slideshow.close_section = self.maybe_close_section() | |
237 |
|
231 | |||
238 | cell.metadata.slideshow.open_section = self.open_section() |
|
232 | cell.metadata.slideshow.open_section = self.open_section() | |
239 | cell.metadata.slideshow.open_subsection = self.open_subsection() |
|
233 | cell.metadata.slideshow.open_subsection = self.open_subsection() | |
240 | cell.metadata.slideshow.open_fragment = False |
|
234 | cell.metadata.slideshow.open_fragment = False |
General Comments 0
You need to be logged in to leave comments.
Login now