Showing 18 of 41 files from the diff.

@@ -198,8 +198,7 @@
Loading
198 198
    message="Deprecated since v0.0.7! Please use class Book instead",
199 199
)
200 200
def BookReader(file_name, **keywords):
201 -
    """For backward compatibility
202 -
    """
201 +
    """For backward compatibility"""
203 202
    return load_book(file_name, **keywords)
204 203
205 204

@@ -294,8 +294,7 @@
Loading
294 294
        return self._ref.named_column_at(the_attr)
295 295
296 296
    def format(self, column_index=None, formatter=None, format_specs=None):
297 -
        """Format a column
298 -
        """
297 +
        """Format a column"""
299 298
        if column_index is not None:
300 299
            self._handle_one_formatter(column_index, formatter)
301 300
        elif format_specs:

@@ -222,8 +222,7 @@
Loading
222 222
        save_as(dest_file_name=self.testfile, adict=self.data)
223 223
224 224
    def test_general_usage(self):
225 -
        """format a row
226 -
        """
225 +
        """format a row"""
227 226
        r = get_sheet(file_name=self.testfile)
228 227
        r.row.format(1, str)
229 228
        c1 = r.row_at(1)
@@ -231,8 +230,7 @@
Loading
231 230
        self.assertEqual(c1, c2)
232 231
233 232
    def test_general_usage2(self):
234 -
        """format a row
235 -
        """
233 +
        """format a row"""
236 234
        r = get_sheet(file_name=self.testfile)
237 235
        r.row.format(1, str)
238 236
        c1 = r.row_at(1)
@@ -240,8 +238,7 @@
Loading
240 238
        self.assertEqual(c1, c2)
241 239
242 240
    def test_one_formatter_for_two_rows(self):
243 -
        """format more than one row
244 -
        """
241 +
        """format more than one row"""
245 242
        r = get_sheet(file_name=self.testfile)
246 243
        r.row.format([1, 2], str)
247 244
        c1 = r.row_at(2)

@@ -237,8 +237,7 @@
Loading
237 237
        return new_instance
238 238
239 239
    def format(self, row_index=None, formatter=None, format_specs=None):
240 -
        """Format a row
241 -
        """
240 +
        """Format a row"""
242 241
        if row_index is not None:
243 242
            self._handle_one_formatter(row_index, formatter)
244 243
        elif format_specs:

@@ -15,8 +15,7 @@
Loading
15 15
16 16
# pylint: disable=W0223
17 17
class ReadExcelFromFile(AbstractSource):
18 -
    """Pick up 'file_name' field and do single sheet based read and write
19 -
    """
18 +
    """Pick up 'file_name' field and do single sheet based read and write"""
20 19
21 20
    def __init__(self, file_name=None, parser_library=None, **keywords):
22 21
        self.__file_name = file_name

@@ -9,12 +9,12 @@
Loading
9 9
"""
10 10
from pyexcel import constants as constants
11 11
from pyexcel import exceptions as exceptions
12 +
from lml.plugin import PluginManager
12 13
from pyexcel.internal.attributes import (
13 14
    register_book_attribute,
14 15
    register_sheet_attribute,
15 16
)
16 17
17 -
from lml.plugin import PluginManager
18 18
from pyexcel_io import constants as io_constants
19 19
20 20
REGISTRY_KEY_FORMAT = "%s-%s"
@@ -60,7 +60,7 @@
Loading
60 60
    def get_a_plugin(
61 61
        self, target=None, action=None, source_library=None, **keywords
62 62
    ):
63 -
        """obtain a source plugin for pyexcel signature functions"""
63 +
        """obtain a source plugin for signature functions"""
64 64
        key = REGISTRY_KEY_FORMAT % (target, action)
65 65
        io_library = None
66 66
        # backward support pyexcel-io library parameter
@@ -75,26 +75,25 @@
Loading
75 75
        return source_instance
76 76
77 77
    def get_source(self, **keywords):
78 -
        """obtain a sheet read source plugin for pyexcel signature functions"""
78 +
        """obtain a sheet read source plugin for signature functions"""
79 79
        return self.get_a_plugin(
80 80
            target=constants.SHEET, action=constants.READ_ACTION, **keywords
81 81
        )
82 82
83 83
    def get_book_source(self, **keywords):
84 -
        """obtain a book read source plugin for pyexcel signature functions"""
84 +
        """obtain a book read source plugin for signature functions"""
85 85
        return self.get_a_plugin(
86 86
            target=constants.BOOK, action=constants.READ_ACTION, **keywords
87 87
        )
88 88
89 89
    def get_writable_source(self, **keywords):
90 -
        """obtain a sheet write source plugin for pyexcel signature functions
