diff --git a/pyexcel_ods/odsr.py b/pyexcel_ods/odsr.py index 1e13a62..f4b6c9e 100644 --- a/pyexcel_ods/odsr.py +++ b/pyexcel_ods/odsr.py @@ -22,8 +22,6 @@ # limitations under the License. # Thanks to grt for the fixes -from io import UnsupportedOperation - from odf.teletype import extractText from odf.table import TableRow, TableCell, Table from odf.text import P @@ -32,7 +30,7 @@ from pyexcel_io.book import BookReader from pyexcel_io.sheet import SheetReader -from pyexcel_io._compact import OrderedDict, BytesIO +from pyexcel_io._compact import OrderedDict import pyexcel_io.service as service @@ -104,16 +102,6 @@ def open(self, file_name, **keywords): def open_stream(self, file_stream, **keywords): """open ods file stream""" - if not hasattr(file_stream, 'seek'): - # python 2 - # Hei zipfile in odfpy would do a seek - # but stream from urlib cannot do seek - file_stream = BytesIO(file_stream.read()) - try: - file_stream.seek(0) - except UnsupportedOperation: - # python 3 - file_stream = BytesIO(file_stream.read()) BookReader.open_stream(self, file_stream, **keywords) self._load_from_memory() diff --git a/pyexcel_ods/odsw.py b/pyexcel_ods/odsw.py index 87856c5..3be88c2 100644 --- a/pyexcel_ods/odsw.py +++ b/pyexcel_ods/odsw.py @@ -17,7 +17,7 @@ from pyexcel_io.book import BookWriter from pyexcel_io.sheet import SheetWriter -import pyexcel_ods.converter as converter +import pyexcel_io.service as converter PY2 = sys.version_info[0] == 2 diff --git a/tests/test_bug_fixes.py b/tests/test_bug_fixes.py index 4bf4460..c5c3d89 100644 --- a/tests/test_bug_fixes.py +++ b/tests/test_bug_fixes.py @@ -24,25 +24,6 @@ def test_bug_fix_for_issue_2(): assert new_data["Sheet 2"] == [[u'row 1', u'H\xe9ll\xf4!', u'Hol\xc1!']] -def test_date_util_parse(): - from pyexcel_ods.converter import date_value - value = "2015-08-17T19:20:00" - d = date_value(value) - assert d.strftime("%Y-%m-%dT%H:%M:%S") == "2015-08-17T19:20:00" - value = "2015-08-17" - d = date_value(value) - assert d.strftime("%Y-%m-%d") == "2015-08-17" - value = "2015-08-17T19:20:59.999999" - d = date_value(value) - assert d.strftime("%Y-%m-%dT%H:%M:%S") == "2015-08-17T19:20:59" - value = "2015-08-17T19:20:59.99999" - d = date_value(value) - assert d.strftime("%Y-%m-%dT%H:%M:%S") == "2015-08-17T19:20:59" - value = "2015-08-17T19:20:59.999999999999999" - d = date_value(value) - assert d.strftime("%Y-%m-%dT%H:%M:%S") == "2015-08-17T19:20:59" - - @raises(Exception) def test_invalid_date(): from pyexcel_ods.ods import date_value