Skip to content

Commit 5f8c65c

Browse files
Merge branch 'dev'
2 parents abda873 + ed048c7 commit 5f8c65c

File tree

82 files changed

+836
-276
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+836
-276
lines changed

.github/workflows/pythonapp.yml

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,39 @@ on:
99
- "**/*.py"
1010

1111
jobs:
12-
build:
12+
old_python:
1313
runs-on: ${{ matrix.os }}
1414
strategy:
1515
matrix:
16-
os: [macos-latest, ubuntu-20.04, windows-latest]
17-
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
16+
os: [macos-13, ubuntu-20.04, windows-2019]
17+
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
18+
19+
steps:
20+
- uses: actions/checkout@v3
21+
- name: "Set up timezone to America/Los_Angeles"
22+
uses: szenius/[email protected]
23+
with:
24+
timezoneLinux: "America/Los_Angeles"
25+
timezoneMacos: "America/Los_Angeles"
26+
timezoneWindows: "Pacific Standard Time"
27+
- name: Set up Python ${{ matrix.python-version }}
28+
uses: actions/setup-python@v4
29+
with:
30+
python-version: ${{ matrix.python-version }}
31+
- name: Install dependencies
32+
run: |
33+
python -m pip install --upgrade pip
34+
pip install -r requirements.txt
35+
- name: Test with unittest
36+
run: |
37+
python -m unittest discover tests
38+
39+
latest_python:
40+
runs-on: ${{ matrix.os }}
41+
strategy:
42+
matrix:
43+
os: [macos-latest, ubuntu-latest, windows-latest]
44+
python-version: ["3.11", "3.12"]
1845

1946
steps:
2047
- uses: actions/checkout@v3

CHANGELOG

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
jc changelog
22

3+
20240609 v1.25.3
4+
- Enhance `bluetoothctl` parser with added `battery_percentage` field
5+
- Enhance `git-log` standard and streaming parsers with added `lines_changed` field under `file_stats`
6+
- Fix `pci-ids` parser to correctly handle multiple subdevices
7+
- Fix `pip-show` parser to handle multi-line fields with a beginning blank line
8+
- Fix `ss` parser to correctly handle the `Recv-Q` field being too close to the `Status` field
9+
- Fix `top` parsers to quiet uptime info parsing
10+
- Fix `traceroute` parser to correctly handle hops with multiple IPs
11+
- Fix `zpool-status` parser for config items lacking data values
12+
- Optimize some tests by removing timezone settings and using quiet=True
13+
- Documentation updates
14+
315
20240323 v1.25.2
416
- Add `apt-cache-show` command parser
517
- Add `apt-get-sqq` command parser

docs/parsers/apt_get_sqq.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ Requires the `-sqq` options in `apt-get`.
99

1010
Usage (cli):
1111

12-
$ apt-get -sqq | jc --apt-get-sqq
12+
$ apt-get -sqq upgrade | jc --apt-get-sqq
1313

1414
or
1515

16-
$ jc apt-get -sqq
16+
$ jc apt-get -sqq full-upgrade
1717

1818
Usage (module):
1919

@@ -35,7 +35,7 @@ Schema:
3535

3636
Examples:
3737

38-
$ apt-get -sqq | jc --apt-get-sqq -p
38+
$ apt-get -sqq upgrade | jc --apt-get-sqq -p
3939
[
4040
{
4141
"operation": "unpack",
@@ -103,7 +103,7 @@ Examples:
103103
}
104104
]
105105

106-
$ apt-get -sqq | jc --apt-get-sqq -p -r
106+
$ apt-get -sqq upgrade | jc --apt-get-sqq -p -r
107107
[
108108
{
109109
"operation": "Inst",
@@ -198,4 +198,4 @@ Compatibility: linux
198198

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

201-
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
201+
Version 1.1 by Kelly Brazil (kellyjonbrazil@gmail.com)

docs/parsers/bluetoothctl.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ a controller and a device but there might be fields corresponding to one entity.
7070
"rssi": int,
7171
"txpower": int,
7272
"uuids": array,
73-
"modalias": string
73+
"modalias": string,
74+
"battery_percentage": int
7475
}
7576
]
7677

@@ -101,7 +102,8 @@ Examples:
101102
"Headset HS (00001831-0000-1000-8000-00805f9b34fb)"
102103
],
103104
"rssi": -52,
104-
"txpower": 4
105+
"txpower": 4,
106+
"battery_percentage": 70
105107
}
106108
]
107109