91 -
        """
90 +
        """obtain a sheet write source plugin for signature functions"""
92 91
        return self.get_a_plugin(
93 92
            target=constants.SHEET, action=constants.WRITE_ACTION, **keywords
94 93
        )
95 94
96 95
    def get_writable_book_source(self, **keywords):
97 -
        """obtain a book write source plugin for pyexcel signature functions"""
96 +
        """obtain a book write source plugin for signature functions"""
98 97
        return self.get_a_plugin(
99 98
            target=constants.BOOK, action=constants.WRITE_ACTION, **keywords
100 99
        )

@@ -14,8 +14,7 @@
Loading
14 14
15 15
# pylint: disable=W0223
16 16
class WriteSheetToFile(AbstractSource):
17 -
    """Pick up 'file_name' field and do single sheet based read and write
18 -
    """
17 +
    """Pick up 'file_name' field and do single sheet based read and write"""
19 18
20 19
    def __init__(self, file_name=None, renderer_library=None, **keywords):
21 20
        AbstractSource.__init__(self, **keywords)
@@ -36,8 +35,7 @@
Loading
36 35
37 36
# pylint: disable=W0223
38 37
class WriteBookToFile(WriteSheetToFile):
39 -
    """Pick up 'file_name' field and do multiple sheet based read and write
40 -
    """
38 +
    """Pick up 'file_name' field and do multiple sheet based read and write"""
41 39
42 40
    def write_data(self, book):
43 41
        self._renderer.render_book_to_file(

@@ -11,15 +11,13 @@
Loading
11 11
12 12
13 13
class IOPluginManager(PluginManager):
14 -
    """Generic plugin manager for renderer and parser
15 -
    """
14 +
    """Generic plugin manager for renderer and parser"""
16 15
17 16
    def __init__(self, name):
18 17
        PluginManager.__init__(self, name)
19 18
20 19
    def get_a_plugin(self, key, library=None):
21 -
        """get a plugin to handle the file type
22 -
        """
20 +
        """get a plugin to handle the file type"""
23 21
        __file_type = None
24 22
        if key:
25 23
            __file_type = key.lower()
@@ -28,8 +26,7 @@
Loading
28 26
        return plugin_cls(__file_type)
29 27
30 28
    def get_all_file_types(self):
31 -
        """get all supported file types
32 -
        """
29 +
        """get all supported file types"""
33 30
        file_types = list(self.registry.keys())
34 31
        return file_types
35 32

@@ -47,8 +47,7 @@
Loading
47 47
48 48
49 49
def analyse_slice(aslice, upper_bound):
50 -
    """An internal function to analyze a given slice
51 -
    """
50 +
    """An internal function to analyze a given slice"""
52 51
    if aslice.start is None:
53 52
        start = 0
54 53
    else:

@@ -10,7 +10,8 @@
Loading
10 10
from pyexcel import constants as constants
11 11
from pyexcel.source import AbstractSource
12 12
13 -
from pyexcel_io.database.querysets import QuerysetsReader
13 +
from pyexcel_io import get_data
14 +
from pyexcel_io.constants import DB_QUERYSET
14 15
from . import params
15 16
16 17
@@ -67,8 +68,11 @@
Loading
67 68
        )
68 69
        if self.__skip_row_func is not None:
69 70
            local_params["skip_row_func"] = self.__skip_row_func
70 -
        reader = QuerysetsReader(
71 -
            self.__query_sets, self.__column_names, **local_params
71 +
72 +
        data = get_data(
73 +
            self.__query_sets,
74 +
            file_type=DB_QUERYSET,
75 +
            column_names=self.__column_names,
76 +
            **local_params
72 77
        )
73 -
        data = reader.to_array()
74 -
        return {self.__sheet_name: data}
78 +
        return data

@@ -19,8 +19,7 @@
Loading
19 19
20 20
21 21
def make_presenter(source_getter, attribute=None):
22 -
    """make a custom presentation method for each file types
