Skip to content

Commit

Permalink
added fix for issue #59
Browse files Browse the repository at this point in the history
  • Loading branch information
PydPiper committed Nov 2, 2021
1 parent fc1de19 commit 4bd2d95
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions doc/source/revlog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Revision Log

pypi version 1.59 (in-work)
---------------------------
- bug fix: error in printing formulas that were read in as None type, see issue `#59 <https://github.com/PydPiper/pylightxl/issues/59>`_

pypi version 1.58
-----------------
Expand Down
4 changes: 2 additions & 2 deletions pylightxl/pylightxl.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,9 +448,9 @@ def readxl_scrape(fn, fn_ws, sharedString, styles, comments):
cell_type = tag_cell.get('t')
cell_style = int(tag_cell.get('s')) if tag_cell.get('s') is not None else 0
tag_val = tag_cell.find('./default:v', ns)
cell_val = tag_val.text if tag_val is not None else ''
cell_val = tag_val.text or '' if tag_val is not None else ''
tag_formula = tag_cell.find('./default:f', ns)
cell_formula = tag_formula.text if tag_formula is not None else ''
cell_formula = tag_formula.text or '' if tag_formula is not None else ''
comment = comments[cell_address] if cell_address in comments.keys() else ''

if all([entry == '' or entry is None for entry in [cell_val, cell_formula, comment]]):
Expand Down
Binary file modified test/newopenpyxl.xlsx
Binary file not shown.

0 comments on commit 4bd2d95

Please sign in to comment.