@@ -132,4 +134,4 @@ Compatibility: linux
132134

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

135-
Version 1.1 by Jake Ob (iakopap at gmail.com)
137+
Version 1.2 by Jake Ob (iakopap at gmail.com)

docs/parsers/git_log.md

Lines changed: 71 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ Schema:
5555
"deletions": integer,
5656
"files": [
5757
string
58+
],
59+
"file_stats": [
60+
{
61+
"name": string,
62+
"lines_changed": integer
63+
}
5864
]
5965
}
6066
}
@@ -79,6 +85,16 @@ Examples:
7985
"files": [
8086
"docs/parsers/git_log.md",
8187
"jc/parsers/git_log.py"
88+
],
89+
"file_stats": [
90+
{
91+
"name": "docs/parsers/git_log.md",
92+
"lines_changed": 3
93+
},
94+
{
95+
"name": "jc/parsers/git_log.py",
96+
"lines_changed": 7
97+
}
8298
]
8399
},
84100
"message": "add timestamp docs and examples",
@@ -100,6 +116,28 @@ Examples:
100116
"jc/parsers/git_log.py",
101117
"jc/utils.py",
102118
"man/jc.1"
119+
],
120+
"file_stats": [
121+
{
122+
"name": "docs/parsers/git_log.md",
123+
"lines_changed": 3
124+
},
125+
{
126+
"name": "docs/utils.md",
127+
"lines_changed": 7
128+
},
129+
{
130+
"name": "jc/parsers/git_log.py",
131+
"lines_changed": 1
132+
},
133+
{
134+
"name": "jc/utils.py",
135+
"lines_changed": 12
136+
},
137+
{
138+
"name": "man/jc.1",
139+
"lines_changed": 14
140+
}
103141
]
104142
},
105143
"message": "add calculated timestamp",
@@ -123,6 +161,16 @@ Examples:
123161
"files": [
124162
"docs/parsers/git_log.md",
125163
"jc/parsers/git_log.py"
164+
],
165+
"file_stats": [
166+
{
167+
"name": "docs/parsers/git_log.md",
168+
"lines_changed": "3"
169+
},
170+
{
171+
"name": "jc/parsers/git_log.py",
172+
"lines_changed": "7"
173+
}
126174
]
127175
},
128176
"message": "add timestamp docs and examples"
@@ -142,6 +190,28 @@ Examples:
142190
"jc/parsers/git_log.py",
143191
"jc/utils.py",
144192
"man/jc.1"
193+
],
194+
"file_stats": [
195+
{
196+
"name": "docs/parsers/git_log.md",
197+
"lines_changed": "3"
198+
},
199+
{
200+
"name": "docs/utils.md",
201+
"lines_changed": "7"
202+
},
203+
{
204+
"name": "jc/parsers/git_log.py",
205+
"lines_changed": "1"
206+
},
207+
{
208+
"name": "jc/utils.py",
209+
"lines_changed": "12"
210+
},
211+
{
212+
"name": "man/jc.1",
213+
"lines_changed": "14"
214+
}
145215
]
146216
},
147217
"message": "add calculated timestamp"
@@ -174,4 +244,4 @@ Compatibility: linux, darwin, cygwin, win32, aix, freebsd
174244

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

177-
Version 1.4 by Kelly Brazil (kellyjonbrazil@gmail.com)
247+
Version 1.5 by Kelly Brazil (kellyjonbrazil@gmail.com)

docs/parsers/git_log_s.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@ Schema:
5656
"deletions": integer,
5757
"files": [
5858
string
59+
],
60+
"file_stats": [
61+
{
62+
"name": string,
63+
"lines_changed": integer
64+
}
5965
]
6066
}
6167

@@ -109,4 +115,4 @@ Compatibility: linux, darwin, cygwin, win32, aix, freebsd
109115

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

112-
Version 1.4 by Kelly Brazil (kellyjonbrazil@gmail.com)
118+
Version 1.5 by Kelly Brazil (kellyjonbrazil@gmail.com)

docs/parsers/lspci.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ Schema:
5353
"sdevice_id_int": integer,
5454
"rev": string,
5555
"physlot": string,
56-
"physlot_int": integer,
5756
"progif": string,
5857
"progif_int": integer
5958
}
@@ -89,7 +88,6 @@ Examples:
8988
"sdevice_id": "07e0",
9089
"sdevice_id_int": 2016,
9190
"physlot": "37",
92-
"physlot_int": 55,
9391
"progif": "01",
9492
"progif_int": 1
9593
},
@@ -147,4 +145,4 @@ Compatibility: linux
147145

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