23 -
    """
22 +
    """make a custom presentation method for each file types"""
24 23
25 24
    def custom_presenter(self, **keywords):
26 25
        """docstring is assigned a few lines down the line"""
@@ -42,22 +41,19 @@
Loading
42 41
43 42
44 43
def sheet_presenter(attribute=None):
45 -
    """make a custom presentation method for sheet
46 -
    """
44 +
    """make a custom presentation method for sheet"""
47 45
    source_getter = SOURCE.get_writable_source
48 46
    return make_presenter(source_getter, attribute)
49 47
50 48
51 49
def book_presenter(attribute=None):
52 -
    """make a custom presentation method for book
53 -
    """
50 +
    """make a custom presentation method for book"""
54 51
    source_getter = SOURCE.get_writable_book_source
55 52
    return make_presenter(source_getter, attribute)
56 53
57 54
58 55
def importer(attribute=None):
59 -
    """make a custom input method for sheet
60 -
    """
56 +
    """make a custom input method for sheet"""
61 57
62 58
    def custom_importer1(self, content, **keywords):
63 59
        """docstring is assigned a few lines down the line"""
@@ -79,8 +75,7 @@
Loading
79 75
80 76
81 77
def book_importer(attribute=None):
82 -
    """make a custom input method for book
83 -
    """
78 +
    """make a custom input method for book"""
84 79
85 80
    def custom_book_importer(self, content, **keywords):
86 81
        """docstring is assigned a few lines down the line"""
@@ -261,8 +256,7 @@
Loading
261 256
262 257
    @append_doc(docs.SAVE_AS_OPTIONS)
263 258
    def save_as(self, filename, **keywords):
264 -
        """Save the content to a named file
265 -
        """
259 +
        """Save the content to a named file"""
266 260
        return save_sheet(self, file_name=filename, **keywords)
267 261
268 262
    def save_to_memory(self, file_type, stream=None, **keywords):

@@ -111,8 +111,7 @@
Loading
111 111
            raise IndexError(constants.MESSAGE_INDEX_OUT_OF_RANGE)
112 112
113 113
    def set_row_at(self, row_index, data_array):
114 -
        """Update a row data range
115 -
        """
114 +
        """Update a row data range"""
116 115
        nrows = self.number_of_rows()
117 116
        if row_index < nrows:
118 117
            self.__array[row_index] = data_array
@@ -449,8 +448,7 @@
Loading
449 448
        self.__width, self.__array = uniform(self.__array)
450 449
451 450
    def delete_columns(self, column_indices):
452 -
        """Delete columns by specified list of indices
453 -
        """
451 +
        """Delete columns by specified list of indices"""
454 452
        if isinstance(column_indices, list) is False:
455 453
            raise TypeError(constants.MESSAGE_DATA_ERROR_DATA_TYPE_MISMATCH)
456 454
        if len(column_indices) > 0:
@@ -502,8 +500,7 @@
Loading
502 500
        self.__width, self.__array = uniform(self.__array)
503 501
504 502
    def to_array(self):
505 -
        """Get an array out
506 -
        """
503 +
        """Get an array out"""
507 504
        return self.__array
508 505
509 506
    def __iter__(self):

@@ -53,8 +53,7 @@
Loading
53 53
        eq_(result, list(actual))
54 54
55 55
    def test_book_reader_to_records_custom(self):
56 -
        """use custom header
