cli-helpers 2.15.5__tar.gz → 2.15.6__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.5 → cli_helpers-2.15.6}/AUTHORS +1 -0
- {cli_helpers-2.15.5 → cli_helpers-2.15.6}/CHANGELOG +6 -0
- {cli_helpers-2.15.5/cli_helpers.egg-info → cli_helpers-2.15.6}/PKG-INFO +1 -1
- cli_helpers-2.15.6/cli_helpers/__init__.py +1 -0
- {cli_helpers-2.15.5 → cli_helpers-2.15.6}/cli_helpers/tabular_output/preprocessors.py +4 -0
- {cli_helpers-2.15.5 → cli_helpers-2.15.6/cli_helpers.egg-info}/PKG-INFO +1 -1
- {cli_helpers-2.15.5 → cli_helpers-2.15.6}/tests/tabular_output/test_preprocessors.py +6 -3
- cli_helpers-2.15.5/cli_helpers/__init__.py +0 -1
- {cli_helpers-2.15.5 → cli_helpers-2.15.6}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {cli_helpers-2.15.5 → cli_helpers-2.15.6}/.github/workflows/codeql.yml +0 -0
- {cli_helpers-2.15.5 → cli_helpers-2.15.6}/.gitignore +0 -0
- {cli_helpers-2.15.5 → cli_helpers-2.15.6}/.travis/install.sh +0 -0
- {cli_helpers-2.15.5 → cli_helpers-2.15.6}/.travis.yml +0 -0
- {cli_helpers-2.15.5 → cli_helpers-2.15.6}/CONTRIBUTING.rst +0 -0
- {cli_helpers-2.15.5 → cli_helpers-2.15.6}/LICENSE +0 -0
- {cli_helpers-2.15.5 → cli_helpers-2.15.6}/MANIFEST.in +0 -0
- {cli_helpers-2.15.5 → cli_helpers-2.15.6}/README.rst +0 -0
- {cli_helpers-2.15.5 → cli_helpers-2.15.6}/appveyor.yml +0 -0
- {cli_helpers-2.15.5 → cli_helpers-2.15.6}/cli_helpers/compat.py +0 -0
- {cli_helpers-2.15.5 → cli_helpers-2.15.6}/cli_helpers/config.py +0 -0
- {cli_helpers-2.15.5 → cli_helpers-2.15.6}/cli_helpers/tabular_output/__init__.py +0 -0
- {cli_helpers-2.15.5 → cli_helpers-2.15.6}/cli_helpers/tabular_output/delimited_output_adapter.py +0 -0
- {cli_helpers-2.15.5 → cli_helpers-2.15.6}/cli_helpers/tabular_output/json_output_adapter.py +0 -0
- {cli_helpers-2.15.5 → cli_helpers-2.15.6}/cli_helpers/tabular_output/output_formatter.py +0 -0
- {cli_helpers-2.15.5 → cli_helpers-2.15.6}/cli_helpers/tabular_output/tabulate_adapter.py +0 -0
- {cli_helpers-2.15.5 → cli_helpers-2.15.6}/cli_helpers/tabular_output/tsv_output_adapter.py +0 -0
- {cli_helpers-2.15.5 → cli_helpers-2.15.6}/cli_helpers/tabular_output/vertical_table_adapter.py +0 -0
- {cli_helpers-2.15.5 → cli_helpers-2.15.6}/cli_helpers/utils.py +0 -0
- {cli_helpers-2.15.5 → cli_helpers-2.15.6}/cli_helpers.egg-info/SOURCES.txt +0 -0
- {cli_helpers-2.15.5 → cli_helpers-2.15.6}/cli_helpers.egg-info/dependency_links.txt +0 -0
- {cli_helpers-2.15.5 → cli_helpers-2.15.6}/cli_helpers.egg-info/requires.txt +0 -0
- {cli_helpers-2.15.5 → cli_helpers-2.15.6}/cli_helpers.egg-info/top_level.txt +0 -0
- {cli_helpers-2.15.5 → cli_helpers-2.15.6}/docs/Makefile +0 -0
- {cli_helpers-2.15.5 → cli_helpers-2.15.6}/docs/source/api.rst +0 -0
- {cli_helpers-2.15.5 → cli_helpers-2.15.6}/docs/source/authors.rst +0 -0
- {cli_helpers-2.15.5 → cli_helpers-2.15.6}/docs/source/changelog.rst +0 -0
- {cli_helpers-2.15.5 → cli_helpers-2.15.6}/docs/source/conf.py +0 -0
- {cli_helpers-2.15.5 → cli_helpers-2.15.6}/docs/source/contributing.rst +0 -0
- {cli_helpers-2.15.5 → cli_helpers-2.15.6}/docs/source/index.rst +0 -0
- {cli_helpers-2.15.5 → cli_helpers-2.15.6}/docs/source/license.rst +0 -0
- {cli_helpers-2.15.5 → cli_helpers-2.15.6}/docs/source/quickstart.rst +0 -0
- {cli_helpers-2.15.5 → cli_helpers-2.15.6}/release.py +0 -0
- {cli_helpers-2.15.5 → cli_helpers-2.15.6}/requirements-dev.txt +0 -0
- {cli_helpers-2.15.5 → cli_helpers-2.15.6}/setup.cfg +0 -0
- {cli_helpers-2.15.5 → cli_helpers-2.15.6}/setup.py +0 -0
- {cli_helpers-2.15.5 → cli_helpers-2.15.6}/tasks.py +0 -0
- {cli_helpers-2.15.5 → cli_helpers-2.15.6}/tests/__init__.py +0 -0
- {cli_helpers-2.15.5 → cli_helpers-2.15.6}/tests/compat.py +0 -0
- {cli_helpers-2.15.5 → cli_helpers-2.15.6}/tests/config_data/configrc +0 -0
- {cli_helpers-2.15.5 → cli_helpers-2.15.6}/tests/config_data/configspecrc +0 -0
- {cli_helpers-2.15.5 → cli_helpers-2.15.6}/tests/config_data/invalid_configrc +0 -0
- {cli_helpers-2.15.5 → cli_helpers-2.15.6}/tests/config_data/invalid_configspecrc +0 -0
- {cli_helpers-2.15.5 → cli_helpers-2.15.6}/tests/tabular_output/__init__.py +0 -0
- {cli_helpers-2.15.5 → cli_helpers-2.15.6}/tests/tabular_output/test_delimited_output_adapter.py +0 -0
- {cli_helpers-2.15.5 → cli_helpers-2.15.6}/tests/tabular_output/test_formatter_options.py +0 -0
- {cli_helpers-2.15.5 → cli_helpers-2.15.6}/tests/tabular_output/test_json_output_adapter.py +0 -0
- {cli_helpers-2.15.5 → cli_helpers-2.15.6}/tests/tabular_output/test_output_formatter.py +0 -0
- {cli_helpers-2.15.5 → cli_helpers-2.15.6}/tests/tabular_output/test_tabulate_adapter.py +0 -0
- {cli_helpers-2.15.5 → cli_helpers-2.15.6}/tests/tabular_output/test_tsv_output_adapter.py +0 -0
- {cli_helpers-2.15.5 → cli_helpers-2.15.6}/tests/tabular_output/test_vertical_table_adapter.py +0 -0
- {cli_helpers-2.15.5 → cli_helpers-2.15.6}/tests/test_cli_helpers.py +0 -0
- {cli_helpers-2.15.5 → cli_helpers-2.15.6}/tests/test_config.py +0 -0
- {cli_helpers-2.15.5 → cli_helpers-2.15.6}/tests/test_utils.py +0 -0
- {cli_helpers-2.15.5 → cli_helpers-2.15.6}/tests/utils.py +0 -0
- {cli_helpers-2.15.5 → cli_helpers-2.15.6}/tox.ini +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "2.15.6"
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
"""These preprocessor functions are used to process data prior to output."""
|
|
3
3
|
|
|
4
4
|
import string
|
|
5
|
+
from collections.abc import Iterator
|
|
5
6
|
from datetime import datetime
|
|
6
7
|
|
|
7
8
|
from cli_helpers import utils
|
|
@@ -397,6 +398,9 @@ def format_timestamps(data, headers, column_date_formats=None, **_):
|
|
|
397
398
|
if column_date_formats is None:
|
|
398
399
|
return iter(data), headers
|
|
399
400
|
|
|
401
|
+
if isinstance(headers, Iterator):
|
|
402
|
+
headers = list(headers)
|
|
403
|
+
|
|
400
404
|
def _format_timestamp(value, name, column_date_formats):
|
|
401
405
|
if name not in column_date_formats:
|
|
402
406
|
return value
|
|
@@ -399,7 +399,8 @@ def test_enforce_iterable():
|
|
|
399
399
|
assert False, "{} returns headers as iterator".format(name)
|
|
400
400
|
|
|
401
401
|
|
|
402
|
-
|
|
402
|
+
@pytest.mark.parametrize("header_type", [list, tuple, iter])
|
|
403
|
+
def test_format_timestamps(header_type):
|
|
403
404
|
data = (
|
|
404
405
|
("name1", "2024-12-13T18:32:22", "2024-12-13T19:32:22", "2024-12-13T20:32:22"),
|
|
405
406
|
("name2", "2025-02-13T02:32:22", "2025-02-13T02:32:22", "2025-02-13T02:32:22"),
|
|
@@ -410,7 +411,9 @@ def test_format_timestamps():
|
|
|
410
411
|
"date_col": "%Y-%m-%d",
|
|
411
412
|
"datetime_col": "%I:%M:%S %m/%d/%y",
|
|
412
413
|
}
|
|
413
|
-
result_data, result_headers = format_timestamps(
|
|
414
|
+
result_data, result_headers = format_timestamps(
|
|
415
|
+
data, header_type(headers), column_date_formats
|
|
416
|
+
)
|
|
414
417
|
|
|
415
418
|
expected = [
|
|
416
419
|
["name1", "2024-12-13", "07:32:22 12/13/24", "2024-12-13T20:32:22"],
|
|
@@ -418,4 +421,4 @@ def test_format_timestamps():
|
|
|
418
421
|
["name3", None, "not-actually-timestamp", "2025-02-13T02:32:22"],
|
|
419
422
|
]
|
|
420
423
|
assert expected == list(result_data)
|
|
421
|
-
assert headers == result_headers
|
|
424
|
+
assert headers == list(result_headers)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "2.15.5"
|
|
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.5 → cli_helpers-2.15.6}/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.5 → cli_helpers-2.15.6}/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.5 → cli_helpers-2.15.6}/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.5 → cli_helpers-2.15.6}/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
|