Skip to content

Commit 9d70e97

Browse files
authored
Merge pull request #98 from pyexcel/dev
Release 0.6.3
2 parents aa5e1b0 + 7adcec9 commit 9d70e97

File tree

13 files changed

+75
-56
lines changed

13 files changed

+75
-56
lines changed

CHANGELOG.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
Change log
22
================================================================================
33

4+
0.6.3 - 12.10.2020
5+
--------------------------------------------------------------------------------
6+
7+
**fixed**
8+
9+
#. `#96 <https://github.com/pyexcel/pyexcel-io/issues/96>`_: regression: unknown
10+
file type shall trigger NoSupportingPluginFound
11+
12+
**updated**
13+
14+
#. extra dependencies uses 0.6.0 based plugins
15+
416
0.6.2 - 7.10.2020
517
--------------------------------------------------------------------------------
618

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ that the following conditions are met:
1313
and/or other materials provided with the distribution.
1414

1515
* Neither the name of 'pyexcel-io' nor the names of the contributors
16-
may be used to endorse or promote products derived from this software
16+
may not be used to endorse or promote products derived from this software
1717
without specific prior written permission.
1818

1919
THIS SOFTWARE AND DOCUMENTATION IS PROVIDED BY THE COPYRIGHT HOLDERS AND

README.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ pyexcel-io - Let you focus on data, instead of file formats
2929
.. image:: https://img.shields.io/gitter/room/gitterHQ/gitter.svg
3030
:target: https://gitter.im/pyexcel/Lobby
3131

32+
.. image:: https://img.shields.io/static/v1?label=continuous%20templating&message=%E6%A8%A1%E7%89%88%E6%9B%B4%E6%96%B0&color=blue&style=flat-square
33+
:target: https://moban.readthedocs.io/en/latest/#at-scale-continous-templating-for-open-source-projects
34+
35+
.. image:: https://img.shields.io/static/v1?label=coding%20style&message=black&color=black&style=flat-square
36+
:target: https://github.com/psf/black
3237
.. image:: https://readthedocs.org/projects/pyexcel-io/badge/?version=latest
3338
:target: http://pyexcel-io.readthedocs.org/en/latest/
3439

changelog.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
name: pyexcel-io
22
organisation: pyexcel
33
releases:
4+
- changes:
5+
- action: fixed
6+
details:
7+
- "`#96`: regression: unknown file type shall trigger NoSupportingPluginFound"
8+
- action: updated
9+
details:
10+
- "extra dependencies uses 0.6.0 based plugins"
11+
version: 0.6.3
12+
date: 12.10.2020
413
- changes:
514
- action: updated
615
details:

docs/source/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
copyright = '2015-2020 Onni Software Ltd.'
2727
author = 'chfw'
2828
# The short X.Y version
29-
version = '0.6.2'
29+
version = '0.6.3'
3030
# The full version, including alpha/beta/rc tags
31-
release = '0.6.2'
31+
release = '0.6.3'
3232

3333
# -- General configuration ---------------------------------------------------
3434

pyexcel-io.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ overrides: "pyexcel.yaml"
22
project: "pyexcel-io"
33
name: pyexcel-io
44
nick_name: io
5-
version: 0.6.2
6-
current_version: 0.6.2
7-
release: 0.6.2
5+
version: 0.6.3
6+
current_version: 0.6.3
7+
release: 0.6.3
88
copyright_year: 2015-2020
99
moban_command: false
1010
is_on_conda: true
@@ -17,11 +17,11 @@ test_dependencies:
1717
- pyexcel-xlsxw
1818
extra_dependencies:
1919
- xls:
20-
- pyexcel-xls>=0.5.0
20+
- pyexcel-xls>=0.6.0
2121
- xlsx:
22-
- pyexcel-xlsx>=0.5.0
22+
- pyexcel-xlsx>=0.6.0
2323
- ods:
24-
- pyexcel-ods3>=0.5.0
24+
- pyexcel-ods3>=0.6.0
2525
keywords:
2626
- API
2727
- tsv

pyexcel_io/exceptions.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,6 @@ class SupportingPluginAvailableButNotInstalled(Exception):
2121
pass
2222

2323

24-
class UpgradePlugin(Exception):
25-
"""raised when a known plugin is not compatible"""
26-
27-
pass
28-
29-
3024
class IntegerAccuracyLossError(Exception):
3125
"""
3226
When an interger is greater than 999999999999999, ods loses its accuracy.

pyexcel_io/reader.py

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from pyexcel_io import exceptions
2-
from pyexcel_io.book import _convert_content_to_stream
31
from pyexcel_io.sheet import SheetReader
42
from pyexcel_io.plugins import NEW_READERS
53
from pyexcel_io._compact import OrderedDict
@@ -53,23 +51,14 @@ def open(self, file_name, **keywords):
5351

5452
def open_content(self, file_content, **keywords):
5553
self.keywords, native_sheet_keywords = clean_keywords(keywords)
56-
try:
57-
if self.reader_class is None:
58-
self.reader_class = NEW_READERS.get_a_plugin(
59-
self.file_type, location="content", library=self.library
60-
)
61-
self.reader = self.reader_class(
62-
file_content, self.file_type, **native_sheet_keywords
63-
)
64-
return self.reader
65-
except (
66-
exceptions.NoSupportingPluginFound,
67-
exceptions.SupportingPluginAvailableButNotInstalled,
68-
):
69-
file_stream = _convert_content_to_stream(
70-
file_content, self.file_type
54+
if self.reader_class is None:
55+
self.reader_class = NEW_READERS.get_a_plugin(
56+
self.file_type, location="content", library=self.library
7157
)
72-
return self.open_stream(file_stream, **native_sheet_keywords)
58+
self.reader = self.reader_class(
59+
file_content, self.file_type, **native_sheet_keywords
60+
)
61+
return self.reader
7362

7463
def open_stream(self, file_stream, **keywords):
7564
self.keywords, native_sheet_keywords = clean_keywords(keywords)

pyexcel_io/readers/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,9 @@
2929
file_types=["csvz", "tsvz"],
3030
locations=["file", "memory"],
3131
stream_type="binary",
32+
).add_a_reader(
33+
relative_plugin_class_path="csvz.ContentReader",
34+
file_types=["csvz", "tsvz"],
35+
locations=["content"],
36+
stream_type="binary",
3237
)

pyexcel_io/readers/csvz.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
:license: New BSD License, see LICENSE for more details
99
"""
1010
import zipfile
11+
from io import BytesIO
1112

1213
import chardet
1314
from pyexcel_io import constants
@@ -48,6 +49,12 @@ def read_sheet(self, index):
4849
return CSVinMemoryReader(NamedContent(name, sheet), **self.keywords)
4950

5051

52+
class ContentReader(FileReader):
53+
def __init__(self, file_content, file_type, **keywords):
54+
io = BytesIO(file_content)
55+
super().__init__(io, file_type, **keywords)
56+
57+
5158
def _get_sheet_name(filename):
5259
len_of_a_dot = 1
5360
len_of_csv_word = 3

0 commit comments

Comments
 (0)