57 -
        """
56 +
        """use custom header"""
58 57
        r = pe.SeriesReader(self.testfile)
59 58
        custom_headers = ["O", "P", "Q"]
60 59
        result = [

@@ -11,12 +11,11 @@
Loading
11 11
from itertools import product
12 12
13 13
from pyexcel import constants as constants
14 +
from lml.plugin import PluginInfo, PluginInfoChain
14 15
from pyexcel._compact import is_string
15 16
from pyexcel.exceptions import FileTypeNotSupported
16 17
from pyexcel.internal.plugins import PARSER, RENDERER
17 18
18 -
from lml.plugin import PluginInfo, PluginInfoChain
19 -
20 19
21 20
class SourceInfo(PluginInfo):
22 21
    """Plugin description for a source"""
@@ -133,8 +132,7 @@
Loading
133 132
134 133
135 134
class PyexcelPluginChain(PluginInfoChain):
136 -
    """It is used by pyexcel plugins
137 -
    """
135 +
    """It is used by pyexcel plugins"""
138 136
139 137
    def add_a_source(self, relative_plugin_class_path=None, **keywords):
140 138
        """

@@ -40,8 +40,7 @@
Loading
40 40
        self.init(sheets=sheets, filename=filename, path=path)
41 41
42 42
    def init(self, sheets=None, filename="memory", path=None):
43 -
        """indpendent function so that it could be called multiple times
44 -
        """
43 +
        """indpendent function so that it could be called multiple times"""
45 44
        self.__path = path
46 45
        self.filename = filename
47 46
        self.load_from_sheets(sheets)
@@ -218,8 +217,7 @@
Loading
218 217
219 218
220 219
def to_book(bookstream):
221 -
    """Convert a bookstream to Book
222 -
    """
220 +
    """Convert a bookstream to Book"""
223 221
    if isinstance(bookstream, Book):
224 222
        return bookstream
225 223
    else:

@@ -1,2 +1,2 @@
Loading
1 -
__version__ = '0.6.4'
2 -
__author__ = 'C.W.'
1 +
__version__ = '0.6.5'
2 +
__author__ = 'chfw'

@@ -82,15 +82,13 @@
Loading
82 82
        m.extend_columns(1.1)
83 83
84 84
    def test_iadd_list(self):
85 -
        """Test in place add a list
86 -
        """
85 +
        """Test in place add a list"""
87 86
        m2 = Matrix(self.data)
88 87
        m2.column += self.data3
89 88
        eq_(self.result, m2.get_internal_array())
90 89
91 90
    def test_add(self):
92 -
        """Test operator add overload
93 -
        """
91 +
        """Test operator add overload"""
94 92
        # +
95 93
        m3 = Matrix(self.data)
96 94
        m4 = m3.column + self.data3

@@ -7,12 +7,11 @@
Loading
7 7
    :copyright: (c) 2015-2020 by Onni Software Ltd.
8 8
    :license: New BSD License
9 9
"""
10 +
from lml.loader import scan_plugins_regex
10 11
from pyexcel.internal.plugins import PARSER, RENDERER  # noqa
11 12
from pyexcel.internal.generators import BookStream, SheetStream  # noqa
12 13
from pyexcel.internal.source_plugin import SOURCE  # noqa
13 14
14 -
from lml.loader import scan_plugins_regex
15 -
16 15
BLACK_LIST = [
17 16
    "pyexcel_io",
18 17
    "pyexcel_webio",
Files Coverage
pyexcel 97.31%
tests 99.05%
Project Totals (103 files) 98.35%
1567.4
TRAVIS_PYTHON_VERSION=3.6
TRAVIS_OS_NAME=linux
1567.2
TRAVIS_PYTHON_VERSION=3.7
TRAVIS_OS_NAME=linux
1567.1
TRAVIS_PYTHON_VERSION=3.8
TRAVIS_OS_NAME=linux
1567.3
TRAVIS_PYTHON_VERSION=3.6
TRAVIS_OS_NAME=linux
1568.3
TRAVIS_PYTHON_VERSION=3.6
TRAVIS_OS_NAME=linux
1568.2
TRAVIS_PYTHON_VERSION=3.7
TRAVIS_OS_NAME=linux
1568.4
TRAVIS_PYTHON_VERSION=3.6
TRAVIS_OS_NAME=linux
1568.1
TRAVIS_PYTHON_VERSION=3.8
TRAVIS_OS_NAME=linux

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading