1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-07-07 00:57:22 +02:00
Commit Graph

729 Commits

Author SHA1 Message Date
1da080dc52 fix for unhandled lines in xrandr output 2024-03-23 10:57:46 -07:00
3ca8e1ef11 iptables -x support for larger numbers and doc update 2024-03-19 14:38:20 -07:00
1d31d3570a add -x support to iptables parser 2024-03-18 10:52:26 -07:00
401b7b31b8 remove sys.path print 2024-03-14 17:31:38 -07:00
86a4bd12b5 fix for tests run inside vscode 2024-03-14 17:29:31 -07:00
36de08a6f8 change existing_src to existing_pkg_ver 2024-03-13 19:01:09 -07:00
83fa32f615 ethtool - convert units 2024-03-08 16:39:23 -08:00
5ac36befe2 add apt-get-sqq parser tests 2024-03-01 14:25:33 -08:00
495c353c5d clean up template 2024-03-01 13:53:02 -08:00
abbd4820fd add ethtool parser tests 2024-03-01 13:52:45 -08:00
7a377f7b8d add needrestart command parser 2024-02-28 13:28:03 -08:00
e2f97d7d8e add simple summary support to rsync and rsync-s parsers 2024-02-27 10:26:07 -08:00
f9bf889654 add apt_cache_show tests and fix parser name in warning messeages for parser aliases 2024-02-26 20:18:57 -08:00
026846650a add apt_cache_show parser. Split list values into an array. fix tests. 2024-02-26 19:56:07 -08:00
850917ada0 remove extra fields from df parser. All size values are now normalized to bytes. Size field is now an integer. 2024-02-26 11:17:42 -08:00
bce4eb536a add human readable output support to the free parser 2024-02-26 10:42:26 -08:00
ef2a2121b5 add human-readable support to the df parser 2024-02-26 10:00:42 -08:00
8ead7e4835 rename List class to _List for documentation purposes 2024-02-12 15:05:44 -08:00
44dc2a74c1 add test for jc -h 2024-02-12 11:00:02 -08:00
d50bd96ce6 [xrandr] Allow props command (#540)
* [xrandr] Allow props command

Responding to issue #525
Somewhat substantial rewriting here to make the parser more resilient
- Change parser to not mutate the incoming data list, instead index
- Create `Line` class and `categorize` classmethod
  - Every line is categorized and regexed, so it gets dispatched to the
  right level of responsibility

* Bump version

---------

Co-authored-by: Kelly Brazil <kellyjonbrazil@gmail.com>
2024-02-12 09:03:25 -08:00
63d1cead90 enhance uptime parser for busybox output with no user info 2024-02-10 11:55:19 -08:00
d3e7f09ca3 fix for more graceful handling of missing optional libraries 2024-02-10 11:16:38 -08:00
e6bdbb42d3 add more ini tests 2024-02-09 19:32:19 -08:00
3cfc5e3e3c fix ini parser for edge cases with non-value keys 2024-02-09 17:13:19 -08:00
cfa7f267fc update schema 2024-02-06 01:54:31 +00:00
c581e959fa formatting 2024-02-06 01:54:31 +00:00
9eb56543be add verbosity check for printing 2024-02-06 01:54:31 +00:00
0411940f75 add full path to error messages 2024-02-06 01:54:31 +00:00
7d60df67f3 check for missing fixtures 2024-02-06 01:54:31 +00:00
70a971a2f1 formatting 2024-02-06 01:54:31 +00:00
3fbdffd028 efibootmgr updates 2024-02-06 01:54:31 +00:00
539fe72d16 add "sudo efibootmgr" (without -v) output test case (#534) 2024-02-06 01:54:31 +00:00
bd6611aaba doc updates 2024-02-06 01:54:31 +00:00
cf77ddc396 cleanup 2024-02-06 01:54:31 +00:00
77bcd616cd add tests for curl-head and http-headers parsers 2024-02-06 01:54:31 +00:00
5ee2eda83e add efibootmgr parser (#528)
* More nsd fixes (#523)

* Update nsd_control.py

support catz output

* Update nsd_control.py

fix parsing of catz zones

* add testdata

add corresponding catz testdata

* Revert "More nsd fixes" (#526)

* add efibootmgr parser

* add efibootmgr completions

* Multiple fixes on jc/parsers/efibootmgr.py

1. Update schema in comments.
1. Add an example.
1. Use clean and clear sub string finding sytax.
1. Wrap schema in an object.
1. Make variable scope as small as possible.

* add tests for efibootmgr

* Update jc/parsers/efibootmgr.py

Update example using `--pretty` for output.

Co-authored-by: Muescha <184316+muescha@users.noreply.github.com>

* jc/parsers/efibootmgr multiple changes

1. convert all keys to "snake_case"
2. add "mirrored_percentage_above_4g" and "mirror_memory_below_4gb"
3. move conversion (from string to other types) to "_process"

---------

Co-authored-by: pettai <pettai@sunet.se>
Co-authored-by: Kelly Brazil <kellyjonbrazil@gmail.com>
Co-authored-by: Muescha <184316+muescha@users.noreply.github.com>
2024-02-06 01:54:31 +00:00
5b849b0275 doc update 2024-02-06 01:54:31 +00:00
3e5d206f0c test utils cleanup 2024-02-06 01:54:31 +00:00
962632ac1f Feature: generic fixtures tests (#529)
* add generic test runners

* extract generic test runners

* beautify messages, remove unused return value

* add template and info do CONTRIBUTING

* typo

---------

Co-authored-by: Kelly Brazil <kellyjonbrazil@gmail.com>
2024-02-06 01:54:31 +00:00
b65f37e075 add normalize_key() function and tests 2024-02-06 01:54:31 +00:00
6434ff61bf add HTTP header datetime format 2024-02-06 01:54:31 +00:00
c332c4febf draft for path and path_list (#513)
* draft for path_list

* updaate doc

* add input check

* fix types

* fix schema: add missing properties

* add _process

* fix _process docs

* refactor: extract path.py parser

* swap order of names alphabetically

* documentation and comments

* path parser: add early return for nodata

* path and path-list parser: add test and fixtures

* typo in file name

* add early return for nodata

* add test and fixtures

* typo in file name

* rename fixtures

* rename fixtures

* refactor to pathlib.Path

* failing on windows - use PurePosixPath

* changed the way to strip dot from suffix

* add POSIX to path

* test commit to see results on windows is failing

* test commit to see results on windows is failing

* add windows path detection

* somehow Path not like the newline from input line

* add test with more items

* remove debug print

* wrap test loops into into subTest

* remove print statements

* add path and path-list to CHANGELOG

---------

Co-authored-by: Kelly Brazil <kellyjonbrazil@gmail.com>
2024-02-06 01:54:31 +00:00
b836ffc583 add tests for convert_size_to_int() 2024-02-06 01:54:31 +00:00
ec0f2569e5 More nsd fixes (#523)
* Update nsd_control.py

support catz output

* Update nsd_control.py

fix parsing of catz zones

* add testdata

add corresponding catz testdata
2024-02-06 01:54:31 +00:00
afbc46076e add ping tests 2024-02-06 01:54:31 +00:00
2b9b6550a7 Fix data_bytes is null in ping -I option (#520)
* fixed header parsing when specifying ping interface

* add source_ip parsing test for ping/ping-s

---------

Co-authored-by: Kelly Brazil <kellyjonbrazil@gmail.com>
2024-02-06 01:54:31 +00:00
cc61b57dd1 add blank line tests to slicer 2024-02-06 01:54:31 +00:00
b5c3a03d56 implement slurp by wrapping in a list, adding "_file" for /proc, and further wrapping in {"result": data} when --meta-out is used. 2024-02-06 01:54:31 +00:00
cae41df1d8 add get_parser tests 2024-02-06 01:54:31 +00:00
8e9ff7fa9f refactor to use get_parser() 2024-02-06 01:54:31 +00:00