🐛 exception when the type of currency is missing. fix #27

This commit is contained in:
chfw 2018-05-23 08:35:20 +01:00
parent f4f4f51884
commit 2b339183ef
5 changed files with 11 additions and 8 deletions

View File

@ -7,5 +7,5 @@ release: 0.5.2
file_type: ods
dependencies:
- pyexcel-io>=0.5.3
- odfpy>=1.3.3
- odfpy==1.3.5
description: A wrapper library to read, manipulate and write data in ods format

View File

@ -69,7 +69,10 @@ class ODSSheet(SheetReader):
elif cell_type == "currency":
value = cell.getAttrNS(OFFICENS, value_token)
currency = cell.getAttrNS(OFFICENS, cell_type)
ret = value + ' ' + currency
if currency:
ret = value + ' ' + currency
else:
ret = value
else:
if cell_type in service.VALUE_CONVERTERS:
value = cell.getAttrNS(OFFICENS, value_token)

View File

@ -1,2 +1,2 @@
pyexcel-io>=0.5.3
odfpy>=1.3.3
odfpy==1.3.5

View File

@ -36,7 +36,7 @@ CLASSIFIERS = [
INSTALL_REQUIRES = [
'pyexcel-io>=0.5.3',
'odfpy>=1.3.3',
'odfpy==1.3.5',
]
SETUP_COMMANDS = {}

View File

@ -134,10 +134,10 @@ def test_issue_24():
eq_(data['Sheet1'], [['test']])
def test_issue_25():
test_file = get_fixtures("comment-in-cell.ods")
data = get_data(test_file)
print(data)
def test_issue_27():
test_file = get_fixtures("issue_27.ods")
data = get_data(test_file, skip_empty_rows=True)
eq_(data['VGPMX'], [['', 'Cost Basis', '0']])
def get_fixtures(filename):