Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid crashing on weird ws ordering #28

Merged
merged 1 commit into from
Jan 5, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pylightxl/pylightxl.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def readxl(fn, ws=None):
# scrape each sheet#.xml file
if ws is None:
# get all worksheets
for order in range(1, len(ordered_ws) + 1):
for order in sorted(ordered_ws.keys()):
worksheet = ordered_ws[order]
fn_ws = wb_rels['ws'][worksheet]['fn_ws']
data = readxl_scrape(fn, fn_ws, sharedString)
Expand All @@ -141,7 +141,7 @@ def readxl(fn, ws=None):
for worksheet in ws:
if worksheet not in wb_rels['ws'].keys():
raise UserWarning('pylightxl - Sheetname ({}) is not in the workbook.'.format(worksheet))
for order in range(1, len(ordered_ws) + 1):
for order in sorted(ordered_ws.keys()):
worksheet = ordered_ws[order]
if worksheet in ws:
fn_ws = wb_rels['ws'][worksheet]['fn_ws']
Expand Down