Skip to content

Commit b8f6475

Browse files
fix page order bug
1 parent 6b2c423 commit b8f6475

3 files changed

Lines changed: 14 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## v0.5.2 (2020-07-14)
2+
3+
* Fix page order bug in `presalytics.lib.tools.ooxml_tools.create_pages_from_ooxml_document`
4+
15
## v0.5.1 (2020-05-21)
26

37
* Add json endpoint to presaltyics story

presalytics/lib/tools/ooxml_tools.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,8 @@ def create_pages_from_ooxml_document(story: 'Story',
202202
203203
"""
204204
pages = []
205+
order = []
206+
pages_unordered = []
205207
client = presalytics.Client(**client_info)
206208
child_objects = client.ooxml_automation.documents_childobjects_get_id(ooxml_document.id)
207209
document_type = client.ooxml_automation.documents_documenttype_typeid_get_type_id(ooxml_document.document_type_id)
@@ -228,13 +230,18 @@ def create_pages_from_ooxml_document(story: 'Story',
228230
name=widget_name,
229231
widgets=widgets
230232
)
231-
pages.append(page)
233+
234+
this_slide_meta = client.ooxml_automation.slides_slides_get_id(slide.entity_id)
235+
order.append(this_slide_meta.number -1)
236+
pages_unordered.append(page)
232237
except:
233238
logger.error("Unable to add widget {0} to outline ooxml document {1}".format(slide.entity_name, ooxml_document.id))
234239
# TODO: insert excel chart handling here
240+
for j in range(0, len(order)):
241+
idx = order.index(j)
242+
pages.append(pages_unordered[idx])
235243
return pages
236244

237-
238245
def create_theme_from_ooxml_document(document_id: str, client_info={}):
239246
"""
240247
Creates a `presalytics.story.outline.Theme` object from an Presalytics API ooxml_document object

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from setuptools import setup, find_packages # noqa: H301
1111

1212
NAME = "presalytics"
13-
VERSION = "0.5.1"
13+
VERSION = "0.5.2"
1414

1515
# To install the library, run the following
1616
#

0 commit comments

Comments
 (0)