cli-helpers 2.15.4__tar.gz → 2.15.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {cli_helpers-2.15.4 → cli_helpers-2.15.5}/AUTHORS +1 -0
- {cli_helpers-2.15.4 → cli_helpers-2.15.5}/CHANGELOG +6 -0
- {cli_helpers-2.15.4/cli_helpers.egg-info → cli_helpers-2.15.5}/PKG-INFO +1 -1
- cli_helpers-2.15.5/cli_helpers/__init__.py +1 -0
- {cli_helpers-2.15.4 → cli_helpers-2.15.5}/cli_helpers/tabular_output/output_formatter.py +2 -1
- {cli_helpers-2.15.4 → cli_helpers-2.15.5/cli_helpers.egg-info}/PKG-INFO +1 -1
- {cli_helpers-2.15.4 → cli_helpers-2.15.5}/tests/tabular_output/test_output_formatter.py +12 -0
- cli_helpers-2.15.4/cli_helpers/__init__.py +0 -1
- {cli_helpers-2.15.4 → cli_helpers-2.15.5}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {cli_helpers-2.15.4 → cli_helpers-2.15.5}/.github/workflows/codeql.yml +0 -0
- {cli_helpers-2.15.4 → cli_helpers-2.15.5}/.gitignore +0 -0
- {cli_helpers-2.15.4 → cli_helpers-2.15.5}/.travis/install.sh +0 -0
- {cli_helpers-2.15.4 → cli_helpers-2.15.5}/.travis.yml +0 -0
- {cli_helpers-2.15.4 → cli_helpers-2.15.5}/CONTRIBUTING.rst +0 -0
- {cli_helpers-2.15.4 → cli_helpers-2.15.5}/LICENSE +0 -0
- {cli_helpers-2.15.4 → cli_helpers-2.15.5}/MANIFEST.in +0 -0
- {cli_helpers-2.15.4 → cli_helpers-2.15.5}/README.rst +0 -0
- {cli_helpers-2.15.4 → cli_helpers-2.15.5}/appveyor.yml +0 -0
- {cli_helpers-2.15.4 → cli_helpers-2.15.5}/cli_helpers/compat.py +0 -0
- {cli_helpers-2.15.4 → cli_helpers-2.15.5}/cli_helpers/config.py +0 -0
- {cli_helpers-2.15.4 → cli_helpers-2.15.5}/cli_helpers/tabular_output/__init__.py +0 -0
- {cli_helpers-2.15.4 → cli_helpers-2.15.5}/cli_helpers/tabular_output/delimited_output_adapter.py +0 -0
- {cli_helpers-2.15.4 → cli_helpers-2.15.5}/cli_helpers/tabular_output/json_output_adapter.py +0 -0
- {cli_helpers-2.15.4 → cli_helpers-2.15.5}/cli_helpers/tabular_output/preprocessors.py +0 -0
- {cli_helpers-2.15.4 → cli_helpers-2.15.5}/cli_helpers/tabular_output/tabulate_adapter.py +0 -0
- {cli_helpers-2.15.4 → cli_helpers-2.15.5}/cli_helpers/tabular_output/tsv_output_adapter.py +0 -0
- {cli_helpers-2.15.4 → cli_helpers-2.15.5}/cli_helpers/tabular_output/vertical_table_adapter.py +0 -0
- {cli_helpers-2.15.4 → cli_helpers-2.15.5}/cli_helpers/utils.py +0 -0
- {cli_helpers-2.15.4 → cli_helpers-2.15.5}/cli_helpers.egg-info/SOURCES.txt +0 -0
- {cli_helpers-2.15.4 → cli_helpers-2.15.5}/cli_helpers.egg-info/dependency_links.txt +0 -0
- {cli_helpers-2.15.4 → cli_helpers-2.15.5}/cli_helpers.egg-info/requires.txt +0 -0
- {cli_helpers-2.15.4 → cli_helpers-2.15.5}/cli_helpers.egg-info/top_level.txt +0 -0
- {cli_helpers-2.15.4 → cli_helpers-2.15.5}/docs/Makefile +0 -0
- {cli_helpers-2.15.4 → cli_helpers-2.15.5}/docs/source/api.rst +0 -0
- {cli_helpers-2.15.4 → cli_helpers-2.15.5}/docs/source/authors.rst +0 -0
- {cli_helpers-2.15.4 → cli_helpers-2.15.5}/docs/source/changelog.rst +0 -0
- {cli_helpers-2.15.4 → cli_helpers-2.15.5}/docs/source/conf.py +0 -0
- {cli_helpers-2.15.4 → cli_helpers-2.15.5}/docs/source/contributing.rst +0 -0
- {cli_helpers-2.15.4 → cli_helpers-2.15.5}/docs/source/index.rst +0 -0
- {cli_helpers-2.15.4 → cli_helpers-2.15.5}/docs/source/license.rst +0 -0
- {cli_helpers-2.15.4 → cli_helpers-2.15.5}/docs/source/quickstart.rst +0 -0
- {cli_helpers-2.15.4 → cli_helpers-2.15.5}/release.py +0 -0
- {cli_helpers-2.15.4 → cli_helpers-2.15.5}/requirements-dev.txt +0 -0
- {cli_helpers-2.15.4 → cli_helpers-2.15.5}/setup.cfg +0 -0
- {cli_helpers-2.15.4 → cli_helpers-2.15.5}/setup.py +0 -0
- {cli_helpers-2.15.4 → cli_helpers-2.15.5}/tasks.py +0 -0
- {cli_helpers-2.15.4 → cli_helpers-2.15.5}/tests/__init__.py +0 -0
- {cli_helpers-2.15.4 → cli_helpers-2.15.5}/tests/compat.py +0 -0
- {cli_helpers-2.15.4 → cli_helpers-2.15.5}/tests/config_data/configrc +0 -0
- {cli_helpers-2.15.4 → cli_helpers-2.15.5}/tests/config_data/configspecrc +0 -0
- {cli_helpers-2.15.4 → cli_helpers-2.15.5}/tests/config_data/invalid_configrc +0 -0
- {cli_helpers-2.15.4 → cli_helpers-2.15.5}/tests/config_data/invalid_configspecrc +0 -0
- {cli_helpers-2.15.4 → cli_helpers-2.15.5}/tests/tabular_output/__init__.py +0 -0
- {cli_helpers-2.15.4 → cli_helpers-2.15.5}/tests/tabular_output/test_delimited_output_adapter.py +0 -0
- {cli_helpers-2.15.4 → cli_helpers-2.15.5}/tests/tabular_output/test_formatter_options.py +0 -0
- {cli_helpers-2.15.4 → cli_helpers-2.15.5}/tests/tabular_output/test_json_output_adapter.py +0 -0
- {cli_helpers-2.15.4 → cli_helpers-2.15.5}/tests/tabular_output/test_preprocessors.py +0 -0
- {cli_helpers-2.15.4 → cli_helpers-2.15.5}/tests/tabular_output/test_tabulate_adapter.py +0 -0
- {cli_helpers-2.15.4 → cli_helpers-2.15.5}/tests/tabular_output/test_tsv_output_adapter.py +0 -0
- {cli_helpers-2.15.4 → cli_helpers-2.15.5}/tests/tabular_output/test_vertical_table_adapter.py +0 -0
- {cli_helpers-2.15.4 → cli_helpers-2.15.5}/tests/test_cli_helpers.py +0 -0
- {cli_helpers-2.15.4 → cli_helpers-2.15.5}/tests/test_config.py +0 -0
- {cli_helpers-2.15.4 → cli_helpers-2.15.5}/tests/test_utils.py +0 -0
- {cli_helpers-2.15.4 → cli_helpers-2.15.5}/tests/utils.py +0 -0
- {cli_helpers-2.15.4 → cli_helpers-2.15.5}/tox.ini +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "2.15.5"
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
from __future__ import unicode_literals
|
|
5
5
|
from collections import namedtuple
|
|
6
|
+
from collections.abc import Iterator
|
|
6
7
|
|
|
7
8
|
from cli_helpers.compat import (
|
|
8
9
|
text_type,
|
|
@@ -162,7 +163,7 @@ class TabularOutputFormatter(object):
|
|
|
162
163
|
fkwargs = fkwargs.copy()
|
|
163
164
|
fkwargs.update(kwargs)
|
|
164
165
|
if column_types is None:
|
|
165
|
-
data = list(data
|
|
166
|
+
data = [list(row) if isinstance(row, Iterator) else row for row in data]
|
|
166
167
|
column_types = self._get_column_types(data)
|
|
167
168
|
for f in unique_items(preprocessors + _preprocessors):
|
|
168
169
|
data, headers = f(data, headers, column_types=column_types, **fkwargs)
|
|
@@ -294,6 +294,18 @@ def test_get_type():
|
|
|
294
294
|
assert data_type is formatter._get_type(value)
|
|
295
295
|
|
|
296
296
|
|
|
297
|
+
@pytest.mark.parametrize(
|
|
298
|
+
"format_name, expected",
|
|
299
|
+
[
|
|
300
|
+
("csv", ["a,b", "1,2", "3,4"]),
|
|
301
|
+
("jsonl", ['{"a":"1","b":"2"}', '{"a":"3","b":"4"}']),
|
|
302
|
+
],
|
|
303
|
+
)
|
|
304
|
+
def test_infer_column_types_from_iterator_rows(format_name, expected):
|
|
305
|
+
rows = (map(str, row) for row in [(1, 2), (3, 4)])
|
|
306
|
+
assert list(format_output(rows, ["a", "b"], format_name)) == expected
|
|
307
|
+
|
|
308
|
+
|
|
297
309
|
def test_provide_column_types():
|
|
298
310
|
"""Test that provided column types are passed to preprocessors."""
|
|
299
311
|
expected_column_types = (bool, float)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "2.15.4"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cli_helpers-2.15.4 → cli_helpers-2.15.5}/cli_helpers/tabular_output/delimited_output_adapter.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cli_helpers-2.15.4 → cli_helpers-2.15.5}/cli_helpers/tabular_output/vertical_table_adapter.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cli_helpers-2.15.4 → cli_helpers-2.15.5}/tests/tabular_output/test_delimited_output_adapter.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cli_helpers-2.15.4 → cli_helpers-2.15.5}/tests/tabular_output/test_vertical_table_adapter.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|