🤝 merge with master

This commit is contained in:
chfw 2019-04-04 21:40:11 +01:00
commit 1a47d9e917
8 changed files with 44 additions and 19 deletions

View File

@ -1,6 +1,15 @@
Change log
================================================================================
0.5.17 - 04.04.2019
--------------------------------------------------------------------------------
updated
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#. `#68 <https://github.com/pyexcel/pyexcel-io/issues/68>`_: Raise IOError when
the data file does not exist
0.5.16 - 19.03.2019
--------------------------------------------------------------------------------

View File

@ -1,6 +1,12 @@
name: pyexcel-io
organisation: pyexcel
releases:
- changes:
- action: updated
details:
- '`#68`: Raise IOError when the data file does not exist'
version: 0.5.17
date: 04.04.2019
- changes:
- action: updated
details:

View File

@ -20,9 +20,9 @@ project = 'pyexcel-io'
copyright = 'copyright 2015-2019 Onni Software Ltd.'
author = 'C.W.'
# The short X.Y version
version = '0.5.16'
version = '0.6.0'
# The full version, including alpha/beta/rc tags
release = '0.5.16'
release = '0.5.17'
# -- General configuration ---------------------------------------------------

View File

@ -10,6 +10,7 @@
:Source code: http://github.com/pyexcel/pyexcel-io.git
:Issues: http://github.com/pyexcel/pyexcel-io/issues
:License: New BSD License
:Development: |release|
:Released: |version|
:Generated: |today|

View File

@ -2,10 +2,10 @@ overrides: "pyexcel.yaml"
project: "pyexcel-io"
name: pyexcel-io
nick_name: io
version: 0.5.16
current_version: 0.5.16
release: 0.5.16
version: 0.6.0
current_version: 0.6.0
copyright_year: 2015-2019
release: 0.5.17
dependencies:
- ordereddict;python_version<"2.7"
- lml>=0.0.4

View File

@ -7,12 +7,13 @@
:copyright: (c) 2014-2017 by Onni Software Ltd.
:license: New BSD License, see LICENSE for more details
"""
import os
import warnings
from types import GeneratorType
import pyexcel_io.constants as constants
from pyexcel_io._compact import isstream, PY2
from pyexcel_io.plugins import READERS, WRITERS
from pyexcel_io._compact import PY2, isstream
from pyexcel_io.exceptions import NoSupportingPluginFound
def iget_data(afile, file_type=None, **keywords):
@ -166,7 +167,15 @@ def load_data(
except AttributeError:
raise Exception("file_name should be a string type")
reader = READERS.get_a_plugin(file_type, library)
try:
reader = READERS.get_a_plugin(file_type, library)
except NoSupportingPluginFound:
if file_name:
if not os.path.exists(file_name):
raise IOError("%s does not exist" % file_name)
else:
raise
if file_name:
reader.open(file_name, **keywords)
elif file_content:

View File

@ -29,15 +29,15 @@ except (ValueError, UnicodeError, locale.Error):
NAME = 'pyexcel-io'
AUTHOR = 'C.W.'
VERSION = '0.5.16'
EMAIL = 'wangc_2011@hotmail.com'
VERSION = '0.6.0'
EMAIL = 'info@pyexcel.org'
LICENSE = 'New BSD'
DESCRIPTION = (
'A python library to read and write structured data in csv, zipped csv' +
'format and to/from databases'
)
URL = 'https://github.com/pyexcel/pyexcel-io'
DOWNLOAD_URL = '%s/archive/0.5.16.tar.gz' % URL
DOWNLOAD_URL = '%s/archive/0.5.17.tar.gz' % URL
FILES = ['README.rst', 'CHANGELOG.rst']
KEYWORDS = [
'python',
@ -81,8 +81,8 @@ EXTRAS_REQUIRE = {
# You do not need to read beyond this line
PUBLISH_COMMAND = '{0} setup.py sdist bdist_wheel upload -r pypi'.format(
sys.executable)
GS_COMMAND = ('gs pyexcel-io v0.5.16 ' +
"Find 0.5.16 in changelog for more details")
GS_COMMAND = ('gs pyexcel-io v0.5.17 ' +
"Find 0.5.17 in changelog for more details")
NO_GS_MESSAGE = ('Automatic github release is disabled. ' +
'Please install gease to enable it.')
UPLOAD_FAILED_MSG = (

View File

@ -23,6 +23,11 @@ def test_force_file_type():
eq_(expected, data[test_file])
@raises(IOError)
def test_invalid_file():
load_data('/something/does/not/exist')
@raises(IOError)
def test_no_valid_parameters():
load_data()
@ -83,7 +88,7 @@ def test_write_xlsx_data_to_memory():
eq_(str(e), msg)
@raises(exceptions.NoSupportingPluginFound)
@raises(IOError)
def test_load_unknown_data():
get_data("test.unknown")
@ -108,11 +113,6 @@ def test_write_xlsx_data():
get_data("test.xlsx")
@raises(exceptions.NoSupportingPluginFound)
def test_write_unknown_data():
get_data("test.unknown")
@raises(Exception)
def test_writer_csvz_data_from_memory():
if not PY2: