Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
kellyjonbrazil committed Jun 10, 2024
2 parents abda873 + ed048c7 commit 5f8c65c
Show file tree
Hide file tree
Showing 82 changed files with 836 additions and 276 deletions.
33 changes: 30 additions & 3 deletions .github/workflows/pythonapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,39 @@ on:
- "**/*.py"

jobs:
build:
old_python:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-20.04, windows-latest]
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
os: [macos-13, ubuntu-20.04, windows-2019]
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]

steps:
- uses: actions/checkout@v3
- name: "Set up timezone to America/Los_Angeles"
uses: szenius/set-timezone@v1.2
with:
timezoneLinux: "America/Los_Angeles"
timezoneMacos: "America/Los_Angeles"
timezoneWindows: "Pacific Standard Time"
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Test with unittest
run: |
python -m unittest discover tests
latest_python:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
python-version: ["3.11", "3.12"]

steps:
- uses: actions/checkout@v3
Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
jc changelog

20240609 v1.25.3
- Enhance `bluetoothctl` parser with added `battery_percentage` field
- Enhance `git-log` standard and streaming parsers with added `lines_changed` field under `file_stats`
- Fix `pci-ids` parser to correctly handle multiple subdevices
- Fix `pip-show` parser to handle multi-line fields with a beginning blank line
- Fix `ss` parser to correctly handle the `Recv-Q` field being too close to the `Status` field
- Fix `top` parsers to quiet uptime info parsing
- Fix `traceroute` parser to correctly handle hops with multiple IPs
- Fix `zpool-status` parser for config items lacking data values
- Optimize some tests by removing timezone settings and using quiet=True
- Documentation updates

20240323 v1.25.2
- Add `apt-cache-show` command parser
- Add `apt-get-sqq` command parser
Expand Down
10 changes: 5 additions & 5 deletions docs/parsers/apt_get_sqq.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ Requires the `-sqq` options in `apt-get`.

Usage (cli):

$ apt-get -sqq | jc --apt-get-sqq
$ apt-get -sqq upgrade | jc --apt-get-sqq

or

$ jc apt-get -sqq
$ jc apt-get -sqq full-upgrade

Usage (module):

Expand All @@ -35,7 +35,7 @@ Schema:

Examples:

$ apt-get -sqq | jc --apt-get-sqq -p
$ apt-get -sqq upgrade | jc --apt-get-sqq -p
[
{
"operation": "unpack",
Expand Down Expand Up @@ -103,7 +103,7 @@ Examples:
}
]

