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

Added whitespace handling in cell #22

Merged
merged 1 commit into from
Aug 23, 2017
Merged

Added whitespace handling in cell #22

merged 1 commit into from
Aug 23, 2017

Conversation

winterheart
Copy link
Contributor

This fixes bug where pyexcel-ods cannot parse multiple whitespaces (<text:s text:c="2"/> and such).

Sorry I don't have test unit for that.

This fixes bug where pyexcel-ods cannot parse multiple whitespaces
(<text:s text:c="2"/> and such).
@chfw
Copy link
Member

chfw commented Aug 21, 2017

Could you please supply a test fixture and a test case for it?

@winterheart
Copy link
Contributor Author

Well, I'm not skilled with tests. Here example:

import pyexcel_ods
from collections import OrderedDict

workbook = OrderedDict()
workbook.update({'Sheet 1': [["    Heading spaces"],
                             ["Spaces    between"],
                             ["Trailing spaces    "]]})

pyexcel_ods.save_data("test.ods", workbook)
workbook = pyexcel_ods.get_data("test.ods")
spreadsheet = list(workbook.items())

for row in spreadsheet[0][1]:
    print("'%s'" % row[0])

@chfw
Copy link
Member

chfw commented Aug 23, 2017

The test fails. But your proposal shred the light for a better implementation. I would merge the PR and put my changes in too.

@chfw chfw merged commit ffce4b2 into pyexcel:master Aug 23, 2017
@winterheart winterheart deleted the whitespaces branch August 24, 2017 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants