From 306512d6bb53af18516fc10b15c7ec79cb02cc98 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Sat, 5 Mar 2022 15:13:47 -0800 Subject: [PATCH 1/4] force AM/PM to uppercase in date parser --- CHANGELOG | 3 +++ jc/lib.py | 2 +- jc/parsers/date.py | 4 ++-- setup.py | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 7aa053f6..a97b7eab 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,8 @@ jc changelog +20220305 v1.18.5 +- Fix date parser to ensure AM/PM period string is always uppercase + 20220304 v1.18.4 - Add nmcli command parser tested on linux - Enhance parse error messages at the cli diff --git a/jc/lib.py b/jc/lib.py index 23fdaf31..ca025e08 100644 --- a/jc/lib.py +++ b/jc/lib.py @@ -9,7 +9,7 @@ import importlib from typing import Dict, List, Iterable, Union, Iterator from jc import appdirs -__version__ = '1.18.4' +__version__ = '1.18.5' parsers = [ 'acpi', diff --git a/jc/parsers/date.py b/jc/parsers/date.py index 313ec444..b24c510a 100644 --- a/jc/parsers/date.py +++ b/jc/parsers/date.py @@ -83,7 +83,7 @@ import jc.utils class info(): """Provides parser metadata (version, author, etc.)""" - version = '2.3' + version = '2.4' description = '`date` command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -188,7 +188,7 @@ def parse(data, raw=False, quiet=False): 'hour_24': dt.hour, 'minute': dt.minute, 'second': dt.second, - 'period': dt.strftime('%p'), + 'period': dt.strftime('%p').upper(), 'timezone': tz, 'utc_offset': dt.strftime('%z') or None, 'day_of_year': int(dt.strftime('%j')), diff --git a/setup.py b/setup.py index 72ba44ed..667d3d33 100755 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ with open('README.md', 'r') as f: setuptools.setup( name='jc', - version='1.18.4', + version='1.18.5', author='Kelly Brazil', author_email='kellyjonbrazil@gmail.com', description='Converts the output of popular command-line tools and file-types to JSON.', From 727fc9a701e9aae75d3d2b708010da1d0dc8781a Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Sat, 5 Mar 2022 15:19:25 -0800 Subject: [PATCH 2/4] doc update --- docs/parsers/date.md | 2 +- man/jc.1 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/parsers/date.md b/docs/parsers/date.md index 6da56dc5..82f8bd87 100644 --- a/docs/parsers/date.md +++ b/docs/parsers/date.md @@ -105,4 +105,4 @@ Returns: ### Parser Information Compatibility: linux, darwin, freebsd -Version 2.3 by Kelly Brazil (kellyjonbrazil@gmail.com) +Version 2.4 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/man/jc.1 b/man/jc.1 index cabf84e9..7982a291 100644 --- a/man/jc.1 +++ b/man/jc.1 @@ -1,4 +1,4 @@ -.TH jc 1 2022-03-05 1.18.4 "JSON Convert" +.TH jc 1 2022-03-05 1.18.5 "JSON Convert" .SH NAME jc \- JSONifies the output of many CLI tools and file-types .SH SYNOPSIS From 648ef4d8a9c33a36d4bb2c135fe59b031de8f24c Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Tue, 8 Mar 2022 13:19:20 -0800 Subject: [PATCH 3/4] update badge links --- README.md | 4 ++-- templates/readme_template | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 1d804634..91b118de 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -![Tests](https://github.com/kellyjonbrazil/jc/workflows/Tests/badge.svg?branch=master) -![Pypi](https://img.shields.io/pypi/v/jc.svg) +[![Tests](https://github.com/kellyjonbrazil/jc/workflows/Tests/badge.svg?branch=master)](https://github.com/kellyjonbrazil/jc/actions) +[![Pypi](https://img.shields.io/pypi/v/jc.svg)](https://pypi.org/project/jc/) > Check out the `jc` Python [package documentation](https://github.com/kellyjonbrazil/jc/tree/master/docs) for developers diff --git a/templates/readme_template b/templates/readme_template index 286ca343..7595911d 100644 --- a/templates/readme_template +++ b/templates/readme_template @@ -1,5 +1,5 @@ -![Tests](https://github.com/kellyjonbrazil/jc/workflows/Tests/badge.svg?branch=master) -![Pypi](https://img.shields.io/pypi/v/jc.svg) +[![Tests](https://github.com/kellyjonbrazil/jc/workflows/Tests/badge.svg?branch=master)](https://github.com/kellyjonbrazil/jc/actions) +[![Pypi](https://img.shields.io/pypi/v/jc.svg)](https://pypi.org/project/jc/) > Check out the `jc` Python [package documentation](https://github.com/kellyjonbrazil/jc/tree/master/docs) for developers From ac61e9ad2c9c4e864db02db04cbf907fb0efd99b Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Tue, 8 Mar 2022 13:21:05 -0800 Subject: [PATCH 4/4] add pypi link --- README.md | 1 + templates/readme_template | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index 91b118de..a5db4980 100644 --- a/README.md +++ b/README.md @@ -99,6 +99,7 @@ correct [binary](https://github.com/kellyjonbrazil/jc/releases) for your architecture and running it anywhere on your filesystem. ### Pip (macOS, linux, unix, Windows) +[![Pypi](https://img.shields.io/pypi/v/jc.svg)](https://pypi.org/project/jc/) ```bash pip3 install jc ``` diff --git a/templates/readme_template b/templates/readme_template index 7595911d..233b025f 100644 --- a/templates/readme_template +++ b/templates/readme_template @@ -99,6 +99,7 @@ correct [binary](https://github.com/kellyjonbrazil/jc/releases) for your architecture and running it anywhere on your filesystem. ### Pip (macOS, linux, unix, Windows) +[![Pypi](https://img.shields.io/pypi/v/jc.svg)](https://pypi.org/project/jc/) ```bash pip3 install jc ```