$ apt-get -sqq | jc --apt-get-sqq -p -r
$ apt-get -sqq upgrade | jc --apt-get-sqq -p -r
[
{
"operation": "Inst",
Expand Down Expand Up @@ -198,4 +198,4 @@ Compatibility: linux

Source: [`jc/parsers/apt_get_sqq.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/apt_get_sqq.py)

Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
Version 1.1 by Kelly Brazil (kellyjonbrazil@gmail.com)
8 changes: 5 additions & 3 deletions docs/parsers/bluetoothctl.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ a controller and a device but there might be fields corresponding to one entity.
"rssi": int,
"txpower": int,
"uuids": array,
"modalias": string
"modalias": string,
"battery_percentage": int
}
]

Expand Down Expand Up @@ -101,7 +102,8 @@ Examples:
"Headset HS (00001831-0000-1000-8000-00805f9b34fb)"
],
"rssi": -52,
"txpower": 4
"txpower": 4,
"battery_percentage": 70
}
]

Expand Down Expand Up @@ -132,4 +134,4 @@ Compatibility: linux

Source: [`jc/parsers/bluetoothctl.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/bluetoothctl.py)

Version 1.1 by Jake Ob (iakopap at gmail.com)
Version 1.2 by Jake Ob (iakopap at gmail.com)
72 changes: 71 additions & 1 deletion docs/parsers/git_log.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ Schema:
"deletions": integer,
"files": [
string
],
"file_stats": [
{
"name": string,
"lines_changed": integer
}
]
}
}
Expand All @@ -79,6 +85,16 @@ Examples:
"files": [
"docs/parsers/git_log.md",
"jc/parsers/git_log.py"
],
"file_stats": [
{
"name": "docs/parsers/git_log.md",
"lines_changed": 3
},
{
"name": "jc/parsers/git_log.py",
"lines_changed": 7
}
]
},
"message": "add timestamp docs and examples",
Expand All @@ -100,6 +116,28 @@ Examples:
"jc/parsers/git_log.py",
"jc/utils.py",
"man/jc.1"
],
"file_stats": [
{
"name": "docs/parsers/git_log.md",
"lines_changed": 3
},
{
"name": "docs/utils.md",
"lines_changed": 7
},
{
"name": "jc/parsers/git_log.py",
"lines_changed": 1
},
{
"name": "jc/utils.py",
"lines_changed": 12
},
{
"name": "man/jc.1",
"lines_changed": 14
}
]
},
"message": "add calculated timestamp",
Expand All @@ -123,6 +161,16 @@ Examples:
"files": [
"docs/parsers/git_log.md",
"jc/parsers/git_log.py"
],
"file_stats": [
{
"name": "docs/parsers/git_log.md",
"lines_changed": "3"
},
{
"name": "jc/parsers/git_log.py",
"lines_changed": "7"
}
]
},
"message": "add timestamp docs and examples"
Expand All @@ -142,6 +190,28 @@ Examples:
"jc/parsers/git_log.py",
"jc/utils.py",
"man/jc.1"
],
"file_stats": [
{
"name": "docs/parsers/git_log.md",
"lines_changed": "3"
},
{
"name": "docs/utils.md",
"lines_changed": "7"
},
{
"name": "jc/parsers/git_log.py",
"lines_changed": "1"
},
{
"name": "jc/utils.py",
"lines_changed": "12"
},
{
"name": "man/jc.1",
"lines_changed": "14"
}
]
},
"message": "add calculated timestamp"
Expand Down Expand Up @@ -174,4 +244,4 @@ Compatibility: linux, darwin, cygwin, win32, aix, freebsd

Source: [`jc/parsers/git_log.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/git_log.py)

Version 1.4 by Kelly Brazil (kellyjonbrazil@gmail.com)
Version 1.5 by Kelly Brazil (kellyjonbrazil@gmail.com)
8 changes: 7 additions & 1 deletion docs/parsers/git_log_s.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ Schema:
"deletions": integer,
"files": [
string
],
"file_stats": [
{
"name": string,
"lines_changed": integer
}
]
}

Expand Down Expand Up @@ -109,4 +115,4 @@ Compatibility: linux, darwin, cygwin, win32, aix, freebsd

Source: [`jc/parsers/git_log_s.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/git_log_s.py)

Version 1.4 by Kelly Brazil (kellyjonbrazil@gmail.com)
Version 1.5 by Kelly Brazil (kellyjonbrazil@gmail.com)
4 changes: 1 addition & 3 deletions docs/parsers/lspci.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ Schema:
"sdevice_id_int": integer,
"rev": string,
"physlot": string,
"physlot_int": integer,
"progif": string,
"progif_int": integer
}
Expand Down Expand Up @@ -89,7 +88,6 @@ Examples:
"sdevice_id": "07e0",
"sdevice_id_int": 2016,
"physlot": "37",
"physlot_int": 55,
"progif": "01",
"progif_int": 1
},
Expand Down Expand Up @@ -147,4 +145,4 @@ Compatibility: linux

Source: [`jc/parsers/lspci.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/lspci.py)

Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
Version 1.1 by Kelly Brazil (kellyjonbrazil@gmail.com)
2 changes: 1 addition & 1 deletion docs/parsers/pci_ids.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,4 @@ Compatibility: linux, darwin, cygwin, win32, aix, freebsd

Source: [`jc/parsers/pci_ids.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/pci_ids.py)

Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
Version 1.1 by Kelly Brazil (kellyjonbrazil@gmail.com)
2 changes: 1 addition & 1 deletion docs/parsers/pip_show.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,4 @@ Compatibility: linux, darwin, cygwin, win32, aix, freebsd