150-
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
148+
Version 1.1 by Kelly Brazil (kellyjonbrazil@gmail.com)

docs/parsers/pci_ids.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,4 +98,4 @@ Compatibility: linux, darwin, cygwin, win32, aix, freebsd
9898

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

101-
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
101+
Version 1.1 by Kelly Brazil (kellyjonbrazil@gmail.com)

docs/parsers/pip_show.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,4 +90,4 @@ Compatibility: linux, darwin, cygwin, win32, aix, freebsd
9090

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

93-
Version 1.4 by Kelly Brazil (kellyjonbrazil@gmail.com)
93+
Version 1.5 by Kelly Brazil (kellyjonbrazil@gmail.com)

docs/parsers/ss.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,13 @@ field names
4747
"file_descriptor": string
4848
}
4949
}
50+
"inode_number": string,
51+
"cookie": string,
52+
"cgroup": string,
53+
"v6only": string,
54+
"timer_name": string,
55+
"expire_time": string,
56+
"retrans": string
5057
}
5158
}
5259
]
@@ -310,4 +317,4 @@ Compatibility: linux
310317

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

313-
Version 1.7 by Kelly Brazil ([email protected])
320+
Version 1.8 by Kelly Brazil ([email protected])

docs/parsers/top.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,4 +338,4 @@ Compatibility: linux
338338

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

341-
Version 1.1 by Kelly Brazil (kellyjonbrazil@gmail.com)
341+
Version 1.2 by Kelly Brazil (kellyjonbrazil@gmail.com)

docs/parsers/top_s.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,4 +178,4 @@ Compatibility: linux
178178

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

181-
Version 1.1 by Kelly Brazil (kellyjonbrazil@gmail.com)
181+
Version 1.2 by Kelly Brazil (kellyjonbrazil@gmail.com)

docs/parsers/traceroute.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,4 +145,4 @@ Compatibility: linux, darwin, freebsd
145145

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

148-
Version 1.6 by Kelly Brazil ([email protected])
148+
Version 1.7 by Kelly Brazil ([email protected])

docs/parsers/zpool_status.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ Schema:
3434
"config": [
3535
{
3636
"name": string,
37-
"state": string,
38-
"read": integer,
39-
"write": integer,
40-
"checksum": integer,
41-
"errors": string,
37+
"state": string/null,
38+
"read": integer/null,
39+
"write": integer/null,
40+
"checksum": integer/null,
41+
"errors": string/null,
4242
}
4343
],
4444
"errors": string
@@ -162,4 +162,4 @@ Compatibility: linux, darwin, freebsd
162162

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

165-
Version 1.1 by Kelly Brazil (kellyjonbrazil@gmail.com)
165+
Version 1.2 by Kelly Brazil (kellyjonbrazil@gmail.com)

jc/lib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from jc import utils
1111

1212

13-
__version__ = '1.25.2'
13+
__version__ = '1.25.3'
1414

1515
parsers: List[str] = [
1616
'acpi',

jc/parsers/apt_get_sqq.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
55
Usage (cli):
66
7-
$ apt-get -sqq | jc --apt-get-sqq
7+
$ apt-get -sqq upgrade | jc --apt-get-sqq
88
99
or
1010
11-
$ jc apt-get -sqq
11+
$ jc apt-get -sqq full-upgrade
1212
1313
Usage (module):
1414
@@ -30,7 +30,7 @@
3030
3131
Examples:
3232
33-
$ apt-get -sqq | jc --apt-get-sqq -p
33+
$ apt-get -sqq upgrade | jc --apt-get-sqq -p
3434
[
3535
{
3636
"operation": "unpack",
@@ -98,7 +98,7 @@
9898
}
9999
]
100100
101-
$ apt-get -sqq | jc --apt-get-sqq -p -r
101+
$ apt-get -sqq upgrade | jc --apt-get-sqq -p -r
102102
[
103103
{
104104
"operation": "Inst",
@@ -174,7 +174,7 @@
174174

175175
class info():
176176
"""Provides parser metadata (version, author, etc.)"""
177-
version = '1.0'
177+
version = '1.1'
178178
description = '`apt-get -sqq` command parser'
179179
author = 'Kelly Brazil'
180180
author_email = '[email protected]'

0 commit comments

Comments
 (0)