Source: [`jc/parsers/pip_show.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/pip_show.py)

Version 1.4 by Kelly Brazil (kellyjonbrazil@gmail.com)
Version 1.5 by Kelly Brazil (kellyjonbrazil@gmail.com)
9 changes: 8 additions & 1 deletion docs/parsers/ss.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ field names
"file_descriptor": string
}
}
"inode_number": string,
"cookie": string,
"cgroup": string,
"v6only": string,
"timer_name": string,
"expire_time": string,
"retrans": string
}
}
]
Expand Down Expand Up @@ -310,4 +317,4 @@ Compatibility: linux

Source: [`jc/parsers/ss.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/ss.py)

Version 1.7 by Kelly Brazil (kellyjonbrazil@gmail.com)
Version 1.8 by Kelly Brazil (kellyjonbrazil@gmail.com)
2 changes: 1 addition & 1 deletion docs/parsers/top.md
Original file line number Diff line number Diff line change
Expand Up @@ -338,4 +338,4 @@ Compatibility: linux

Source: [`jc/parsers/top.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/top.py)

Version 1.1 by Kelly Brazil (kellyjonbrazil@gmail.com)
Version 1.2 by Kelly Brazil (kellyjonbrazil@gmail.com)
2 changes: 1 addition & 1 deletion docs/parsers/top_s.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,4 +178,4 @@ Compatibility: linux

Source: [`jc/parsers/top_s.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/top_s.py)

Version 1.1 by Kelly Brazil (kellyjonbrazil@gmail.com)
Version 1.2 by Kelly Brazil (kellyjonbrazil@gmail.com)
2 changes: 1 addition & 1 deletion docs/parsers/traceroute.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,4 +145,4 @@ Compatibility: linux, darwin, freebsd

Source: [`jc/parsers/traceroute.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/traceroute.py)

Version 1.6 by Kelly Brazil (kellyjonbrazil@gmail.com)
Version 1.7 by Kelly Brazil (kellyjonbrazil@gmail.com)
12 changes: 6 additions & 6 deletions docs/parsers/zpool_status.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ Schema:
"config": [
{
"name": string,
"state": string,
"read": integer,
"write": integer,
"checksum": integer,
"errors": string,
"state": string/null,
"read": integer/null,
"write": integer/null,
"checksum": integer/null,
"errors": string/null,
}
],
"errors": string
Expand Down Expand Up @@ -162,4 +162,4 @@ Compatibility: linux, darwin, freebsd

Source: [`jc/parsers/zpool_status.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/zpool_status.py)

Version 1.1 by Kelly Brazil (kellyjonbrazil@gmail.com)
Version 1.2 by Kelly Brazil (kellyjonbrazil@gmail.com)
2 changes: 1 addition & 1 deletion jc/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from jc import utils


__version__ = '1.25.2'
__version__ = '1.25.3'

parsers: List[str] = [
'acpi',
Expand Down
10 changes: 5 additions & 5 deletions jc/parsers/apt_get_sqq.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
Usage (cli):
$ apt-get -sqq | jc --apt-get-sqq
$ apt-get -sqq upgrade | jc --apt-get-sqq
or
$ jc apt-get -sqq
$ jc apt-get -sqq full-upgrade
Usage (module):
Expand All @@ -30,7 +30,7 @@
Examples:
$ apt-get -sqq | jc --apt-get-sqq -p
$ apt-get -sqq upgrade | jc --apt-get-sqq -p
[
{
"operation": "unpack",
Expand Down Expand Up @@ -98,7 +98,7 @@
}
]
$ apt-get -sqq | jc --apt-get-sqq -p -r
$ apt-get -sqq upgrade | jc --apt-get-sqq -p -r
[
{
"operation": "Inst",
Expand Down Expand Up @@ -174,7 +174,7 @@

class info():
"""Provides parser metadata (version, author, etc.)"""
version = '1.0'
version = '1.1'
description = '`apt-get -sqq` command parser'
author = 'Kelly Brazil'
author_email = 'kellyjonbrazil@gmail.com'
Expand Down
Loading

0 comments on commit 5f8c65c

Please sign in to comment.