mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2025-07-15 01:24:29 +02:00
10
CHANGELOG
10
CHANGELOG
@ -1,5 +1,15 @@
|
||||
jc changelog
|
||||
|
||||
20220513 v1.19.0
|
||||
- Add chage --list command parser tested on linux
|
||||
- Add git log command streaming parser
|
||||
- Fix git log standard parser for coner-cases where hash values are in messages
|
||||
- Fix df command parser for rare instances when a newline is found at the end
|
||||
- Allow jc to pip install on unsupported python version 3.6
|
||||
- Fix asciitable-m parser to skip some rows that contain column separator
|
||||
characters in cell data. A warning message will be printed to STDOUT
|
||||
unless `-q` or `quiet=True` is used.
|
||||
|
||||
20220427 v1.18.8
|
||||
- Fix update-alternatives --query parser for cases where `slaves` are not present
|
||||
- Fix UnicodeEncodeError on some systems where LANG=C is set and unicode
|
||||
|
15
EXAMPLES.md
15
EXAMPLES.md
@ -265,6 +265,21 @@ blkid -o udev -ip /dev/sda2 | jc --blkid -p # or: jc -p blkid -o udev
|
||||
}
|
||||
]
|
||||
```
|
||||
### chage --list
|
||||
```bash
|
||||
chage --list joeuser | jc --chage -p # or: jc -p chage --list joeuser
|
||||
```
|
||||
```json
|
||||
{
|
||||
"password_last_changed": "never",
|
||||
"password_expires": "never",
|
||||
"password_inactive": "never",
|
||||
"account_expires": "never",
|
||||
"min_days_between_password_change": 0,
|
||||
"max_days_between_password_change": 99999,
|
||||
"warning_days_before_password_expires": 7
|
||||
}
|
||||
```
|
||||
### cksum
|
||||
```bash
|
||||
cksum * | jc --cksum -p # or: jc -p cksum *
|
||||
|
218
README.md
218
README.md
@ -114,10 +114,10 @@ pip3 install jc
|
||||
| Archlinux Community Repository | `paru -S jc` or `aura -S jc` or `yay -S jc` |
|
||||
| NixOS linux | `nix-env -iA nixpkgs.jc` or `nix-env -iA nixos.jc` |
|
||||
| Guix System linux | `guix install jc` |
|
||||
| Gentoo Linux | `emerge dev-python/jc` |
|
||||
| macOS | `brew install jc` |
|
||||
| FreeBSD | `portsnap fetch update && cd /usr/ports/textproc/py-jc && make install clean` |
|
||||
| Ansible filter plugin | `ansible-galaxy collection install community.general` |
|
||||
| Gentoo Linux | `emerge dev-python/jc` |
|
||||
|
||||
> For more OS Packages, see https://repology.org/project/jc/versions.
|
||||
|
||||
@ -144,104 +144,108 @@ option.
|
||||
|
||||
### Parsers
|
||||
|
||||
- `--acpi` enables the `acpi` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/acpi))
|
||||
- `--airport` enables the `airport -I` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/airport))
|
||||
- `--airport-s` enables the `airport -s` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/airport_s))
|
||||
- `--arp` enables the `arp` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/arp))
|
||||
- `--asciitable` enables the ASCII and Unicode table parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/asciitable))
|
||||
- `--asciitable-m` enables the multi-line ASCII and Unicode table parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/asciitable_m))
|
||||
- `--blkid` enables the `blkid` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/blkid))
|
||||
- `--cksum` enables the `cksum` and `sum` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/cksum))
|
||||
- `--crontab` enables the `crontab` command and file parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/crontab))
|
||||
- `--crontab-u` enables the `crontab` file parser with user support ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/crontab_u))
|
||||
- `--csv` enables the CSV file parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/csv))
|
||||
- `--csv-s` enables the CSV file streaming parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/csv_s))
|
||||
- `--date` enables the `date` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/date))
|
||||
- `--df` enables the `df` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/df))
|
||||
- `--dig` enables the `dig` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/dig))
|
||||
- `--dir` enables the `dir` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/dir))
|
||||
- `--dmidecode` enables the `dmidecode` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/dmidecode))
|
||||
- `--dpkg-l` enables the `dpkg -l` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/dpkg_l))
|
||||
- `--du` enables the `du` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/du))
|
||||
- `--env` enables the `env` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/env))
|
||||
- `--file` enables the `file` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/file))
|
||||
- `--finger` enables the `finger` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/finger))
|
||||
- `--free` enables the `free` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/free))
|
||||
- `--fstab` enables the `/etc/fstab` file parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/fstab))
|
||||
- `--git-log` enables the `git log` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/git_log))
|
||||
- `--group` enables the `/etc/group` file parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/group))
|
||||
- `--gshadow` enables the `/etc/gshadow` file parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/gshadow))
|
||||
- `--hash` enables the `hash` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/hash))
|
||||
- `--hashsum` enables the hashsum command parser (`md5sum`, `shasum`, etc.) ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/hashsum))
|
||||
- `--hciconfig` enables the `hciconfig` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/hciconfig))
|
||||
- `--history` enables the `history` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/history))
|
||||
- `--hosts` enables the `/etc/hosts` file parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/hosts))
|
||||
- `--id` enables the `id` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/id))
|
||||
- `--ifconfig` enables the `ifconfig` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/ifconfig))
|
||||
- `--ini` enables the INI file parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/ini))
|
||||
- `--iostat` enables the `iostat` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/iostat))
|
||||
- `--iostat-s` enables the `iostat` command streaming parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/iostat_s))
|
||||
- `--iptables` enables the `iptables` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/iptables))
|
||||
- `--iw-scan` enables the `iw dev [device] scan` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/iw_scan))
|
||||
- `--jar-manifest` enables the MANIFEST.MF file parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/jar_manifest))
|
||||
- `--jobs` enables the `jobs` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/jobs))
|
||||
- `--kv` enables the Key/Value file parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/kv))
|
||||
- `--last` enables the `last` and `lastb` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/last))
|
||||
- `--ls` enables the `ls` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/ls))
|
||||
- `--ls-s` enables the `ls` command streaming parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/ls_s))
|
||||
- `--lsblk` enables the `lsblk` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/lsblk))
|
||||
- `--lsmod` enables the `lsmod` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/lsmod))
|
||||
- `--lsof` enables the `lsof` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/lsof))
|
||||
- `--lsusb` enables the `lsusb` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/lsusb))
|
||||
- `--mount` enables the `mount` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/mount))
|
||||
- `--mpstat` enables the `mpstat` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/mpstat))
|
||||
- `--mpstat-s` enables the `mpstat` command streaming parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/mpstat_s))
|
||||
- `--netstat` enables the `netstat` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/netstat))
|
||||
- `--nmcli` enables the `nmcli` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/nmcli))
|
||||
- `--ntpq` enables the `ntpq -p` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/ntpq))
|
||||
- `--passwd` enables the `/etc/passwd` file parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/passwd))
|
||||
- `--pidstat` enables the `pidstat` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/pidstat))
|
||||
- `--pidstat-s` enables the `pidstat` command streaming parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/pidstat_s))
|
||||
- `--ping` enables the `ping` and `ping6` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/ping))
|
||||
- `--ping-s` enables the `ping` and `ping6` command streaming parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/ping_s))
|
||||
- `--pip-list` enables the `pip list` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/pip_list))
|
||||
- `--pip-show` enables the `pip show` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/pip_show))
|
||||
- `--ps` enables the `ps` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/ps))
|
||||
- `--route` enables the `route` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/route))
|
||||
- `--rpm-qi` enables the `rpm -qi` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/rpm_qi))
|
||||
- `--rsync` enables the `rsync` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/rsync))
|
||||
- `--rsync-s` enables the `rsync` command streaming parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/rsync_s))
|
||||
- `--sfdisk` enables the `sfdisk` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/sfdisk))
|
||||
- `--shadow` enables the `/etc/shadow` file parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/shadow))
|
||||
- `--ss` enables the `ss` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/ss))
|
||||
- `--stat` enables the `stat` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/stat))
|
||||
- `--stat-s` enables the `stat` command streaming parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/stat_s))
|
||||
- `--sysctl` enables the `sysctl` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/sysctl))
|
||||
- `--systemctl` enables the `systemctl` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/systemctl))
|
||||
- `--systemctl-lj` enables the `systemctl list-jobs` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/systemctl_lj))
|
||||
- `--systemctl-ls` enables the `systemctl list-sockets` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/systemctl_ls))
|
||||
- `--systemctl-luf` enables the `systemctl list-unit-files` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/systemctl_luf))
|
||||
- `--systeminfo` enables the `systeminfo` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/systeminfo))
|
||||
- `--time` enables the `/usr/bin/time` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/time))
|
||||
- `--timedatectl` enables the `timedatectl status` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/timedatectl))
|
||||
- `--tracepath` enables the `tracepath` and `tracepath6` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/tracepath))
|
||||
- `--traceroute` enables the `traceroute` and `traceroute6` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/traceroute))
|
||||
- `--ufw` enables the `ufw status` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/ufw))
|
||||
- `--ufw-appinfo` enables the `ufw app info [application]` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/ufw_appinfo))
|
||||
- `--uname` enables the `uname -a` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/uname))
|
||||
- `--update-alt-gs` enables the `update-alternatives --get-selections` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/update_alt_gs))
|
||||
- `--update-alt-q` enables the `update-alternatives --query` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/update_alt_q))
|
||||
- `--upower` enables the `upower` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/upower))
|
||||
- `--uptime` enables the `uptime` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/uptime))
|
||||
- `--vmstat` enables the `vmstat` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/vmstat))
|
||||
- `--vmstat-s` enables the `vmstat` command streaming parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/vmstat_s))
|
||||
- `--w` enables the `w` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/w))
|
||||
- `--wc` enables the `wc` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/wc))
|
||||
- `--who` enables the `who` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/who))
|
||||
- `--xml` enables the XML file parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/xml))
|
||||
- `--xrandr` enables the `xrandr` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/xrandr))
|
||||
- `--yaml` enables the YAML file parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/yaml))
|
||||
- `--zipinfo` enables the `zipinfo` command parser ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/zipinfo))
|
||||
| Argument | Command or Filetype | Documentation |
|
||||
|--------------|-------------------------|-------------------|
|
||||
| `--acpi` | `acpi` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/acpi) |
|
||||
| `--airport` | `airport -I` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/airport) |
|
||||
| `--airport-s` | `airport -s` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/airport_s) |
|
||||
| `--arp` | `arp` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/arp) |
|
||||
| `--asciitable` | ASCII and Unicode table parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/asciitable) |
|
||||
| `--asciitable-m` | multi-line ASCII and Unicode table parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/asciitable_m) |
|
||||
| `--blkid` | `blkid` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/blkid) |
|
||||
| `--chage` | `chage --list` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/chage) |
|
||||
| `--cksum` | `cksum` and `sum` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/cksum) |
|
||||
| `--crontab` | `crontab` command and file parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/crontab) |
|
||||
| `--crontab-u` | `crontab` file parser with user support | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/crontab_u) |
|
||||
| `--csv` | CSV file parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/csv) |
|
||||
| `--csv-s` | CSV file streaming parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/csv_s) |
|
||||
| `--date` | `date` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/date) |
|
||||
| `--df` | `df` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/df) |
|
||||
| `--dig` | `dig` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/dig) |
|
||||
| `--dir` | `dir` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/dir) |
|
||||
| `--dmidecode` | `dmidecode` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/dmidecode) |
|
||||
| `--dpkg-l` | `dpkg -l` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/dpkg_l) |
|
||||
| `--du` | `du` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/du) |
|
||||
| `--env` | `env` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/env) |
|
||||
| `--file` | `file` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/file) |
|
||||
| `--finger` | `finger` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/finger) |
|
||||
| `--free` | `free` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/free) |
|
||||
| `--fstab` | `/etc/fstab` file parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/fstab) |
|
||||
| `--git-log` | `git log` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/git_log) |
|
||||
| `--git-log-s` | `git log` command streaming parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/git_log_s) |
|
||||
| `--group` | `/etc/group` file parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/group) |
|
||||
| `--gshadow` | `/etc/gshadow` file parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/gshadow) |
|
||||
| `--hash` | `hash` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/hash) |
|
||||
| `--hashsum` | hashsum command parser (`md5sum`, `shasum`, etc.) | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/hashsum) |
|
||||
| `--hciconfig` | `hciconfig` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/hciconfig) |
|
||||
| `--history` | `history` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/history) |
|
||||
| `--hosts` | `/etc/hosts` file parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/hosts) |
|
||||
| `--id` | `id` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/id) |
|
||||
| `--ifconfig` | `ifconfig` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/ifconfig) |
|
||||
| `--ini` | INI file parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/ini) |
|
||||
| `--iostat` | `iostat` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/iostat) |
|
||||
| `--iostat-s` | `iostat` command streaming parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/iostat_s) |
|
||||
| `--iptables` | `iptables` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/iptables) |
|
||||
| `--iw-scan` | `iw dev [device] scan` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/iw_scan) |
|
||||
| `--jar-manifest` | MANIFEST.MF file parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/jar_manifest) |
|
||||
| `--jobs` | `jobs` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/jobs) |
|
||||
| `--kv` | Key/Value file parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/kv) |
|
||||
| `--last` | `last` and `lastb` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/last) |
|
||||
| `--ls` | `ls` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/ls) |
|
||||
| `--ls-s` | `ls` command streaming parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/ls_s) |
|
||||
| `--lsblk` | `lsblk` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/lsblk) |
|
||||
| `--lsmod` | `lsmod` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/lsmod) |
|
||||
| `--lsof` | `lsof` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/lsof) |
|
||||
| `--lsusb` | `lsusb` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/lsusb) |
|
||||
| `--mount` | `mount` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/mount) |
|
||||
| `--mpstat` | `mpstat` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/mpstat) |
|
||||
| `--mpstat-s` | `mpstat` command streaming parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/mpstat_s) |
|
||||
| `--netstat` | `netstat` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/netstat) |
|
||||
| `--nmcli` | `nmcli` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/nmcli) |
|
||||
| `--ntpq` | `ntpq -p` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/ntpq) |
|
||||
| `--passwd` | `/etc/passwd` file parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/passwd) |
|
||||
| `--pidstat` | `pidstat` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/pidstat) |
|
||||
| `--pidstat-s` | `pidstat` command streaming parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/pidstat_s) |
|
||||
| `--ping` | `ping` and `ping6` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/ping) |
|
||||
| `--ping-s` | `ping` and `ping6` command streaming parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/ping_s) |
|
||||
| `--pip-list` | `pip list` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/pip_list) |
|
||||
| `--pip-show` | `pip show` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/pip_show) |
|
||||
| `--ps` | `ps` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/ps) |
|
||||
| `--route` | `route` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/route) |
|
||||
| `--rpm-qi` | `rpm -qi` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/rpm_qi) |
|
||||
| `--rsync` | `rsync` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/rsync) |
|
||||
| `--rsync-s` | `rsync` command streaming parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/rsync_s) |
|
||||
| `--sfdisk` | `sfdisk` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/sfdisk) |
|
||||
| `--shadow` | `/etc/shadow` file parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/shadow) |
|
||||
| `--ss` | `ss` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/ss) |
|
||||
| `--stat` | `stat` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/stat) |
|
||||
| `--stat-s` | `stat` command streaming parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/stat_s) |
|
||||
| `--sysctl` | `sysctl` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/sysctl) |
|
||||
| `--systemctl` | `systemctl` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/systemctl) |
|
||||
| `--systemctl-lj` | `systemctl list-jobs` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/systemctl_lj) |
|
||||
| `--systemctl-ls` | `systemctl list-sockets` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/systemctl_ls) |
|
||||
| `--systemctl-luf` | `systemctl list-unit-files` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/systemctl_luf) |
|
||||
| `--systeminfo` | `systeminfo` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/systeminfo) |
|
||||
| `--time` | `/usr/bin/time` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/time) |
|
||||
| `--timedatectl` | `timedatectl status` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/timedatectl) |
|
||||
| `--tracepath` | `tracepath` and `tracepath6` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/tracepath) |
|
||||
| `--traceroute` | `traceroute` and `traceroute6` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/traceroute) |
|
||||
| `--ufw` | `ufw status` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/ufw) |
|
||||
| `--ufw-appinfo` | `ufw app info [application]` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/ufw_appinfo) |
|
||||
| `--uname` | `uname -a` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/uname) |
|
||||
| `--update-alt-gs` | `update-alternatives --get-selections` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/update_alt_gs) |
|
||||
| `--update-alt-q` | `update-alternatives --query` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/update_alt_q) |
|
||||
| `--upower` | `upower` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/upower) |
|
||||
| `--uptime` | `uptime` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/uptime) |
|
||||
| `--vmstat` | `vmstat` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/vmstat) |
|
||||
| `--vmstat-s` | `vmstat` command streaming parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/vmstat_s) |
|
||||
| `--w` | `w` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/w) |
|
||||
| `--wc` | `wc` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/wc) |
|
||||
| `--who` | `who` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/who) |
|
||||
| `--xml` | XML file parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/xml) |
|
||||
| `--xrandr` | `xrandr` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/xrandr) |
|
||||
| `--yaml` | YAML file parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/yaml) |
|
||||
| `--zipinfo` | `zipinfo` command parser | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/zipinfo) |
|
||||
|
||||
### Options
|
||||
- `-a` about `jc`. Prints information about `jc` and the parsers (in JSON, of
|
||||
@ -374,14 +378,14 @@ $ ping 1.1.1.1 | jc --ping-s -u | jq
|
||||
|
||||
#### Using Streaming Parsers as Python Modules
|
||||
|
||||
Streaming parsers accept any iterable object and return an iterator object
|
||||
(generator) allowing lazy processing of the data. The input data should
|
||||
iterate on lines of string data. Examples of good input data are `sys.stdin` or
|
||||
Streaming parsers accept any iterable object and return an iterable object
|
||||
allowing lazy processing of the data. The input data should iterate on lines
|
||||
of string data. Examples of good input data are `sys.stdin` or
|
||||
`str.splitlines()`.
|
||||
|
||||
To use the generator object in your code, simply loop through it or use the
|
||||
[next()](https://docs.python.org/3/library/functions.html#next) builtin
|
||||
function:
|
||||
To use the returned iterable object in your code, simply loop through it or
|
||||
use the [next()](https://docs.python.org/3/library/functions.html#next)
|
||||
builtin function:
|
||||
```python
|
||||
import jc
|
||||
|
||||
@ -404,8 +408,8 @@ or [`jc/parsers/foo_s.py (streaming)`](https://github.com/kellyjonbrazil/jc/blob
|
||||
parser as a template and simply place a `.py` file in the `jcparsers` subfolder.
|
||||
|
||||
Local plugin filenames must be valid python module names and therefore must
|
||||
start with a letter and consist entirely of alphanumerics. Local plugins
|
||||
may override default parsers.
|
||||
start with a letter and consist entirely of alphanumerics and underscores.
|
||||
Local plugins may override default parsers.
|
||||
|
||||
> Note: The application data directory follows the
|
||||
[XDG Base Directory Specification](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html)
|
||||
|
@ -29,6 +29,11 @@ Headers (keys) are converted to snake-case and newlines between multi-line
|
||||
headers are joined with an underscore. All values are returned as strings,
|
||||
except empty strings, which are converted to None/null.
|
||||
|
||||
> Note: table column separator characters (e.g. `|`) cannot be present
|
||||
inside the cell data. If detected, a warning message will be printed to
|
||||
STDERR and the line will be skipped. The warning message can be suppressed
|
||||
by using the `-q` command option or by setting `quiet=True` in `parse()`.
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ cat table.txt | jc --asciitable-m
|
||||
@ -120,4 +125,4 @@ Returns:
|
||||
### Parser Information
|
||||
Compatibility: linux, darwin, cygwin, win32, aix, freebsd
|
||||
|
||||
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
Version 1.1 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
|
82
docs/parsers/chage.md
Normal file
82
docs/parsers/chage.md
Normal file
@ -0,0 +1,82 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.chage"></a>
|
||||
|
||||
# jc.parsers.chage
|
||||
|
||||
jc - JSON Convert `chage --list` command output parser
|
||||
|
||||
Supports `chage -l <username>` or `chage --list <username>`
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ chage -l johndoe | jc --chage
|
||||
|
||||
or
|
||||
|
||||
$ jc chage -l johndoe
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('chage', chage_command_output)
|
||||
|
||||
Schema:
|
||||
|
||||
{
|
||||
"password_last_changed": string,
|
||||
"password_expires": string,
|
||||
"password_inactive": string,
|
||||
"account_expires": string,
|
||||
"min_days_between_password_change": integer,
|
||||
"max_days_between_password_change": integer,
|
||||
"warning_days_before_password_expires": integer
|
||||
}
|
||||
|
||||
Examples:
|
||||
|
||||
$ chage --list joeuser | jc --chage -p
|
||||
{
|
||||
"password_last_changed": "never",
|
||||
"password_expires": "never",
|
||||
"password_inactive": "never",
|
||||
"account_expires": "never",
|
||||
"min_days_between_password_change": 0,
|
||||
"max_days_between_password_change": 99999,
|
||||
"warning_days_before_password_expires": 7
|
||||
}
|
||||
|
||||
$ chage --list joeuser | jc --chage -p -r
|
||||
{
|
||||
"password_last_changed": "never",
|
||||
"password_expires": "never",
|
||||
"password_inactive": "never",
|
||||
"account_expires": "never",
|
||||
"min_days_between_password_change": "0",
|
||||
"max_days_between_password_change": "99999",
|
||||
"warning_days_before_password_expires": "7"
|
||||
}
|
||||
|
||||
<a id="jc.parsers.chage.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> Dict
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
Dictionary. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
|
||||
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
@ -5,8 +5,8 @@
|
||||
|
||||
jc - JSON Convert `csv` file streaming parser
|
||||
|
||||
> This streaming parser outputs JSON Lines (cli) or returns a Generator
|
||||
iterator of Dictionaries (module)
|
||||
> This streaming parser outputs JSON Lines (cli) or returns an Iterable of
|
||||
Dictionaries (module)
|
||||
|
||||
The `csv` streaming parser will attempt to automatically detect the
|
||||
delimiter character. If the delimiter cannot be detected it will default
|
||||
@ -68,7 +68,7 @@ Examples:
|
||||
def parse(data, raw=False, quiet=False, ignore_exceptions=False)
|
||||
```
|
||||
|
||||
Main text parsing generator function. Returns an iterator object.
|
||||
Main text parsing generator function. Returns an iterable object.
|
||||
|
||||
Parameters:
|
||||
|
||||
@ -79,13 +79,9 @@ Parameters:
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
ignore_exceptions: (boolean) ignore parsing exceptions if True
|
||||
|
||||
Yields:
|
||||
|
||||
Dictionary. Raw or processed structured data.
|
||||
|
||||
Returns:
|
||||
|
||||
Iterator object (generator)
|
||||
Iterable of Dictionaries
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux, darwin, cygwin, win32, aix, freebsd
|
||||
|
@ -120,4 +120,4 @@ Returns:
|
||||
### Parser Information
|
||||
Compatibility: linux, darwin, freebsd
|
||||
|
||||
Version 1.9 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
Version 1.10 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
|
@ -172,4 +172,4 @@ Returns:
|
||||
### Parser Information
|
||||
Compatibility: linux, darwin, cygwin, win32, aix, freebsd
|
||||
|
||||
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
Version 1.1 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
|
111
docs/parsers/git_log_s.md
Normal file
111
docs/parsers/git_log_s.md
Normal file
@ -0,0 +1,111 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.git_log_s"></a>
|
||||
|
||||
# jc.parsers.git\_log\_s
|
||||
|
||||
jc - JSON Convert `git log` command output streaming parser
|
||||
|
||||
> This streaming parser outputs JSON Lines (cli) or returns an Iterable of
|
||||
Dictionaries (module)
|
||||
|
||||
Can be used with the following format options:
|
||||
- `oneline`
|
||||
- `short`
|
||||
- `medium`
|
||||
- `full`
|
||||
- `fuller`
|
||||
|
||||
Additional options supported:
|
||||
- `--stat`
|
||||
- `--shortstat`
|
||||
|
||||
The `epoch` calculated timestamp field is naive. (i.e. based on the
|
||||
local time of the system the parser is run on)
|
||||
|
||||
The `epoch_utc` calculated timestamp field is timezone-aware and is
|
||||
only available if the timezone field is UTC.
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ git log | jc --git-log-s
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
|
||||
result = jc.parse('git_log_s', git_log_command_output.splitlines())
|
||||
for item in result:
|
||||
# do something
|
||||
|
||||
Schema:
|
||||
|
||||
{
|
||||
"commit": string,
|
||||
"author": string,
|
||||
"author_email": string,
|
||||
"date": string,
|
||||
"epoch": integer, [0]
|
||||
"epoch_utc": integer, [1]
|
||||
"commit_by": string,
|
||||
"commit_by_email": string,
|
||||
"commit_by_date": string,
|
||||
"message": string,
|
||||
"stats" : {
|
||||
"files_changed": integer,
|
||||
"insertions": integer,
|
||||
"deletions": integer,
|
||||
"files": [
|
||||
string
|
||||
]
|
||||
}
|
||||
|
||||
# below object only exists if using -qq or ignore_exceptions=True
|
||||
"_jc_meta": {
|
||||
"success": boolean, # false if error parsing
|
||||
"error": string, # exists if "success" is false
|
||||
"line": string # exists if "success" is false
|
||||
}
|
||||
}
|
||||
|
||||
[0] naive timestamp if "date" field is parsable, else null
|
||||
[1] timezone aware timestamp availabe for UTC, else null
|
||||
|
||||
Examples:
|
||||
|
||||
$ git log | jc --git-log-s
|
||||
{"commit":"a730ae18c8e81c5261db132df73cd74f272a0a26","author":"Kelly...}
|
||||
{"commit":"930bf439c06c48a952baec05a9896c8d92b7693e","author":"Kelly...}
|
||||
...
|
||||
|
||||
<a id="jc.parsers.git_log_s.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
@add_jc_meta
|
||||
def parse(data: Iterable[str],
|
||||
raw: bool = False,
|
||||
quiet: bool = False,
|
||||
ignore_exceptions: bool = False) -> Union[Iterable[Dict], tuple]
|
||||
```
|
||||
|
||||
Main text parsing generator function. Returns an iterable object.
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (iterable) line-based text data to parse
|
||||
(e.g. sys.stdin or str.splitlines())
|
||||
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
ignore_exceptions: (boolean) ignore parsing exceptions if True
|
||||
|
||||
|
||||
Returns:
|
||||
|
||||
Iterable of Dictionaries
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux, darwin, cygwin, win32, aix, freebsd
|
||||
|
||||
Version 1.1 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
@ -5,8 +5,8 @@
|
||||
|
||||
jc - JSON Convert `iostat` command output streaming parser
|
||||
|
||||
> This streaming parser outputs JSON Lines (cli) or returns a Generator
|
||||
iterator of Dictionaries (module)
|
||||
> This streaming parser outputs JSON Lines (cli) or returns an Iterable of
|
||||
Dictionaries (module)
|
||||
|
||||
Note: `iostat` version 11 and higher include a JSON output option
|
||||
|
||||
@ -112,7 +112,7 @@ Examples:
|
||||
def parse(data, raw=False, quiet=False, ignore_exceptions=False)
|
||||
```
|
||||
|
||||
Main text parsing generator function. Returns an iterator object.
|
||||
Main text parsing generator function. Returns an iterable object.
|
||||
|
||||
Parameters:
|
||||
|
||||
@ -123,13 +123,9 @@ Parameters:
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
ignore_exceptions: (boolean) ignore parsing exceptions if True
|
||||
|
||||
Yields:
|
||||
|
||||
Dictionary. Raw or processed structured data.
|
||||
|
||||
Returns:
|
||||
|
||||
Iterator object (generator)
|
||||
Iterable of Dictionaries
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
|
@ -5,8 +5,8 @@
|
||||
|
||||
jc - JSON Convert `ls` and `vdir` command output streaming parser
|
||||
|
||||
> This streaming parser outputs JSON Lines (cli) or returns a Generator
|
||||
iterator of Dictionaries (module)
|
||||
> This streaming parser outputs JSON Lines (cli) or returns an Iterable of
|
||||
Dictionaries (module)
|
||||
|
||||
Requires the `-l` option to be used on `ls`. If there are newline characters
|
||||
in the filename, then make sure to use the `-b` option on `ls`.
|
||||
@ -81,7 +81,7 @@ Examples:
|
||||
def parse(data, raw=False, quiet=False, ignore_exceptions=False)
|
||||
```
|
||||
|
||||
Main text parsing generator function. Returns an iterator object.
|
||||
Main text parsing generator function. Returns an iterable object.
|
||||
|
||||
Parameters:
|
||||
|
||||
@ -92,13 +92,9 @@ Parameters:
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
ignore_exceptions: (boolean) ignore parsing exceptions if True
|
||||
|
||||
Yields:
|
||||
|
||||
Dictionary. Raw or processed structured data.
|
||||
|
||||
Returns:
|
||||
|
||||
Iterator object (generator)
|
||||
Iterable of Dictionaries
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux, darwin, cygwin, aix, freebsd
|
||||
|
@ -5,8 +5,8 @@
|
||||
|
||||
jc - JSON Convert `mpstat` command output streaming parser
|
||||
|
||||
> This streaming parser outputs JSON Lines (cli) or returns a Generator
|
||||
iterator of Dictionaries (module)
|
||||
> This streaming parser outputs JSON Lines (cli) or returns an Iterable of
|
||||
Dictionaries (module)
|
||||
|
||||
Note: Latest versions of `mpstat` support JSON output (v11.5.1+)
|
||||
|
||||
@ -101,15 +101,13 @@ Examples:
|
||||
|
||||
```python
|
||||
@add_jc_meta
|
||||
def parse(
|
||||
data: Iterable[str],
|
||||
def parse(data: Iterable[str],
|
||||
raw: bool = False,
|
||||
quiet: bool = False,
|
||||
ignore_exceptions: bool = False
|
||||
) -> Union[Generator[Dict, None, None], tuple]
|
||||
ignore_exceptions: bool = False) -> Union[Iterable[Dict], tuple]
|
||||
```
|
||||
|
||||
Main text parsing generator function. Returns an iterator object.
|
||||
Main text parsing generator function. Returns an iterable object.
|
||||
|
||||
Parameters:
|
||||
|
||||
@ -120,13 +118,9 @@ Parameters:
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
ignore_exceptions: (boolean) ignore parsing exceptions if True
|
||||
|
||||
Yields:
|
||||
|
||||
Dictionary. Raw or processed structured data.
|
||||
|
||||
Returns:
|
||||
|
||||
Iterator object (generator)
|
||||
Iterable of Dictionaries
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
|
@ -5,8 +5,8 @@
|
||||
|
||||
jc - JSON Convert `pidstat` command output streaming parser
|
||||
|
||||
> This streaming parser outputs JSON Lines (cli) or returns a Generator
|
||||
iterator of Dictionaries (module)
|
||||
> This streaming parser outputs JSON Lines (cli) or returns an Iterable of
|
||||
Dictionaries (module)
|
||||
|
||||
Must use the `-h` option in `pidstat`. All other `pidstat` options are
|
||||
supported in combination with `-h`.
|
||||
@ -83,15 +83,13 @@ Examples:
|
||||
|
||||
```python
|
||||
@add_jc_meta
|
||||
def parse(
|
||||
data: Iterable[str],
|
||||
def parse(data: Iterable[str],
|
||||
raw: bool = False,
|
||||
quiet: bool = False,
|
||||
ignore_exceptions: bool = False
|
||||
) -> Union[Generator[Dict, None, None], tuple]
|
||||
ignore_exceptions: bool = False) -> Union[Iterable[Dict], tuple]
|
||||
```
|
||||
|
||||
Main text parsing generator function. Returns an iterator object.
|
||||
Main text parsing generator function. Returns an iterable object.
|
||||
|
||||
Parameters:
|
||||
|
||||
@ -102,13 +100,9 @@ Parameters:
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
ignore_exceptions: (boolean) ignore parsing exceptions if True
|
||||
|
||||
Yields:
|
||||
|
||||
Dictionary. Raw or processed structured data.
|
||||
|
||||
Returns:
|
||||
|
||||
Iterator object (generator)
|
||||
Iterable of Dictionaries
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
|
@ -5,8 +5,8 @@
|
||||
|
||||
jc - JSON Convert `ping` command output streaming parser
|
||||
|
||||
> This streaming parser outputs JSON Lines (cli) or returns a Generator
|
||||
iterator of Dictionaries (module)
|
||||
> This streaming parser outputs JSON Lines (cli) or returns an Iterable of
|
||||
Dictionaries (module)
|
||||
|
||||
Supports `ping` and `ping6` output.
|
||||
|
||||
@ -88,7 +88,7 @@ Examples:
|
||||
def parse(data, raw=False, quiet=False, ignore_exceptions=False)
|
||||
```
|
||||
|
||||
Main text parsing generator function. Returns an iterator object.
|
||||
Main text parsing generator function. Returns an iterable object.
|
||||
|
||||
Parameters:
|
||||
|
||||
@ -99,13 +99,9 @@ Parameters:
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
ignore_exceptions: (boolean) ignore parsing exceptions if True
|
||||
|
||||
Yields:
|
||||
|
||||
Dictionary. Raw or processed structured data.
|
||||
|
||||
Returns:
|
||||
|
||||
Iterator object (generator)
|
||||
Iterable of Dictionaries
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux, darwin, freebsd
|
||||
|
@ -5,8 +5,8 @@
|
||||
|
||||
jc - JSON Convert `rsync` command output streaming parser
|
||||
|
||||
> This streaming parser outputs JSON Lines (cli) or returns a Generator
|
||||
iterator of Dictionaries (module)
|
||||
> This streaming parser outputs JSON Lines (cli) or returns an Iterable of
|
||||
Dictionaries (module)
|
||||
|
||||
Supports the `-i` or `--itemize-changes` options with all levels of
|
||||
verbosity. This parser will process the STDOUT output or a log file
|
||||
@ -90,15 +90,13 @@ Examples:
|
||||
|
||||
```python
|
||||
@add_jc_meta
|
||||
def parse(
|
||||
data: Iterable[str],
|
||||
def parse(data: Iterable[str],
|
||||
raw: bool = False,
|
||||
quiet: bool = False,
|
||||
ignore_exceptions: bool = False
|
||||
) -> Union[Generator[Dict, None, None], tuple]
|
||||
ignore_exceptions: bool = False) -> Union[Iterable[Dict], tuple]
|
||||
```
|
||||
|
||||
Main text parsing generator function. Returns an iterator object.
|
||||
Main text parsing generator function. Returns an iterable object.
|
||||
|
||||
Parameters:
|
||||
|
||||
@ -109,13 +107,9 @@ Parameters:
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
ignore_exceptions: (boolean) ignore parsing exceptions if True
|
||||
|
||||
Yields:
|
||||
|
||||
Dictionary. Raw or processed structured data.
|
||||
|
||||
Returns:
|
||||
|
||||
Iterator object (generator)
|
||||
Iterable of Dictionaries
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux, darwin, freebsd
|
||||
|
@ -5,8 +5,8 @@
|
||||
|
||||
jc - JSON Convert `stat` command output streaming parser
|
||||
|
||||
> This streaming parser outputs JSON Lines (cli) or returns a Generator
|
||||
iterator of Dictionaries (module)
|
||||
> This streaming parser outputs JSON Lines (cli) or returns an Iterable of
|
||||
Dictionaries (module)
|
||||
|
||||
The `xxx_epoch` calculated timestamp fields are naive. (i.e. based on the
|
||||
local time of the system the parser is run on).
|
||||
@ -86,7 +86,7 @@ Examples:
|
||||
def parse(data, raw=False, quiet=False, ignore_exceptions=False)
|
||||
```
|
||||
|
||||
Main text parsing generator function. Returns an iterator object.
|
||||
Main text parsing generator function. Returns an iterable object.
|
||||
|
||||
Parameters:
|
||||
|
||||
@ -97,13 +97,9 @@ Parameters:
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
ignore_exceptions: (boolean) ignore parsing exceptions if True
|
||||
|
||||
Yields:
|
||||
|
||||
Dictionary. Raw or processed structured data.
|
||||
|
||||
Returns:
|
||||
|
||||
Iterator object (generator)
|
||||
Iterable of Dictionaries
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux, darwin, freebsd
|
||||
|
@ -5,8 +5,8 @@
|
||||
|
||||
jc - JSON Convert `vmstat` command output streaming parser
|
||||
|
||||
> This streaming parser outputs JSON Lines (cli) or returns a Generator
|
||||
iterator of Dictionaries (module)
|
||||
> This streaming parser outputs JSON Lines (cli) or returns an Iterable of
|
||||
Dictionaries (module)
|
||||
|
||||
Options supported: `-a`, `-w`, `-d`, `-t`
|
||||
|
||||
@ -105,7 +105,7 @@ Examples:
|
||||
def parse(data, raw=False, quiet=False, ignore_exceptions=False)
|
||||
```
|
||||
|
||||
Main text parsing generator function. Returns an iterator object.
|
||||
Main text parsing generator function. Returns an iterable object.
|
||||
|
||||
Parameters:
|
||||
|
||||
@ -116,13 +116,9 @@ Parameters:
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
ignore_exceptions: (boolean) ignore parsing exceptions if True
|
||||
|
||||
Yields:
|
||||
|
||||
Dictionary. Raw or processed structured data.
|
||||
|
||||
Returns:
|
||||
|
||||
Iterator object (generator)
|
||||
Iterable of Dictionaries
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
|
@ -26,11 +26,12 @@ https://github.com/kellyjonbrazil/jc/tree/master/docs
|
||||
|
||||
### Specific Version
|
||||
|
||||
Replace `<full_version_number>` - e.g. `1.17.7`:
|
||||
|
||||
`https://github.com/kellyjonbrazil/jc/tree/v<full_version_number>/docs`
|
||||
|
||||
Specific versions can also be selected by tag in the branch dropdown menu.
|
||||
> Replace `<full_version_number>` - e.g. `1.18.0`:
|
||||
|
||||
Specific versions can also be selected by tag in the branch Github dropdown
|
||||
menu.
|
||||
|
||||
## Usage Example
|
||||
|
||||
@ -93,14 +94,14 @@ its module name.
|
||||
|
||||
### parser_mod_list
|
||||
|
||||
parser_mod_list() -> list
|
||||
parser_mod_list() -> list[str]
|
||||
|
||||
Get a list of all available parser module names to be used in
|
||||
`parse()`, `parser_info()`, and `get_help()`.
|
||||
|
||||
### plugin_parser_mod_list
|
||||
|
||||
plugin_parser_mod_list() -> list
|
||||
plugin_parser_mod_list() -> list[str]
|
||||
|
||||
Get a list of plugin parser module names to be used in
|
||||
`parse()`, `parser_info()`, and `get_help()`. This list is a subset of
|
||||
@ -108,7 +109,7 @@ Get a list of plugin parser module names to be used in
|
||||
|
||||
### standard_parser_mod_list
|
||||
|
||||
standard_parser_mod_list() -> list
|
||||
standard_parser_mod_list() -> list[str]
|
||||
|
||||
Get a list of standard parser module names to be used in
|
||||
`parse()`, `parser_info()`, and `get_help()`. This list is a subset of
|
||||
@ -116,7 +117,7 @@ Get a list of standard parser module names to be used in
|
||||
|
||||
### streaming_parser_mod_list
|
||||
|
||||
streaming_parser_mod_list() -> list
|
||||
streaming_parser_mod_list() -> list[str]
|
||||
|
||||
Get a list of streaming parser module names to be used in
|
||||
`parse()`, `parser_info()`, and `get_help()`. This list is a subset of
|
||||
|
@ -22,11 +22,12 @@ https://github.com/kellyjonbrazil/jc/tree/master/docs
|
||||
|
||||
### Specific Version
|
||||
|
||||
Replace `<full_version_number>` - e.g. `1.17.7`:
|
||||
|
||||
`https://github.com/kellyjonbrazil/jc/tree/v<full_version_number>/docs`
|
||||
|
||||
Specific versions can also be selected by tag in the branch dropdown menu.
|
||||
> Replace `<full_version_number>` - e.g. `1.18.0`:
|
||||
|
||||
Specific versions can also be selected by tag in the branch Github dropdown
|
||||
menu.
|
||||
|
||||
## Usage Example
|
||||
|
||||
@ -89,14 +90,14 @@ its module name.
|
||||
|
||||
### parser_mod_list
|
||||
|
||||
parser_mod_list() -> list
|
||||
parser_mod_list() -> list[str]
|
||||
|
||||
Get a list of all available parser module names to be used in
|
||||
`parse()`, `parser_info()`, and `get_help()`.
|
||||
|
||||
### plugin_parser_mod_list
|
||||
|
||||
plugin_parser_mod_list() -> list
|
||||
plugin_parser_mod_list() -> list[str]
|
||||
|
||||
Get a list of plugin parser module names to be used in
|
||||
`parse()`, `parser_info()`, and `get_help()`. This list is a subset of
|
||||
@ -104,7 +105,7 @@ Get a list of plugin parser module names to be used in
|
||||
|
||||
### standard_parser_mod_list
|
||||
|
||||
standard_parser_mod_list() -> list
|
||||
standard_parser_mod_list() -> list[str]
|
||||
|
||||
Get a list of standard parser module names to be used in
|
||||
`parse()`, `parser_info()`, and `get_help()`. This list is a subset of
|
||||
@ -112,7 +113,7 @@ Get a list of standard parser module names to be used in
|
||||
|
||||
### streaming_parser_mod_list
|
||||
|
||||
streaming_parser_mod_list() -> list
|
||||
streaming_parser_mod_list() -> list[str]
|
||||
|
||||
Get a list of streaming parser module names to be used in
|
||||
`parse()`, `parser_info()`, and `get_help()`. This list is a subset of
|
||||
|
40
jc/cli.py
40
jc/cli.py
@ -84,26 +84,6 @@ if PYGMENTS_INSTALLED:
|
||||
}
|
||||
|
||||
|
||||
def safe_print_json(string, pretty=None, env_colors=None, mono=None,
|
||||
piped_out=None, flush=None):
|
||||
"""Safely prints JSON output in both UTF-8 and ASCII systems"""
|
||||
try:
|
||||
print(json_out(string,
|
||||
pretty=pretty,
|
||||
env_colors=env_colors,
|
||||
mono=mono,
|
||||
piped_out=piped_out),
|
||||
flush=flush)
|
||||
except UnicodeEncodeError:
|
||||
print(json_out(string,
|
||||
pretty=pretty,
|
||||
env_colors=env_colors,
|
||||
mono=mono,
|
||||
piped_out=piped_out,
|
||||
ascii_only=True),
|
||||
flush=flush)
|
||||
|
||||
|
||||
def set_env_colors(env_colors=None):
|
||||
"""
|
||||
Return a dictionary to be used in Pygments custom style class.
|
||||
@ -307,6 +287,26 @@ def json_out(data, pretty=False, env_colors=None, mono=False, piped_out=False, a
|
||||
return j_string
|
||||
|
||||
|
||||
def safe_print_json(list_or_dict, pretty=None, env_colors=None, mono=None,
|
||||
piped_out=None, flush=None):
|
||||
"""Safely prints JSON output in both UTF-8 and ASCII systems"""
|
||||
try:
|
||||
print(json_out(list_or_dict,
|
||||
pretty=pretty,
|
||||
env_colors=env_colors,
|
||||
mono=mono,
|
||||
piped_out=piped_out),
|
||||
flush=flush)
|
||||
except UnicodeEncodeError:
|
||||
print(json_out(list_or_dict,
|
||||
pretty=pretty,
|
||||
env_colors=env_colors,
|
||||
mono=mono,
|
||||
piped_out=piped_out,
|
||||
ascii_only=True),
|
||||
flush=flush)
|
||||
|
||||
|
||||
def magic_parser(args):
|
||||
"""
|
||||
Parse command arguments for magic syntax: jc -p ls -al
|
||||
|
@ -6,7 +6,7 @@ import importlib
|
||||
from typing import Dict, List, Iterable, Union, Iterator
|
||||
from jc import appdirs
|
||||
|
||||
__version__ = '1.18.8'
|
||||
__version__ = '1.19.0'
|
||||
|
||||
parsers = [
|
||||
'acpi',
|
||||
@ -16,6 +16,7 @@ parsers = [
|
||||
'asciitable',
|
||||
'asciitable-m',
|
||||
'blkid',
|
||||
'chage',
|
||||
'cksum',
|
||||
'crontab',
|
||||
'crontab-u',
|
||||
@ -34,6 +35,7 @@ parsers = [
|
||||
'free',
|
||||
'fstab',
|
||||
'git-log',
|
||||
'git-log-s',
|
||||
'group',
|
||||
'gshadow',
|
||||
'hash',
|
||||
|
@ -24,6 +24,11 @@ Headers (keys) are converted to snake-case and newlines between multi-line
|
||||
headers are joined with an underscore. All values are returned as strings,
|
||||
except empty strings, which are converted to None/null.
|
||||
|
||||
> Note: table column separator characters (e.g. `|`) cannot be present
|
||||
inside the cell data. If detected, a warning message will be printed to
|
||||
STDERR and the line will be skipped. The warning message can be suppressed
|
||||
by using the `-q` command option or by setting `quiet=True` in `parse()`.
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ cat table.txt | jc --asciitable-m
|
||||
@ -101,7 +106,7 @@ from jc.exceptions import ParseError
|
||||
|
||||
class info():
|
||||
"""Provides parser metadata (version, author, etc.)"""
|
||||
version = '1.0'
|
||||
version = '1.1'
|
||||
description = 'multi-line ASCII and Unicode table parser'
|
||||
author = 'Kelly Brazil'
|
||||
author_email = 'kellyjonbrazil@gmail.com'
|
||||
@ -377,11 +382,12 @@ def _collapse_headers(table: List[List[str]]) -> List[str]:
|
||||
return result
|
||||
|
||||
|
||||
def _collapse_data(table: List[List[List[str]]]) -> List[List[str]]:
|
||||
def _collapse_data(table: List[List[List[str]]], quiet=False) -> List[List[str]]:
|
||||
"""combine data rows to return a simple list of lists"""
|
||||
result: List[List[str]] = []
|
||||
|
||||
for row in table:
|
||||
for index, row in enumerate(table):
|
||||
try:
|
||||
new_row: List[str] = []
|
||||
for line in row:
|
||||
if new_row:
|
||||
@ -391,6 +397,12 @@ def _collapse_data(table: List[List[List[str]]]) -> List[List[str]]:
|
||||
new_row = line
|
||||
|
||||
result.append(new_row)
|
||||
except IndexError:
|
||||
if not quiet:
|
||||
row_string = '\n'.join([' | '.join(l) for l in row])
|
||||
jc.utils.warning_message(
|
||||
[f'Possible table separator character found in row {index}: {row_string}. Skipping.']
|
||||
)
|
||||
|
||||
return result
|
||||
|
||||
@ -409,14 +421,14 @@ def _create_table_dict(header: List[str], data: List[List[str]]) -> List[Dict[st
|
||||
return table_list_dict
|
||||
|
||||
|
||||
def _parse_pretty(string: str) -> List[Dict[str, Optional[str]]]:
|
||||
def _parse_pretty(string: str, quiet: bool =False) -> List[Dict[str, Optional[str]]]:
|
||||
string_lines: List[str] = string.splitlines()
|
||||
clean: List[Tuple[int, List[str]]] = _normalize_rows(string_lines)
|
||||
raw_headers: List[List[str]] = _get_headers(clean)
|
||||
raw_data: List[List[List[str]]] = _get_data(clean)
|
||||
|
||||
new_headers: List[str] = _collapse_headers(raw_headers)
|
||||
new_data: List[List[str]] = _collapse_data(raw_data)
|
||||
new_data: List[List[str]] = _collapse_data(raw_data, quiet)
|
||||
final_table: List[Dict[str, Optional[str]]] = _create_table_dict(new_headers, new_data)
|
||||
|
||||
return final_table
|
||||
@ -452,7 +464,7 @@ def parse(
|
||||
table_type = _table_sniff(data)
|
||||
|
||||
if table_type == 'pretty':
|
||||
raw_output = _parse_pretty(data)
|
||||
raw_output = _parse_pretty(data, quiet)
|
||||
elif table_type == 'markdown':
|
||||
raise ParseError('Only "pretty" tables supported with multiline. "markdown" table detected. Please try the "asciitable" parser.')
|
||||
else:
|
||||
|
151
jc/parsers/chage.py
Normal file
151
jc/parsers/chage.py
Normal file
@ -0,0 +1,151 @@
|
||||
"""jc - JSON Convert `chage --list` command output parser
|
||||
|
||||
Supports `chage -l <username>` or `chage --list <username>`
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ chage -l johndoe | jc --chage
|
||||
|
||||
or
|
||||
|
||||
$ jc chage -l johndoe
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('chage', chage_command_output)
|
||||
|
||||
Schema:
|
||||
|
||||
{
|
||||
"password_last_changed": string,
|
||||
"password_expires": string,
|
||||
"password_inactive": string,
|
||||
"account_expires": string,
|
||||
"min_days_between_password_change": integer,
|
||||
"max_days_between_password_change": integer,
|
||||
"warning_days_before_password_expires": integer
|
||||
}
|
||||
|
||||
Examples:
|
||||
|
||||
$ chage --list joeuser | jc --chage -p
|
||||
{
|
||||
"password_last_changed": "never",
|
||||
"password_expires": "never",
|
||||
"password_inactive": "never",
|
||||
"account_expires": "never",
|
||||
"min_days_between_password_change": 0,
|
||||
"max_days_between_password_change": 99999,
|
||||
"warning_days_before_password_expires": 7
|
||||
}
|
||||
|
||||
$ chage --list joeuser | jc --chage -p -r
|
||||
{
|
||||
"password_last_changed": "never",
|
||||
"password_expires": "never",
|
||||
"password_inactive": "never",
|
||||
"account_expires": "never",
|
||||
"min_days_between_password_change": "0",
|
||||
"max_days_between_password_change": "99999",
|
||||
"warning_days_before_password_expires": "7"
|
||||
}
|
||||
"""
|
||||
from typing import List, Dict
|
||||
import jc.utils
|
||||
|
||||
|
||||
class info():
|
||||
"""Provides parser metadata (version, author, etc.)"""
|
||||
version = '1.0'
|
||||
description = '`chage --list` command parser'
|
||||
author = 'Kelly Brazil'
|
||||
author_email = 'kellyjonbrazil@gmail.com'
|
||||
compatible = ['linux']
|
||||
magic_commands = ['chage --list', 'chage -l']
|
||||
|
||||
|
||||
__version__ = info.version
|
||||
|
||||
|
||||
def _process(proc_data: Dict) -> Dict:
|
||||
"""
|
||||
Final processing to conform to the schema.
|
||||
|
||||
Parameters:
|
||||
|
||||
proc_data: (Dictionary) raw structured data to process
|
||||
|
||||
Returns:
|
||||
|
||||
Dictionary. Structured to conform to the schema.
|
||||
"""
|
||||
int_list = ['min_days_between_password_change', 'max_days_between_password_change',
|
||||
'warning_days_before_password_expires']
|
||||
|
||||
for key in proc_data:
|
||||
if key in int_list:
|
||||
proc_data[key] = jc.utils.convert_to_int(proc_data[key])
|
||||
|
||||
return proc_data
|
||||
|
||||
|
||||
def parse(
|
||||
data: str,
|
||||
raw: bool = False,
|
||||
quiet: bool = False
|
||||
) -> Dict:
|
||||
"""
|
||||
Main text parsing function
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (string) text data to parse
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
|
||||
Returns:
|
||||
|
||||
Dictionary. Raw or processed structured data.
|
||||
"""
|
||||
jc.utils.compatibility(__name__, info.compatible, quiet)
|
||||
jc.utils.input_type_check(data)
|
||||
|
||||
raw_output: Dict = {}
|
||||
|
||||
if jc.utils.has_data(data):
|
||||
|
||||
for line in filter(None, data.splitlines()):
|
||||
key, val = line.split(':', maxsplit=1)
|
||||
key = key.strip()
|
||||
val = val.strip()
|
||||
|
||||
if key == 'Last password change':
|
||||
raw_output['password_last_changed'] = val
|
||||
continue
|
||||
|
||||
if key == 'Password expires':
|
||||
raw_output['password_expires'] = val
|
||||
continue
|
||||
|
||||
if key == 'Password inactive':
|
||||
raw_output['password_inactive'] = val
|
||||
continue
|
||||
|
||||
if key == 'Account expires':
|
||||
raw_output['account_expires'] = val
|
||||
continue
|
||||
|
||||
if key == 'Minimum number of days between password change':
|
||||
raw_output['min_days_between_password_change'] = val
|
||||
continue
|
||||
|
||||
if key == 'Maximum number of days between password change':
|
||||
raw_output['max_days_between_password_change'] = val
|
||||
continue
|
||||
|
||||
if key == 'Number of days of warning before password expires':
|
||||
raw_output['warning_days_before_password_expires'] = val
|
||||
continue
|
||||
|
||||
return raw_output if raw else _process(raw_output)
|
@ -1,7 +1,7 @@
|
||||
"""jc - JSON Convert `csv` file streaming parser
|
||||
|
||||
> This streaming parser outputs JSON Lines (cli) or returns a Generator
|
||||
iterator of Dictionaries (module)
|
||||
> This streaming parser outputs JSON Lines (cli) or returns an Iterable of
|
||||
Dictionaries (module)
|
||||
|
||||
The `csv` streaming parser will attempt to automatically detect the
|
||||
delimiter character. If the delimiter cannot be detected it will default
|
||||
@ -95,7 +95,7 @@ def _process(proc_data):
|
||||
@add_jc_meta
|
||||
def parse(data, raw=False, quiet=False, ignore_exceptions=False):
|
||||
"""
|
||||
Main text parsing generator function. Returns an iterator object.
|
||||
Main text parsing generator function. Returns an iterable object.
|
||||
|
||||
Parameters:
|
||||
|
||||
@ -106,13 +106,9 @@ def parse(data, raw=False, quiet=False, ignore_exceptions=False):
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
ignore_exceptions: (boolean) ignore parsing exceptions if True
|
||||
|
||||
Yields:
|
||||
|
||||
Dictionary. Raw or processed structured data.
|
||||
|
||||
Returns:
|
||||
|
||||
Iterator object (generator)
|
||||
Iterable of Dictionaries
|
||||
"""
|
||||
jc.utils.compatibility(__name__, info.compatible, quiet)
|
||||
streaming_input_type_check(data)
|
||||
|
@ -99,7 +99,7 @@ import jc.parsers.universal
|
||||
|
||||
class info():
|
||||
"""Provides parser metadata (version, author, etc.)"""
|
||||
version = '1.9'
|
||||
version = '1.10'
|
||||
description = '`df` command parser'
|
||||
author = 'Kelly Brazil'
|
||||
author_email = 'kellyjonbrazil@gmail.com'
|
||||
@ -208,7 +208,9 @@ def parse(data, raw=False, quiet=False):
|
||||
jc.utils.compatibility(__name__, info.compatible, quiet)
|
||||
jc.utils.input_type_check(data)
|
||||
|
||||
cleandata = data.splitlines()
|
||||
# remove blank lines
|
||||
cleandata = list(filter(None, data.splitlines()))
|
||||
|
||||
fix_data = []
|
||||
raw_output = []
|
||||
filesystem_map = {}
|
||||
|
@ -1,7 +1,7 @@
|
||||
"""jc - JSON Convert `foo` command output streaming parser
|
||||
|
||||
> This streaming parser outputs JSON Lines (cli) or returns a Generator
|
||||
iterator of Dictionaries (module)
|
||||
> This streaming parser outputs JSON Lines (cli) or returns an Iterable of
|
||||
Dictionaries (module)
|
||||
|
||||
<<Short foo description and caveats>>
|
||||
|
||||
@ -40,7 +40,7 @@ Examples:
|
||||
{example output}
|
||||
...
|
||||
"""
|
||||
from typing import Dict, Iterable, Generator, Union
|
||||
from typing import Dict, Iterable, Union
|
||||
import jc.utils
|
||||
from jc.streaming import (
|
||||
add_jc_meta, streaming_input_type_check, streaming_line_input_type_check, raise_or_yield
|
||||
@ -90,9 +90,9 @@ def parse(
|
||||
raw: bool = False,
|
||||
quiet: bool = False,
|
||||
ignore_exceptions: bool = False
|
||||
) -> Union[Generator[Dict, None, None], tuple]:
|
||||
) -> Union[Iterable[Dict], tuple]:
|
||||
"""
|
||||
Main text parsing generator function. Returns an iterator object.
|
||||
Main text parsing generator function. Returns an iterable object.
|
||||
|
||||
Parameters:
|
||||
|
||||
@ -103,13 +103,10 @@ def parse(
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
ignore_exceptions: (boolean) ignore parsing exceptions if True
|
||||
|
||||
Yields:
|
||||
|
||||
Dictionary. Raw or processed structured data.
|
||||
|
||||
Returns:
|
||||
|
||||
Iterator object (generator)
|
||||
Iterable of Dictionaries
|
||||
"""
|
||||
jc.utils.compatibility(__name__, info.compatible, quiet)
|
||||
streaming_input_type_check(data)
|
||||
|
@ -148,12 +148,12 @@ import re
|
||||
from typing import List, Dict
|
||||
import jc.utils
|
||||
|
||||
hash_pattern = re.compile(r'([0-9]|[a-f])+')
|
||||
hash_pattern = re.compile(r'(?:[0-9]|[a-f]){40}')
|
||||
changes_pattern = re.compile(r'\s(?P<files>\d+)\s+(files? changed),\s+(?P<insertions>\d+)\s(insertions?\(\+\))?(,\s+)?(?P<deletions>\d+)?(\s+deletions?\(\-\))?')
|
||||
|
||||
class info():
|
||||
"""Provides parser metadata (version, author, etc.)"""
|
||||
version = '1.0'
|
||||
version = '1.1'
|
||||
description = '`git log` command parser'
|
||||
author = 'Kelly Brazil'
|
||||
author_email = 'kellyjonbrazil@gmail.com'
|
||||
@ -234,7 +234,7 @@ def parse(
|
||||
line_list = line.split(maxsplit=1)
|
||||
|
||||
# oneline style
|
||||
if line_list and _is_commit_hash(line_list[0]):
|
||||
if not line.startswith(' ') and line_list and _is_commit_hash(line_list[0]):
|
||||
if output_line:
|
||||
if file_list:
|
||||
output_line['stats']['files'] = file_list
|
||||
|
282
jc/parsers/git_log_s.py
Normal file
282
jc/parsers/git_log_s.py
Normal file
@ -0,0 +1,282 @@
|
||||
"""jc - JSON Convert `git log` command output streaming parser
|
||||
|
||||
> This streaming parser outputs JSON Lines (cli) or returns an Iterable of
|
||||
Dictionaries (module)
|
||||
|
||||
Can be used with the following format options:
|
||||
- `oneline`
|
||||
- `short`
|
||||
- `medium`
|
||||
- `full`
|
||||
- `fuller`
|
||||
|
||||
Additional options supported:
|
||||
- `--stat`
|
||||
- `--shortstat`
|
||||
|
||||
The `epoch` calculated timestamp field is naive. (i.e. based on the
|
||||
local time of the system the parser is run on)
|
||||
|
||||
The `epoch_utc` calculated timestamp field is timezone-aware and is
|
||||
only available if the timezone field is UTC.
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ git log | jc --git-log-s
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
|
||||
result = jc.parse('git_log_s', git_log_command_output.splitlines())
|
||||
for item in result:
|
||||
# do something
|
||||
|
||||
Schema:
|
||||
|
||||
{
|
||||
"commit": string,
|
||||
"author": string,
|
||||
"author_email": string,
|
||||
"date": string,
|
||||
"epoch": integer, [0]
|
||||
"epoch_utc": integer, [1]
|
||||
"commit_by": string,
|
||||
"commit_by_email": string,
|
||||
"commit_by_date": string,
|
||||
"message": string,
|
||||
"stats" : {
|
||||
"files_changed": integer,
|
||||
"insertions": integer,
|
||||
"deletions": integer,
|
||||
"files": [
|
||||
string
|
||||
]
|
||||
}
|
||||
|
||||
# below object only exists if using -qq or ignore_exceptions=True
|
||||
"_jc_meta": {
|
||||
"success": boolean, # false if error parsing
|
||||
"error": string, # exists if "success" is false
|
||||
"line": string # exists if "success" is false
|
||||
}
|
||||
}
|
||||
|
||||
[0] naive timestamp if "date" field is parsable, else null
|
||||
[1] timezone aware timestamp availabe for UTC, else null
|
||||
|
||||
Examples:
|
||||
|
||||
$ git log | jc --git-log-s
|
||||
{"commit":"a730ae18c8e81c5261db132df73cd74f272a0a26","author":"Kelly...}
|
||||
{"commit":"930bf439c06c48a952baec05a9896c8d92b7693e","author":"Kelly...}
|
||||
...
|
||||
"""
|
||||
import re
|
||||
from typing import List, Dict, Iterable, Union
|
||||
import jc.utils
|
||||
from jc.streaming import (
|
||||
add_jc_meta, streaming_input_type_check, streaming_line_input_type_check, raise_or_yield
|
||||
)
|
||||
from jc.exceptions import ParseError
|
||||
|
||||
|
||||
hash_pattern = re.compile(r'(?:[0-9]|[a-f]){40}')
|
||||
changes_pattern = re.compile(r'\s(?P<files>\d+)\s+(files? changed),\s+(?P<insertions>\d+)\s(insertions?\(\+\))?(,\s+)?(?P<deletions>\d+)?(\s+deletions?\(\-\))?')
|
||||
|
||||
|
||||
class info():
|
||||
"""Provides parser metadata (version, author, etc.)"""
|
||||
version = '1.1'
|
||||
description = '`git log` command streaming parser'
|
||||
author = 'Kelly Brazil'
|
||||
author_email = 'kellyjonbrazil@gmail.com'
|
||||
compatible = ['linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd']
|
||||
streaming = True
|
||||
|
||||
|
||||
__version__ = info.version
|
||||
|
||||
|
||||
def _process(proc_data: Dict) -> Dict:
|
||||
"""
|
||||
Final processing to conform to the schema.
|
||||
|
||||
Parameters:
|
||||
|
||||
proc_data: (Dictionary) raw structured data to process
|
||||
|
||||
Returns:
|
||||
|
||||
Dictionary. Structured data to conform to the schema.
|
||||
"""
|
||||
int_list = ['files_changed', 'insertions', 'deletions']
|
||||
|
||||
if 'date' in proc_data:
|
||||
ts = jc.utils.timestamp(proc_data['date'], format_hint=(1100,))
|
||||
proc_data['epoch'] = ts.naive
|
||||
proc_data['epoch_utc'] = ts.utc
|
||||
|
||||
if 'stats' in proc_data:
|
||||
for key in proc_data['stats']:
|
||||
if key in int_list:
|
||||
proc_data['stats'][key] = jc.utils.convert_to_int(proc_data['stats'][key])
|
||||
|
||||
return proc_data
|
||||
|
||||
|
||||
def _is_commit_hash(hash_string: str) -> bool:
|
||||
# 0c55240e9da30ac4293dc324f1094de2abd3da91
|
||||
if len(hash_string) != 40:
|
||||
return False
|
||||
|
||||
if hash_pattern.match(hash_string):
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
|
||||
@add_jc_meta
|
||||
def parse(
|
||||
data: Iterable[str],
|
||||
raw: bool = False,
|
||||
quiet: bool = False,
|
||||
ignore_exceptions: bool = False
|
||||
) -> Union[Iterable[Dict], tuple]:
|
||||
"""
|
||||
Main text parsing generator function. Returns an iterable object.
|
||||
|
||||
Parameters:
|
||||
|
||||
data: (iterable) line-based text data to parse
|
||||
(e.g. sys.stdin or str.splitlines())
|
||||
|
||||
raw: (boolean) unprocessed output if True
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
ignore_exceptions: (boolean) ignore parsing exceptions if True
|
||||
|
||||
|
||||
Returns:
|
||||
|
||||
Iterable of Dictionaries
|
||||
"""
|
||||
jc.utils.compatibility(__name__, info.compatible, quiet)
|
||||
streaming_input_type_check(data)
|
||||
|
||||
output_line: Dict = {}
|
||||
message_lines: List[str] = []
|
||||
file_list: List[str] = []
|
||||
|
||||
for line in data:
|
||||
try:
|
||||
streaming_line_input_type_check(line)
|
||||
|
||||
if line == '' or line == '\n':
|
||||
continue
|
||||
|
||||
line_list = line.rstrip().split(maxsplit=1)
|
||||
|
||||
# oneline style
|
||||
if not line.startswith(' ') and line_list and _is_commit_hash(line_list[0]):
|
||||
if output_line:
|
||||
if file_list:
|
||||
output_line['stats']['files'] = file_list
|
||||
|
||||
yield output_line if raw else _process(output_line)
|
||||
|
||||
output_line = {}
|
||||
message_lines = []
|
||||
file_list = []
|
||||
output_line = {
|
||||
'commit': line_list[0],
|
||||
'message': line_list[1]
|
||||
}
|
||||
continue
|
||||
|
||||
# all other styles
|
||||
if line.startswith('commit '):
|
||||
if output_line:
|
||||
if message_lines:
|
||||
output_line['message'] = '\n'.join(message_lines)
|
||||
|
||||
if file_list:
|
||||
output_line['stats']['files'] = file_list
|
||||
|
||||
yield output_line if raw else _process(output_line)
|
||||
|
||||
output_line = {}
|
||||
message_lines = []
|
||||
file_list = []
|
||||
output_line['commit'] = line_list[1]
|
||||
continue
|
||||
|
||||
if line.startswith('Merge: '):
|
||||
output_line['merge'] = line_list[1]
|
||||
continue
|
||||
|
||||
if line.startswith('Author: '):
|
||||
values = line_list[1].rsplit(maxsplit=1)
|
||||
output_line['author'] = values[0]
|
||||
output_line['author_email'] = values[1].strip('<').strip('>')
|
||||
continue
|
||||
|
||||
if line.startswith('Date: '):
|
||||
output_line['date'] = line_list[1]
|
||||
continue
|
||||
|
||||
if line.startswith('AuthorDate: '):
|
||||
output_line['date'] = line_list[1]
|
||||
continue
|
||||
|
||||
if line.startswith('CommitDate: '):
|
||||
output_line['commit_by_date'] = line_list[1]
|
||||
continue
|
||||
|
||||
if line.startswith('Commit: '):
|
||||
values = line_list[1].rsplit(maxsplit=1)
|
||||
output_line['commit_by'] = values[0]
|
||||
output_line['commit_by_email'] = values[1].strip('<').strip('>')
|
||||
continue
|
||||
|
||||
if line.startswith(' '):
|
||||
message_lines.append(line.strip())
|
||||
continue
|
||||
|
||||
if line.startswith(' ') and 'changed, ' not in line:
|
||||
# this is a file name
|
||||
file_name = line.split('|')[0].strip()
|
||||
file_list.append(file_name)
|
||||
continue
|
||||
|
||||
if line.startswith(' ') and 'changed, ' in line:
|
||||
# this is the stat summary
|
||||
changes = changes_pattern.match(line)
|
||||
if changes:
|
||||
files = changes['files']
|
||||
insertions = changes['insertions']
|
||||
deletions = changes['deletions']
|
||||
|
||||
output_line['stats'] = {
|
||||
'files_changed': files or '0',
|
||||
'insertions': insertions or '0',
|
||||
'deletions': deletions or '0'
|
||||
}
|
||||
continue
|
||||
|
||||
raise ParseError('Not git_log_s data')
|
||||
|
||||
except Exception as e:
|
||||
yield raise_or_yield(ignore_exceptions, e, line)
|
||||
|
||||
try:
|
||||
if output_line:
|
||||
if message_lines:
|
||||
output_line['message'] = '\n'.join(message_lines)
|
||||
|
||||
if file_list:
|
||||
output_line['stats']['files'] = file_list
|
||||
|
||||
yield output_line if raw else _process(output_line)
|
||||
|
||||
except Exception as e:
|
||||
yield raise_or_yield(ignore_exceptions, e, line)
|
@ -1,7 +1,7 @@
|
||||
"""jc - JSON Convert `iostat` command output streaming parser
|
||||
|
||||
> This streaming parser outputs JSON Lines (cli) or returns a Generator
|
||||
iterator of Dictionaries (module)
|
||||
> This streaming parser outputs JSON Lines (cli) or returns an Iterable of
|
||||
Dictionaries (module)
|
||||
|
||||
Note: `iostat` version 11 and higher include a JSON output option
|
||||
|
||||
@ -163,7 +163,7 @@ def _create_obj_list(section_list, section_name):
|
||||
@add_jc_meta
|
||||
def parse(data, raw=False, quiet=False, ignore_exceptions=False):
|
||||
"""
|
||||
Main text parsing generator function. Returns an iterator object.
|
||||
Main text parsing generator function. Returns an iterable object.
|
||||
|
||||
Parameters:
|
||||
|
||||
@ -174,13 +174,9 @@ def parse(data, raw=False, quiet=False, ignore_exceptions=False):
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
ignore_exceptions: (boolean) ignore parsing exceptions if True
|
||||
|
||||
Yields:
|
||||
|
||||
Dictionary. Raw or processed structured data.
|
||||
|
||||
Returns:
|
||||
|
||||
Iterator object (generator)
|
||||
Iterable of Dictionaries
|
||||
"""
|
||||
jc.utils.compatibility(__name__, info.compatible, quiet)
|
||||
streaming_input_type_check(data)
|
||||
|
@ -1,7 +1,7 @@
|
||||
"""jc - JSON Convert `ls` and `vdir` command output streaming parser
|
||||
|
||||
> This streaming parser outputs JSON Lines (cli) or returns a Generator
|
||||
iterator of Dictionaries (module)
|
||||
> This streaming parser outputs JSON Lines (cli) or returns an Iterable of
|
||||
Dictionaries (module)
|
||||
|
||||
Requires the `-l` option to be used on `ls`. If there are newline characters
|
||||
in the filename, then make sure to use the `-b` option on `ls`.
|
||||
@ -118,7 +118,7 @@ def _process(proc_data):
|
||||
@add_jc_meta
|
||||
def parse(data, raw=False, quiet=False, ignore_exceptions=False):
|
||||
"""
|
||||
Main text parsing generator function. Returns an iterator object.
|
||||
Main text parsing generator function. Returns an iterable object.
|
||||
|
||||
Parameters:
|
||||
|
||||
@ -129,13 +129,9 @@ def parse(data, raw=False, quiet=False, ignore_exceptions=False):
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
ignore_exceptions: (boolean) ignore parsing exceptions if True
|
||||
|
||||
Yields:
|
||||
|
||||
Dictionary. Raw or processed structured data.
|
||||
|
||||
Returns:
|
||||
|
||||
Iterator object (generator)
|
||||
Iterable of Dictionaries
|
||||
"""
|
||||
jc.utils.compatibility(__name__, info.compatible, quiet)
|
||||
streaming_input_type_check(data)
|
||||
|
@ -1,7 +1,7 @@
|
||||
"""jc - JSON Convert `mpstat` command output streaming parser
|
||||
|
||||
> This streaming parser outputs JSON Lines (cli) or returns a Generator
|
||||
iterator of Dictionaries (module)
|
||||
> This streaming parser outputs JSON Lines (cli) or returns an Iterable of
|
||||
Dictionaries (module)
|
||||
|
||||
Note: Latest versions of `mpstat` support JSON output (v11.5.1+)
|
||||
|
||||
@ -90,7 +90,7 @@ Examples:
|
||||
{"cpu":"all","intr_s":"37.61","type":"interrupts","time":"03:15:06 PM"}
|
||||
...
|
||||
"""
|
||||
from typing import Dict, Iterable, Generator, Union
|
||||
from typing import Dict, Iterable, Union
|
||||
import jc.utils
|
||||
from jc.parsers.universal import simple_table_parse
|
||||
from jc.streaming import (
|
||||
@ -145,9 +145,9 @@ def parse(
|
||||
raw: bool = False,
|
||||
quiet: bool = False,
|
||||
ignore_exceptions: bool = False
|
||||
) -> Union[Generator[Dict, None, None], tuple]:
|
||||
) -> Union[Iterable[Dict], tuple]:
|
||||
"""
|
||||
Main text parsing generator function. Returns an iterator object.
|
||||
Main text parsing generator function. Returns an iterable object.
|
||||
|
||||
Parameters:
|
||||
|
||||
@ -158,13 +158,9 @@ def parse(
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
ignore_exceptions: (boolean) ignore parsing exceptions if True
|
||||
|
||||
Yields:
|
||||
|
||||
Dictionary. Raw or processed structured data.
|
||||
|
||||
Returns:
|
||||
|
||||
Iterator object (generator)
|
||||
Iterable of Dictionaries
|
||||
"""
|
||||
jc.utils.compatibility(__name__, info.compatible, quiet)
|
||||
streaming_input_type_check(data)
|
||||
|
@ -1,7 +1,7 @@
|
||||
"""jc - JSON Convert `pidstat` command output streaming parser
|
||||
|
||||
> This streaming parser outputs JSON Lines (cli) or returns a Generator
|
||||
iterator of Dictionaries (module)
|
||||
> This streaming parser outputs JSON Lines (cli) or returns an Iterable of
|
||||
Dictionaries (module)
|
||||
|
||||
Must use the `-h` option in `pidstat`. All other `pidstat` options are
|
||||
supported in combination with `-h`.
|
||||
@ -72,7 +72,7 @@ Examples:
|
||||
{"time":"1646859134","uid":"0","pid":"9","percent_usr":"0.00","perc...}
|
||||
...
|
||||
"""
|
||||
from typing import Dict, Iterable, Generator, Union
|
||||
from typing import Dict, Iterable, Union
|
||||
import jc.utils
|
||||
from jc.streaming import (
|
||||
add_jc_meta, streaming_input_type_check, streaming_line_input_type_check, raise_or_yield
|
||||
@ -126,9 +126,9 @@ def parse(
|
||||
raw: bool = False,
|
||||
quiet: bool = False,
|
||||
ignore_exceptions: bool = False
|
||||
) -> Union[Generator[Dict, None, None], tuple]:
|
||||
) -> Union[Iterable[Dict], tuple]:
|
||||
"""
|
||||
Main text parsing generator function. Returns an iterator object.
|
||||
Main text parsing generator function. Returns an iterable object.
|
||||
|
||||
Parameters:
|
||||
|
||||
@ -139,13 +139,9 @@ def parse(
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
ignore_exceptions: (boolean) ignore parsing exceptions if True
|
||||
|
||||
Yields:
|
||||
|
||||
Dictionary. Raw or processed structured data.
|
||||
|
||||
Returns:
|
||||
|
||||
Iterator object (generator)
|
||||
Iterable of Dictionaries
|
||||
"""
|
||||
jc.utils.compatibility(__name__, info.compatible, quiet)
|
||||
streaming_input_type_check(data)
|
||||
|
@ -1,7 +1,7 @@
|
||||
"""jc - JSON Convert `ping` command output streaming parser
|
||||
|
||||
> This streaming parser outputs JSON Lines (cli) or returns a Generator
|
||||
iterator of Dictionaries (module)
|
||||
> This streaming parser outputs JSON Lines (cli) or returns an Iterable of
|
||||
Dictionaries (module)
|
||||
|
||||
Supports `ping` and `ping6` output.
|
||||
|
||||
@ -465,7 +465,7 @@ def _linux_parse(line, s):
|
||||
@add_jc_meta
|
||||
def parse(data, raw=False, quiet=False, ignore_exceptions=False):
|
||||
"""
|
||||
Main text parsing generator function. Returns an iterator object.
|
||||
Main text parsing generator function. Returns an iterable object.
|
||||
|
||||
Parameters:
|
||||
|
||||
@ -476,13 +476,9 @@ def parse(data, raw=False, quiet=False, ignore_exceptions=False):
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
ignore_exceptions: (boolean) ignore parsing exceptions if True
|
||||
|
||||
Yields:
|
||||
|
||||
Dictionary. Raw or processed structured data.
|
||||
|
||||
Returns:
|
||||
|
||||
Iterator object (generator)
|
||||
Iterable of Dictionaries
|
||||
"""
|
||||
jc.utils.compatibility(__name__, info.compatible, quiet)
|
||||
streaming_input_type_check(data)
|
||||
|
@ -1,7 +1,7 @@
|
||||
"""jc - JSON Convert `rsync` command output streaming parser
|
||||
|
||||
> This streaming parser outputs JSON Lines (cli) or returns a Generator
|
||||
iterator of Dictionaries (module)
|
||||
> This streaming parser outputs JSON Lines (cli) or returns an Iterable of
|
||||
Dictionaries (module)
|
||||
|
||||
Supports the `-i` or `--itemize-changes` options with all levels of
|
||||
verbosity. This parser will process the STDOUT output or a log file
|
||||
@ -80,7 +80,7 @@ Examples:
|
||||
...
|
||||
"""
|
||||
import re
|
||||
from typing import Dict, Iterable, Generator, Union
|
||||
from typing import Dict, Iterable, Union
|
||||
import jc.utils
|
||||
from jc.streaming import (
|
||||
add_jc_meta, streaming_input_type_check, streaming_line_input_type_check, raise_or_yield
|
||||
@ -139,9 +139,9 @@ def parse(
|
||||
raw: bool = False,
|
||||
quiet: bool = False,
|
||||
ignore_exceptions: bool = False
|
||||
) -> Union[Generator[Dict, None, None], tuple]:
|
||||
) -> Union[Iterable[Dict], tuple]:
|
||||
"""
|
||||
Main text parsing generator function. Returns an iterator object.
|
||||
Main text parsing generator function. Returns an iterable object.
|
||||
|
||||
Parameters:
|
||||
|
||||
@ -152,13 +152,9 @@ def parse(
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
ignore_exceptions: (boolean) ignore parsing exceptions if True
|
||||
|
||||
Yields:
|
||||
|
||||
Dictionary. Raw or processed structured data.
|
||||
|
||||
Returns:
|
||||
|
||||
Iterator object (generator)
|
||||
Iterable of Dictionaries
|
||||
"""
|
||||
jc.utils.compatibility(__name__, info.compatible, quiet)
|
||||
streaming_input_type_check(data)
|
||||
|
@ -1,7 +1,7 @@
|
||||
"""jc - JSON Convert `stat` command output streaming parser
|
||||
|
||||
> This streaming parser outputs JSON Lines (cli) or returns a Generator
|
||||
iterator of Dictionaries (module)
|
||||
> This streaming parser outputs JSON Lines (cli) or returns an Iterable of
|
||||
Dictionaries (module)
|
||||
|
||||
The `xxx_epoch` calculated timestamp fields are naive. (i.e. based on the
|
||||
local time of the system the parser is run on).
|
||||
@ -127,7 +127,7 @@ def _process(proc_data):
|
||||
@add_jc_meta
|
||||
def parse(data, raw=False, quiet=False, ignore_exceptions=False):
|
||||
"""
|
||||
Main text parsing generator function. Returns an iterator object.
|
||||
Main text parsing generator function. Returns an iterable object.
|
||||
|
||||
Parameters:
|
||||
|
||||
@ -138,13 +138,9 @@ def parse(data, raw=False, quiet=False, ignore_exceptions=False):
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
ignore_exceptions: (boolean) ignore parsing exceptions if True
|
||||
|
||||
Yields:
|
||||
|
||||
Dictionary. Raw or processed structured data.
|
||||
|
||||
Returns:
|
||||
|
||||
Iterator object (generator)
|
||||
Iterable of Dictionaries
|
||||
"""
|
||||
jc.utils.compatibility(__name__, info.compatible, quiet)
|
||||
streaming_input_type_check(data)
|
||||
|
@ -1,7 +1,7 @@
|
||||
"""jc - JSON Convert `vmstat` command output streaming parser
|
||||
|
||||
> This streaming parser outputs JSON Lines (cli) or returns a Generator
|
||||
iterator of Dictionaries (module)
|
||||
> This streaming parser outputs JSON Lines (cli) or returns an Iterable of
|
||||
Dictionaries (module)
|
||||
|
||||
Options supported: `-a`, `-w`, `-d`, `-t`
|
||||
|
||||
@ -147,7 +147,7 @@ def _process(proc_data):
|
||||
@add_jc_meta
|
||||
def parse(data, raw=False, quiet=False, ignore_exceptions=False):
|
||||
"""
|
||||
Main text parsing generator function. Returns an iterator object.
|
||||
Main text parsing generator function. Returns an iterable object.
|
||||
|
||||
Parameters:
|
||||
|
||||
@ -158,13 +158,9 @@ def parse(data, raw=False, quiet=False, ignore_exceptions=False):
|
||||
quiet: (boolean) suppress warning messages if True
|
||||
ignore_exceptions: (boolean) ignore parsing exceptions if True
|
||||
|
||||
Yields:
|
||||
|
||||
Dictionary. Raw or processed structured data.
|
||||
|
||||
Returns:
|
||||
|
||||
Iterator object (generator)
|
||||
Iterable of Dictionaries
|
||||
"""
|
||||
jc.utils.compatibility(__name__, info.compatible, quiet)
|
||||
streaming_input_type_check(data)
|
||||
|
40
man/jc.1
40
man/jc.1
@ -1,15 +1,15 @@
|
||||
.TH jc 1 2022-04-27 1.18.8 "JSON Convert"
|
||||
.TH jc 1 2022-05-13 1.19.0 "JSON Convert"
|
||||
.SH NAME
|
||||
jc \- JSONifies the output of many CLI tools and file-types
|
||||
\fBjc\fP \- JSON Convert JSONifies the output of many CLI tools and file-types
|
||||
.SH SYNOPSIS
|
||||
COMMAND | jc PARSER [OPTIONS]
|
||||
|
||||
or "Magic" syntax:
|
||||
|
||||
jc [OPTIONS] COMMAND
|
||||
\fBjc\fP [OPTIONS] COMMAND
|
||||
|
||||
.SH DESCRIPTION
|
||||
jc JSONifies the output of many CLI tools and file-types for easier parsing in scripts. jc accepts piped input from \fBSTDIN\fP and outputs a JSON representation of the previous command's output to \fBSTDOUT\fP. Alternatively, the "Magic" syntax can be used by prepending jc to the command to be converted. Options can be passed to jc immediately before the command is given. (Note: "Magic" syntax does not support shell builtins or command aliases)
|
||||
\fBjc\fP JSONifies the output of many CLI tools and file-types for easier parsing in scripts. \fBjc\fP accepts piped input from \fBSTDIN\fP and outputs a JSON representation of the previous command's output to \fBSTDOUT\fP. Alternatively, the "Magic" syntax can be used by prepending \fBjc\fP to the command to be converted. Options can be passed to \fBjc\fP immediately before the command is given. (Note: "Magic" syntax does not support shell builtins or command aliases)
|
||||
|
||||
.SH OPTIONS
|
||||
.B
|
||||
@ -52,6 +52,11 @@ multi-line ASCII and Unicode table parser
|
||||
\fB--blkid\fP
|
||||
`blkid` command parser
|
||||
|
||||
.TP
|
||||
.B
|
||||
\fB--chage\fP
|
||||
`chage --list` command parser
|
||||
|
||||
.TP
|
||||
.B
|
||||
\fB--cksum\fP
|
||||
@ -142,6 +147,11 @@ CSV file streaming parser
|
||||
\fB--git-log\fP
|
||||
`git log` command parser
|
||||
|
||||
.TP
|
||||
.B
|
||||
\fB--git-log-s\fP
|
||||
`git log` command streaming parser
|
||||
|
||||
.TP
|
||||
.B
|
||||
\fB--group\fP
|
||||
@ -517,7 +527,7 @@ Options:
|
||||
.TP
|
||||
.B
|
||||
\fB-a\fP
|
||||
about jc (JSON output)
|
||||
about \fBjc\fP (JSON output)
|
||||
.TP
|
||||
.B
|
||||
\fB-C\fP
|
||||
@ -556,7 +566,7 @@ unbuffer output (useful for slow streaming data with streaming parsers)
|
||||
version information
|
||||
|
||||
.SH EXIT CODES
|
||||
Any fatal errors within jc will generate an exit code of \fB100\fP, otherwise the exit code will be \fB0\fP. When using the "Magic" syntax (e.g. \fBjc ifconfig eth0\fP), jc will store the exit code of the program being parsed and add it to the jc exit code. This way it is easier to determine if an error was from the parsed program or jc.
|
||||
Any fatal errors within \fBjc\fP will generate an exit code of \fB100\fP, otherwise the exit code will be \fB0\fP. When using the "Magic" syntax (e.g. \fBjc ifconfig eth0\fP), \fBjc\fP will store the exit code of the program being parsed and add it to the \fBjc\fP exit code. This way it is easier to determine if an error was from the parsed program or \fBjc\fP.
|
||||
|
||||
Consider the following examples using \fBifconfig\fP:
|
||||
|
||||
@ -592,10 +602,10 @@ JC_COLORS=default,default,default,default
|
||||
|
||||
\fBDisable Color Output\fP
|
||||
|
||||
You can set the \fBNO_COLOR\fB environment variable to any value to disable color output in \fBjc\fP. Note that using the \fB-C\fP option to force color output will override both the \fBNO_COLOR\fP environment variable and the \fB-m\fP option.
|
||||
You can set the \fBNO_COLOR\fP environment variable to any value to disable color output in \fBjc\fP. Note that using the \fB-C\fP option to force color output will override both the \fBNO_COLOR\fP environment variable and the \fB-m\fP option.
|
||||
|
||||
.SH STREAMING PARSERS
|
||||
Most parsers load all of the data from \fBSTDIN\fP, parse it, then output the entire JSON document serially. There are some streaming parsers (e.g. \fBls-s\fP and \fBping-s\fP) that immediately start processing and outputing the data line-by-line as JSON Lines (aka NDJSON) while it is being received from \fBSTDIN\fP. This can significantly reduce the amount of memory required to parse large amounts of command output (e.g. \fBls -lR /\fP) and can sometimes process the data more quickly. Streaming parsers have slightly different behavior than standard parsers as outlined below.
|
||||
Most parsers load all of the data from \fBSTDIN\fP, parse it, then output the entire JSON document serially. There are some streaming parsers (e.g. \fBls-s\fP, \fBping-s\fP, etc.) that immediately start processing and outputing the data line-by-line as JSON Lines (aka NDJSON) while it is being received from \fBSTDIN\fP. This can significantly reduce the amount of memory required to parse large amounts of command output (e.g. \fBls -lR /\fP) and can sometimes process the data more quickly. Streaming parsers have slightly different behavior than standard parsers as outlined below.
|
||||
|
||||
.RS
|
||||
Note: Streaming parsers cannot be used with the "magic" syntax
|
||||
@ -667,14 +677,16 @@ Custom local parser plugins may be placed in a \fBjc/jcparsers\fP folder in your
|
||||
.fi
|
||||
.RE
|
||||
|
||||
Local parser plugins are standard python module files. Use the \fBjc/parsers/foo.py\fP parser as a template and simply place a \fB.py\fP file in the \fBjcparsers\fP subfolder.
|
||||
Local parser plugins are standard python module files. Use the \fBjc/parsers/foo.py\fP or \fBjc/parsers/foo_s.py\fP (streaming) parser as a template and simply place a \fB.py\fP file in the \fBjcparsers\fP subfolder.
|
||||
|
||||
Local plugin filenames must be valid python module names, therefore must consist entirely of alphanumerics and start with a letter. Local plugins may override default plugins.
|
||||
Local plugin filenames must be valid python module names and therefore must start with a letter and consist entirely of alphanumerics and underscores. Local plugins may override default parsers.
|
||||
|
||||
Note: The application data directory follows the XDG Base Directory Specification
|
||||
|
||||
.SH CAVEATS
|
||||
\fBLocale:\fP For best results set the \fBLANG\fP locale environment variable to \fBC\fP or \fBen_US.UTF-8\fP. For example, either by setting directly on the command-line:
|
||||
\fBLocale\fP
|
||||
|
||||
For best results set the \fBLANG\fP locale environment variable to \fBC\fP or \fBen_US.UTF-8\fP. For example, either by setting directly on the command-line:
|
||||
|
||||
.RS
|
||||
$ LANG=C date | jc \fB--date\fP
|
||||
@ -686,9 +698,11 @@ or by exporting to the environment before running commands:
|
||||
$ export LANG=C
|
||||
.RE
|
||||
|
||||
On some older systems UTF-8 output will be downgraded to ASCII with `\\u` escape sequences if the \fBC\fP locale does not support UTF-8 encoding.
|
||||
On some older systems UTF-8 output will be downgraded to ASCII with \fB\\u\fP escape sequences if the \fBC\fP locale does not support UTF-8 encoding.
|
||||
|
||||
\fBTimezones:\fP Some parsers have calculated epoch timestamp fields added to the output. Unless a timestamp field name has a \fB_utc\fP suffix it is considered naive. (i.e. based on the local timezone of the system the \fBjc\fP parser was run on).
|
||||
\fBTimezones\fP
|
||||
|
||||
Some parsers have calculated epoch timestamp fields added to the output. Unless a timestamp field name has a \fB_utc\fP suffix it is considered naive. (i.e. based on the local timezone of the system the \fBjc\fP parser was run on).
|
||||
|
||||
If a UTC timezone can be detected in the text of the command output, the timestamp will be timezone aware and have a \fB_utc\fP suffix on the key name. (e.g. \fBepoch_utc\fP) No other timezones are supported for aware timestamps.
|
||||
|
||||
|
4
setup.py
4
setup.py
@ -5,7 +5,7 @@ with open('README.md', 'r') as f:
|
||||
|
||||
setuptools.setup(
|
||||
name='jc',
|
||||
version='1.18.8',
|
||||
version='1.19.0',
|
||||
author='Kelly Brazil',
|
||||
author_email='kellyjonbrazil@gmail.com',
|
||||
description='Converts the output of popular command-line tools and file-types to JSON.',
|
||||
@ -17,7 +17,7 @@ setuptools.setup(
|
||||
license='MIT',
|
||||
long_description=long_description,
|
||||
long_description_content_type='text/markdown',
|
||||
python_requires='>=3.7',
|
||||
python_requires='>=3.6',
|
||||
url='https://github.com/kellyjonbrazil/jc',
|
||||
packages=setuptools.find_packages(exclude=['*.tests', '*.tests.*', 'tests.*', 'tests']),
|
||||
entry_points={
|
||||
|
@ -1,15 +1,15 @@
|
||||
.TH jc 1 {{ today }} {{ jc.version}} "JSON Convert"
|
||||
.SH NAME
|
||||
jc \- JSONifies the output of many CLI tools and file-types
|
||||
\fBjc\fP \- JSON Convert JSONifies the output of many CLI tools and file-types
|
||||
.SH SYNOPSIS
|
||||
COMMAND | jc PARSER [OPTIONS]
|
||||
|
||||
or "Magic" syntax:
|
||||
|
||||
jc [OPTIONS] COMMAND
|
||||
\fBjc\fP [OPTIONS] COMMAND
|
||||
|
||||
.SH DESCRIPTION
|
||||
jc JSONifies the output of many CLI tools and file-types for easier parsing in scripts. jc accepts piped input from \fBSTDIN\fP and outputs a JSON representation of the previous command's output to \fBSTDOUT\fP. Alternatively, the "Magic" syntax can be used by prepending jc to the command to be converted. Options can be passed to jc immediately before the command is given. (Note: "Magic" syntax does not support shell builtins or command aliases)
|
||||
\fBjc\fP JSONifies the output of many CLI tools and file-types for easier parsing in scripts. \fBjc\fP accepts piped input from \fBSTDIN\fP and outputs a JSON representation of the previous command's output to \fBSTDOUT\fP. Alternatively, the "Magic" syntax can be used by prepending \fBjc\fP to the command to be converted. Options can be passed to \fBjc\fP immediately before the command is given. (Note: "Magic" syntax does not support shell builtins or command aliases)
|
||||
|
||||
.SH OPTIONS
|
||||
.B
|
||||
@ -32,7 +32,7 @@ Options:
|
||||
.TP
|
||||
.B
|
||||
\fB-a\fP
|
||||
about jc (JSON output)
|
||||
about \fBjc\fP (JSON output)
|
||||
.TP
|
||||
.B
|
||||
\fB-C\fP
|
||||
@ -71,7 +71,7 @@ unbuffer output (useful for slow streaming data with streaming parsers)
|
||||
version information
|
||||
|
||||
.SH EXIT CODES
|
||||
Any fatal errors within jc will generate an exit code of \fB100\fP, otherwise the exit code will be \fB0\fP. When using the "Magic" syntax (e.g. \fBjc ifconfig eth0\fP), jc will store the exit code of the program being parsed and add it to the jc exit code. This way it is easier to determine if an error was from the parsed program or jc.
|
||||
Any fatal errors within \fBjc\fP will generate an exit code of \fB100\fP, otherwise the exit code will be \fB0\fP. When using the "Magic" syntax (e.g. \fBjc ifconfig eth0\fP), \fBjc\fP will store the exit code of the program being parsed and add it to the \fBjc\fP exit code. This way it is easier to determine if an error was from the parsed program or \fBjc\fP.
|
||||
|
||||
Consider the following examples using \fBifconfig\fP:
|
||||
|
||||
@ -107,10 +107,10 @@ JC_COLORS=default,default,default,default
|
||||
|
||||
\fBDisable Color Output\fP
|
||||
|
||||
You can set the \fBNO_COLOR\fB environment variable to any value to disable color output in \fBjc\fP. Note that using the \fB-C\fP option to force color output will override both the \fBNO_COLOR\fP environment variable and the \fB-m\fP option.
|
||||
You can set the \fBNO_COLOR\fP environment variable to any value to disable color output in \fBjc\fP. Note that using the \fB-C\fP option to force color output will override both the \fBNO_COLOR\fP environment variable and the \fB-m\fP option.
|
||||
|
||||
.SH STREAMING PARSERS
|
||||
Most parsers load all of the data from \fBSTDIN\fP, parse it, then output the entire JSON document serially. There are some streaming parsers (e.g. \fBls-s\fP and \fBping-s\fP) that immediately start processing and outputing the data line-by-line as JSON Lines (aka NDJSON) while it is being received from \fBSTDIN\fP. This can significantly reduce the amount of memory required to parse large amounts of command output (e.g. \fBls -lR /\fP) and can sometimes process the data more quickly. Streaming parsers have slightly different behavior than standard parsers as outlined below.
|
||||
Most parsers load all of the data from \fBSTDIN\fP, parse it, then output the entire JSON document serially. There are some streaming parsers (e.g. \fBls-s\fP, \fBping-s\fP, etc.) that immediately start processing and outputing the data line-by-line as JSON Lines (aka NDJSON) while it is being received from \fBSTDIN\fP. This can significantly reduce the amount of memory required to parse large amounts of command output (e.g. \fBls -lR /\fP) and can sometimes process the data more quickly. Streaming parsers have slightly different behavior than standard parsers as outlined below.
|
||||
|
||||
.RS
|
||||
Note: Streaming parsers cannot be used with the "magic" syntax
|
||||
@ -182,14 +182,16 @@ Custom local parser plugins may be placed in a \fBjc/jcparsers\fP folder in your
|
||||
.fi
|
||||
.RE
|
||||
|
||||
Local parser plugins are standard python module files. Use the \fBjc/parsers/foo.py\fP parser as a template and simply place a \fB.py\fP file in the \fBjcparsers\fP subfolder.
|
||||
Local parser plugins are standard python module files. Use the \fBjc/parsers/foo.py\fP or \fBjc/parsers/foo_s.py\fP (streaming) parser as a template and simply place a \fB.py\fP file in the \fBjcparsers\fP subfolder.
|
||||
|
||||
Local plugin filenames must be valid python module names, therefore must consist entirely of alphanumerics and start with a letter. Local plugins may override default plugins.
|
||||
Local plugin filenames must be valid python module names and therefore must start with a letter and consist entirely of alphanumerics and underscores. Local plugins may override default parsers.
|
||||
|
||||
Note: The application data directory follows the XDG Base Directory Specification
|
||||
|
||||
.SH CAVEATS
|
||||
\fBLocale:\fP For best results set the \fBLANG\fP locale environment variable to \fBC\fP or \fBen_US.UTF-8\fP. For example, either by setting directly on the command-line:
|
||||
\fBLocale\fP
|
||||
|
||||
For best results set the \fBLANG\fP locale environment variable to \fBC\fP or \fBen_US.UTF-8\fP. For example, either by setting directly on the command-line:
|
||||
|
||||
.RS
|
||||
$ LANG=C date | jc \fB--date\fP
|
||||
@ -201,9 +203,11 @@ or by exporting to the environment before running commands:
|
||||
$ export LANG=C
|
||||
.RE
|
||||
|
||||
On some older systems UTF-8 output will be downgraded to ASCII with `\\u` escape sequences if the \fBC\fP locale does not support UTF-8 encoding.
|
||||
On some older systems UTF-8 output will be downgraded to ASCII with \fB\\u\fP escape sequences if the \fBC\fP locale does not support UTF-8 encoding.
|
||||
|
||||
\fBTimezones:\fP Some parsers have calculated epoch timestamp fields added to the output. Unless a timestamp field name has a \fB_utc\fP suffix it is considered naive. (i.e. based on the local timezone of the system the \fBjc\fP parser was run on).
|
||||
\fBTimezones\fP
|
||||
|
||||
Some parsers have calculated epoch timestamp fields added to the output. Unless a timestamp field name has a \fB_utc\fP suffix it is considered naive. (i.e. based on the local timezone of the system the \fBjc\fP parser was run on).
|
||||
|
||||
If a UTC timezone can be detected in the text of the command output, the timestamp will be timezone aware and have a \fB_utc\fP suffix on the key name. (e.g. \fBepoch_utc\fP) No other timezones are supported for aware timestamps.
|
||||
|
||||
|
@ -111,13 +111,13 @@ pip3 install jc
|
||||
| Debian/Ubuntu linux | `apt-get install jc` |
|
||||
| Fedora linux | `dnf install jc` |
|
||||
| openSUSE linux | `zypper install jc` |
|
||||
| Archlinux User Repositories (AUR) | `paru -S jc` or `aura -A jc` or `yay -S jc` |
|
||||
| Archlinux Community Repository | `paru -S jc` or `aura -S jc` or `yay -S jc` |
|
||||
| NixOS linux | `nix-env -iA nixpkgs.jc` or `nix-env -iA nixos.jc` |
|
||||
| Guix System linux | `guix install jc` |
|
||||
| Gentoo Linux | `emerge dev-python/jc` |
|
||||
| macOS | `brew install jc` |
|
||||
| FreeBSD | `portsnap fetch update && cd /usr/ports/textproc/py-jc && make install clean` |
|
||||
| Ansible filter plugin | `ansible-galaxy collection install community.general` |
|
||||
| Gentoo Linux | `emerge dev-python/jc` |
|
||||
|
||||
> For more OS Packages, see https://repology.org/project/jc/versions.
|
||||
|
||||
@ -143,8 +143,10 @@ The JSON output can be compact (default) or pretty formatted with the `-p`
|
||||
option.
|
||||
|
||||
### Parsers
|
||||
{% for parser in jc.parsers %}
|
||||
- `{{ parser.argument }}` enables the {{ parser.description }} ([documentation](https://kellyjonbrazil.github.io/jc/docs/parsers/{{ parser.name }})){% endfor %}
|
||||
|
||||
| Argument | Command or Filetype | Documentation |
|
||||
|--------------|-------------------------|-------------------|{% for parser in jc.parsers %}
|
||||
| `{{ parser.argument }}` | {{ parser.description }} | [📃](https://kellyjonbrazil.github.io/jc/docs/parsers/{{ parser.name }}) |{% endfor %}
|
||||
|
||||
### Options
|
||||
- `-a` about `jc`. Prints information about `jc` and the parsers (in JSON, of
|
||||
@ -277,14 +279,14 @@ $ ping 1.1.1.1 | jc --ping-s -u | jq
|
||||
|
||||
#### Using Streaming Parsers as Python Modules
|
||||
|
||||
Streaming parsers accept any iterable object and return an iterator object
|
||||
(generator) allowing lazy processing of the data. The input data should
|
||||
iterate on lines of string data. Examples of good input data are `sys.stdin` or
|
||||
Streaming parsers accept any iterable object and return an iterable object
|
||||
allowing lazy processing of the data. The input data should iterate on lines
|
||||
of string data. Examples of good input data are `sys.stdin` or
|
||||
`str.splitlines()`.
|
||||
|
||||
To use the generator object in your code, simply loop through it or use the
|
||||
[next()](https://docs.python.org/3/library/functions.html#next) builtin
|
||||
function:
|
||||
To use the returned iterable object in your code, simply loop through it or
|
||||
use the [next()](https://docs.python.org/3/library/functions.html#next)
|
||||
builtin function:
|
||||
```python
|
||||
import jc
|
||||
|
||||
@ -307,8 +309,8 @@ or [`jc/parsers/foo_s.py (streaming)`](https://github.com/kellyjonbrazil/jc/blob
|
||||
parser as a template and simply place a `.py` file in the `jcparsers` subfolder.
|
||||
|
||||
Local plugin filenames must be valid python module names and therefore must
|
||||
start with a letter and consist entirely of alphanumerics. Local plugins
|
||||
may override default parsers.
|
||||
start with a letter and consist entirely of alphanumerics and underscores.
|
||||
Local plugins may override default parsers.
|
||||
|
||||
> Note: The application data directory follows the
|
||||
[XDG Base Directory Specification](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html)
|
||||
|
1
tests/fixtures/centos-7.7/chage.json
vendored
Normal file
1
tests/fixtures/centos-7.7/chage.json
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"password_last_changed":"never","password_expires":"never","password_inactive":"never","account_expires":"never","min_days_between_password_change":0,"max_days_between_password_change":99999,"warning_days_before_password_expires":7}
|
7
tests/fixtures/centos-7.7/chage.out
vendored
Normal file
7
tests/fixtures/centos-7.7/chage.out
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
Last password change : never
|
||||
Password expires : never
|
||||
Password inactive : never
|
||||
Account expires : never
|
||||
Minimum number of days between password change : 0
|
||||
Maximum number of days between password change : 99999
|
||||
Number of days of warning before password expires : 7
|
359
tests/fixtures/centos-7.7/top-b-n3.out
vendored
Normal file
359
tests/fixtures/centos-7.7/top-b-n3.out
vendored
Normal file
@ -0,0 +1,359 @@
|
||||
top - 11:24:50 up 2 min, 2 users, load average: 0.23, 0.22, 0.09
|
||||
Tasks: 112 total, 1 running, 111 sleeping, 0 stopped, 0 zombie
|
||||
%Cpu(s): 5.9 us, 5.9 sy, 0.0 ni, 88.2 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
|
||||
KiB Mem : 3861332 total, 3446476 free, 216940 used, 197916 buff/cache
|
||||
KiB Swap: 2097148 total, 2097148 free, 0 used. 3419356 avail Mem
|
||||
|
||||
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
|
||||
1935 kbrazil 20 0 161888 2108 1520 R 6.2 0.1 0:00.01 top
|
||||
1 root 20 0 128084 6684 4204 S 0.0 0.2 0:01.22 systemd
|
||||
2 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kthreadd
|
||||
3 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kworker/0:0
|
||||
4 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/0:0H
|
||||
5 root 20 0 0 0 0 S 0.0 0.0 0:00.01 kworker/u256:0
|
||||
6 root 20 0 0 0 0 S 0.0 0.0 0:00.06 ksoftirqd/0
|
||||
7 root rt 0 0 0 0 S 0.0 0.0 0:00.00 migration/0
|
||||
8 root 20 0 0 0 0 S 0.0 0.0 0:00.00 rcu_bh
|
||||
9 root 20 0 0 0 0 S 0.0 0.0 0:00.41 rcu_sched
|
||||
10 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 lru-add-drain
|
||||
11 root rt 0 0 0 0 S 0.0 0.0 0:00.00 watchdog/0
|
||||
13 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kdevtmpfs
|
||||
14 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 netns
|
||||
15 root 20 0 0 0 0 S 0.0 0.0 0:00.00 khungtaskd
|
||||
16 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 writeback
|
||||
17 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kintegrityd
|
||||
18 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 bioset
|
||||
19 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 bioset
|
||||
20 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 bioset
|
||||
21 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kblockd
|
||||
22 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 md
|
||||
23 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 edac-poller
|
||||
24 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 watchdogd
|
||||
25 root 20 0 0 0 0 S 0.0 0.0 0:00.52 kworker/0:1
|
||||
30 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kswapd0
|
||||
31 root 25 5 0 0 0 S 0.0 0.0 0:00.00 ksmd
|
||||
32 root 39 19 0 0 0 S 0.0 0.0 0:00.00 khugepaged
|
||||
33 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 crypto
|
||||
41 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kthrotld
|
||||
42 root 20 0 0 0 0 S 0.0 0.0 0:00.01 kworker/u256:1
|
||||
43 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kmpath_rdacd
|
||||
44 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kaluad
|
||||
45 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kpsmoused
|
||||
46 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kworker/0:2
|
||||
47 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 ipv6_addrconf
|
||||
60 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 deferwq
|
||||
95 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kauditd
|
||||
261 root 20 0 0 0 0 S 0.0 0.0 0:00.01 kworker/0:3
|
||||
272 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 nfit
|
||||
273 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 mpt_poll_0
|
||||
274 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 mpt/0
|
||||
275 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 ata_sff
|
||||
318 root 20 0 0 0 0 S 0.0 0.0 0:00.00 scsi_eh_0
|
||||
325 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 scsi_tmf_0
|
||||
344 root 20 0 0 0 0 S 0.0 0.0 0:00.01 scsi_eh_1
|
||||
345 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 scsi_tmf_1
|
||||
346 root 20 0 0 0 0 S 0.0 0.0 0:00.00 scsi_eh_2
|
||||
347 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 scsi_tmf_2
|
||||
348 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kworker/u256:2
|
||||
350 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kworker/u256:3
|
||||
356 root 20 0 0 0 0 S 0.0 0.0 0:00.01 kworker/u256:4
|
||||
359 root -51 0 0 0 0 S 0.0 0.0 0:00.01 irq/16-vmwgfx
|
||||
360 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 ttm_swap
|
||||
431 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kdmflush
|
||||
432 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 bioset
|
||||
442 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kdmflush
|
||||
443 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 bioset
|
||||
455 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 bioset
|
||||
456 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 xfsalloc
|
||||
457 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 xfs_mru_cache
|
||||
458 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 xfs-buf/dm-0
|
||||
459 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 xfs-data/dm-0
|
||||
460 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 xfs-conv/dm-0
|
||||
461 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 xfs-cil/dm-0
|
||||
462 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 xfs-reclaim/dm-
|
||||
463 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 xfs-log/dm-0
|
||||
464 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 xfs-eofblocks/d
|
||||
465 root 20 0 0 0 0 S 0.0 0.0 0:00.12 xfsaild/dm-0
|
||||
466 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/0:1H
|
||||
543 root 20 0 39080 3068 2740 S 0.0 0.1 0:00.15 systemd-journal
|
||||
559 root 20 0 127392 4136 2608 S 0.0 0.1 0:00.01 lvmetad
|
||||
573 root 20 0 48124 5288 2876 S 0.0 0.1 0:00.20 systemd-udevd
|
||||
608 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 xfs-buf/sda1
|
||||
610 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 xfs-data/sda1
|
||||
611 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 xfs-conv/sda1
|
||||
615 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 xfs-cil/sda1
|
||||
617 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 xfs-reclaim/sda
|
||||
622 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 xfs-log/sda1
|
||||
625 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 xfs-eofblocks/s
|
||||
626 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/u257:0
|
||||
629 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 hci0
|
||||
630 root 20 0 0 0 0 S 0.0 0.0 0:00.00 xfsaild/sda1
|
||||
633 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 hci0
|
||||
634 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/u257:1
|
||||
635 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/u257:2
|
||||
755 root 16 -4 55528 892 484 S 0.0 0.0 0:00.00 auditd
|
||||
778 root 20 0 52808 2744 1984 S 0.0 0.1 0:00.02 smartd
|
||||
779 dbus 20 0 66472 2624 1888 S 0.0 0.1 0:00.13 dbus-daemon
|
||||
781 root 20 0 57524 2568 2128 S 0.0 0.1 0:00.01 bluetoothd
|
||||
784 root 20 0 26420 1800 1480 S 0.0 0.0 0:00.02 systemd-logind
|
||||
789 polkitd 20 0 613016 15044 4904 S 0.0 0.4 0:00.09 polkitd
|
||||
796 chrony 20 0 117804 1720 1292 S 0.0 0.0 0:00.02 chronyd
|
||||
812 root 20 0 126288 1692 1052 S 0.0 0.0 0:00.47 crond
|
||||
831 root 20 0 110108 864 736 S 0.0 0.0 0:00.00 agetty
|
||||
833 root 20 0 96572 2532 1872 S 0.0 0.1 0:00.14 login
|
||||
852 root 20 0 358752 29532 7048 S 0.0 0.8 0:00.62 firewalld
|
||||
882 root 20 0 701724 9020 6872 S 0.0 0.2 0:00.10 NetworkManager
|
||||
1031 root 20 0 102896 5476 3412 S 0.0 0.1 0:00.01 dhclient
|
||||
1221 root 20 0 574204 17428 6128 S 0.0 0.5 0:00.18 tuned
|
||||
1223 root 20 0 112920 4316 3288 S 0.0 0.1 0:00.01 sshd
|
||||
1224 root 20 0 575596 26216 12956 S 0.0 0.7 0:00.41 dockerd-current
|
||||
1225 root 20 0 218548 4248 3300 S 0.0 0.1 0:00.11 rsyslogd
|
||||
1271 root 20 0 284640 12864 5188 S 0.0 0.3 0:00.15 docker-containe
|
||||
1496 root 20 0 89700 2072 1064 S 0.0 0.1 0:00.01 master
|
||||
1508 postfix 20 0 89872 4076 3076 S 0.0 0.1 0:00.00 qmgr
|
||||
1810 root 20 0 123264 732 504 S 0.0 0.0 0:00.00 anacron
|
||||
1867 kbrazil 20 0 115708 2312 1580 S 0.0 0.1 0:00.01 bash
|
||||
1887 root 20 0 158924 5696 4356 S 0.0 0.1 0:00.15 sshd
|
||||
1895 kbrazil 20 0 158924 2452 1088 S 0.0 0.1 0:00.04 sshd
|
||||
1896 kbrazil 20 0 115580 2128 1636 S 0.0 0.1 0:00.02 bash
|
||||
1933 postfix 20 0 89804 4060 3060 S 0.0 0.1 0:00.00 pickup
|
||||
|
||||
top - 11:24:53 up 2 min, 2 users, load average: 0.23, 0.22, 0.09
|
||||
Tasks: 112 total, 1 running, 111 sleeping, 0 stopped, 0 zombie
|
||||
%Cpu(s): 0.3 us, 0.3 sy, 0.0 ni, 99.0 id, 0.0 wa, 0.0 hi, 0.3 si, 0.0 st
|
||||
KiB Mem : 3861332 total, 3446460 free, 216944 used, 197928 buff/cache
|
||||
KiB Swap: 2097148 total, 2097148 free, 0 used. 3419340 avail Mem
|
||||
|
||||
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
|
||||
25 root 20 0 0 0 0 S 0.3 0.0 0:00.53 kworker/0:1
|
||||
465 root 20 0 0 0 0 S 0.3 0.0 0:00.13 xfsaild/dm-0
|
||||
1 root 20 0 128084 6684 4204 S 0.0 0.2 0:01.22 systemd
|
||||
2 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kthreadd
|
||||
3 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kworker/0:0
|
||||
4 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/0:0H
|
||||
5 root 20 0 0 0 0 S 0.0 0.0 0:00.01 kworker/u256:0
|
||||
6 root 20 0 0 0 0 S 0.0 0.0 0:00.06 ksoftirqd/0
|
||||
7 root rt 0 0 0 0 S 0.0 0.0 0:00.00 migration/0
|
||||
8 root 20 0 0 0 0 S 0.0 0.0 0:00.00 rcu_bh
|
||||
9 root 20 0 0 0 0 S 0.0 0.0 0:00.41 rcu_sched
|
||||
10 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 lru-add-drain
|
||||
11 root rt 0 0 0 0 S 0.0 0.0 0:00.00 watchdog/0
|
||||
13 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kdevtmpfs
|
||||
14 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 netns
|
||||
15 root 20 0 0 0 0 S 0.0 0.0 0:00.00 khungtaskd
|
||||
16 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 writeback
|
||||
17 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kintegrityd
|
||||
18 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 bioset
|
||||
19 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 bioset
|
||||
20 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 bioset
|
||||
21 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kblockd
|
||||
22 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 md
|
||||
23 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 edac-poller
|
||||
24 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 watchdogd
|
||||
30 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kswapd0
|
||||
31 root 25 5 0 0 0 S 0.0 0.0 0:00.00 ksmd
|
||||
32 root 39 19 0 0 0 S 0.0 0.0 0:00.00 khugepaged
|
||||
33 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 crypto
|
||||
41 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kthrotld
|
||||
42 root 20 0 0 0 0 S 0.0 0.0 0:00.01 kworker/u256:1
|
||||
43 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kmpath_rdacd
|
||||
44 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kaluad
|
||||
45 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kpsmoused
|
||||
46 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kworker/0:2
|
||||
47 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 ipv6_addrconf
|
||||
60 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 deferwq
|
||||
95 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kauditd
|
||||
261 root 20 0 0 0 0 S 0.0 0.0 0:00.01 kworker/0:3
|
||||
272 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 nfit
|
||||
273 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 mpt_poll_0
|
||||
274 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 mpt/0
|
||||
275 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 ata_sff
|
||||
318 root 20 0 0 0 0 S 0.0 0.0 0:00.00 scsi_eh_0
|
||||
325 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 scsi_tmf_0
|
||||
344 root 20 0 0 0 0 S 0.0 0.0 0:00.01 scsi_eh_1
|
||||
345 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 scsi_tmf_1
|
||||
346 root 20 0 0 0 0 S 0.0 0.0 0:00.00 scsi_eh_2
|
||||
347 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 scsi_tmf_2
|
||||
348 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kworker/u256:2
|
||||
350 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kworker/u256:3
|
||||
356 root 20 0 0 0 0 S 0.0 0.0 0:00.01 kworker/u256:4
|
||||
359 root -51 0 0 0 0 S 0.0 0.0 0:00.01 irq/16-vmwgfx
|
||||
360 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 ttm_swap
|
||||
431 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kdmflush
|
||||
432 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 bioset
|
||||
442 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kdmflush
|
||||
443 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 bioset
|
||||
455 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 bioset
|
||||
456 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 xfsalloc
|
||||
457 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 xfs_mru_cache
|
||||
458 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 xfs-buf/dm-0
|
||||
459 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 xfs-data/dm-0
|
||||
460 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 xfs-conv/dm-0
|
||||
461 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 xfs-cil/dm-0
|
||||
462 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 xfs-reclaim/dm-
|
||||
463 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 xfs-log/dm-0
|
||||
464 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 xfs-eofblocks/d
|
||||
466 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/0:1H
|
||||
543 root 20 0 39080 3068 2740 S 0.0 0.1 0:00.15 systemd-journal
|
||||
559 root 20 0 127392 4136 2608 S 0.0 0.1 0:00.01 lvmetad
|
||||
573 root 20 0 48124 5288 2876 S 0.0 0.1 0:00.20 systemd-udevd
|
||||
608 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 xfs-buf/sda1
|
||||
610 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 xfs-data/sda1
|
||||
611 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 xfs-conv/sda1
|
||||
615 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 xfs-cil/sda1
|
||||
617 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 xfs-reclaim/sda
|
||||
622 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 xfs-log/sda1
|
||||
625 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 xfs-eofblocks/s
|
||||
626 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/u257:0
|
||||
629 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 hci0
|
||||
630 root 20 0 0 0 0 S 0.0 0.0 0:00.00 xfsaild/sda1
|
||||
633 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 hci0
|
||||
634 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/u257:1
|
||||
635 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/u257:2
|
||||
755 root 16 -4 55528 892 484 S 0.0 0.0 0:00.00 auditd
|
||||
778 root 20 0 52808 2744 1984 S 0.0 0.1 0:00.02 smartd
|
||||
779 dbus 20 0 66472 2624 1888 S 0.0 0.1 0:00.13 dbus-daemon
|
||||
781 root 20 0 57524 2568 2128 S 0.0 0.1 0:00.01 bluetoothd
|
||||
784 root 20 0 26420 1800 1480 S 0.0 0.0 0:00.02 systemd-logind
|
||||
789 polkitd 20 0 613016 15044 4904 S 0.0 0.4 0:00.09 polkitd
|
||||
796 chrony 20 0 117804 1720 1292 S 0.0 0.0 0:00.02 chronyd
|
||||
812 root 20 0 126288 1692 1052 S 0.0 0.0 0:00.47 crond
|
||||
831 root 20 0 110108 864 736 S 0.0 0.0 0:00.00 agetty
|
||||
833 root 20 0 96572 2532 1872 S 0.0 0.1 0:00.14 login
|
||||
852 root 20 0 358752 29532 7048 S 0.0 0.8 0:00.62 firewalld
|
||||
882 root 20 0 701724 9020 6872 S 0.0 0.2 0:00.10 NetworkManager
|
||||
1031 root 20 0 102896 5476 3412 S 0.0 0.1 0:00.01 dhclient
|
||||
1221 root 20 0 574204 17428 6128 S 0.0 0.5 0:00.18 tuned
|
||||
1223 root 20 0 112920 4316 3288 S 0.0 0.1 0:00.01 sshd
|
||||
1224 root 20 0 575596 26216 12956 S 0.0 0.7 0:00.41 dockerd-current
|
||||
1225 root 20 0 218548 4248 3300 S 0.0 0.1 0:00.11 rsyslogd
|
||||
1271 root 20 0 284640 12864 5188 S 0.0 0.3 0:00.15 docker-containe
|
||||
1496 root 20 0 89700 2072 1064 S 0.0 0.1 0:00.01 master
|
||||
1508 postfix 20 0 89872 4076 3076 S 0.0 0.1 0:00.00 qmgr
|
||||
1810 root 20 0 123264 732 504 S 0.0 0.0 0:00.00 anacron
|
||||
1867 kbrazil 20 0 115708 2312 1580 S 0.0 0.1 0:00.01 bash
|
||||
1887 root 20 0 158924 5696 4356 S 0.0 0.1 0:00.15 sshd
|
||||
1895 kbrazil 20 0 158924 2452 1088 S 0.0 0.1 0:00.04 sshd
|
||||
1896 kbrazil 20 0 115580 2128 1636 S 0.0 0.1 0:00.02 bash
|
||||
1933 postfix 20 0 89804 4060 3060 S 0.0 0.1 0:00.00 pickup
|
||||
1935 kbrazil 20 0 161892 2144 1540 R 0.0 0.1 0:00.01 top
|
||||
|
||||
top - 11:24:56 up 2 min, 2 users, load average: 0.21, 0.21, 0.09
|
||||
Tasks: 112 total, 2 running, 110 sleeping, 0 stopped, 0 zombie
|
||||
%Cpu(s): 0.0 us, 0.7 sy, 0.0 ni, 99.3 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
|
||||
KiB Mem : 3861332 total, 3446336 free, 217060 used, 197936 buff/cache
|
||||
KiB Swap: 2097148 total, 2097148 free, 0 used. 3419228 avail Mem
|
||||
|
||||
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
|
||||
25 root 20 0 0 0 0 S 0.3 0.0 0:00.54 kworker/0:1
|
||||
1224 root 20 0 576652 26216 12956 S 0.3 0.7 0:00.42 dockerd-current
|
||||
1935 kbrazil 20 0 161892 2144 1540 R 0.3 0.1 0:00.02 top
|
||||
1 root 20 0 128084 6684 4204 S 0.0 0.2 0:01.22 systemd
|
||||
2 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kthreadd
|
||||
3 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kworker/0:0
|
||||
4 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/0:0H
|
||||
5 root 20 0 0 0 0 S 0.0 0.0 0:00.01 kworker/u256:0
|
||||
6 root 20 0 0 0 0 S 0.0 0.0 0:00.06 ksoftirqd/0
|
||||
7 root rt 0 0 0 0 S 0.0 0.0 0:00.00 migration/0
|
||||
8 root 20 0 0 0 0 S 0.0 0.0 0:00.00 rcu_bh
|
||||
9 root 20 0 0 0 0 S 0.0 0.0 0:00.41 rcu_sched
|
||||
10 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 lru-add-drain
|
||||
11 root rt 0 0 0 0 S 0.0 0.0 0:00.00 watchdog/0
|
||||
13 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kdevtmpfs
|
||||
14 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 netns
|
||||
15 root 20 0 0 0 0 S 0.0 0.0 0:00.00 khungtaskd
|
||||
16 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 writeback
|
||||
17 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kintegrityd
|
||||
18 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 bioset
|
||||
19 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 bioset
|
||||
20 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 bioset
|
||||
21 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kblockd
|
||||
22 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 md
|
||||
23 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 edac-poller
|
||||
24 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 watchdogd
|
||||
30 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kswapd0
|
||||
31 root 25 5 0 0 0 S 0.0 0.0 0:00.00 ksmd
|
||||
32 root 39 19 0 0 0 S 0.0 0.0 0:00.00 khugepaged
|
||||
33 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 crypto
|
||||
41 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kthrotld
|
||||
42 root 20 0 0 0 0 S 0.0 0.0 0:00.01 kworker/u256:1
|
||||
43 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kmpath_rdacd
|
||||
44 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kaluad
|
||||
45 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kpsmoused
|
||||
46 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kworker/0:2
|
||||
47 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 ipv6_addrconf
|
||||
60 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 deferwq
|
||||
95 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kauditd
|
||||
261 root 20 0 0 0 0 S 0.0 0.0 0:00.01 kworker/0:3
|
||||
272 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 nfit
|
||||
273 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 mpt_poll_0
|
||||
274 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 mpt/0
|
||||
275 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 ata_sff
|
||||
318 root 20 0 0 0 0 S 0.0 0.0 0:00.00 scsi_eh_0
|
||||
325 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 scsi_tmf_0
|
||||
344 root 20 0 0 0 0 S 0.0 0.0 0:00.01 scsi_eh_1
|
||||
345 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 scsi_tmf_1
|
||||
346 root 20 0 0 0 0 S 0.0 0.0 0:00.00 scsi_eh_2
|
||||
347 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 scsi_tmf_2
|
||||
348 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kworker/u256:2
|
||||
350 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kworker/u256:3
|
||||
356 root 20 0 0 0 0 S 0.0 0.0 0:00.01 kworker/u256:4
|
||||
359 root -51 0 0 0 0 S 0.0 0.0 0:00.01 irq/16-vmwgfx
|
||||
360 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 ttm_swap
|
||||
431 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kdmflush
|
||||
432 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 bioset
|
||||
442 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kdmflush
|
||||
443 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 bioset
|
||||
455 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 bioset
|
||||
456 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 xfsalloc
|
||||
457 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 xfs_mru_cache
|
||||
458 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 xfs-buf/dm-0
|
||||
459 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 xfs-data/dm-0
|
||||
460 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 xfs-conv/dm-0
|
||||
461 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 xfs-cil/dm-0
|
||||
462 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 xfs-reclaim/dm-
|
||||
463 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 xfs-log/dm-0
|
||||
464 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 xfs-eofblocks/d
|
||||
465 root 20 0 0 0 0 R 0.0 0.0 0:00.13 xfsaild/dm-0
|
||||
466 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/0:1H
|
||||
543 root 20 0 39080 3068 2740 S 0.0 0.1 0:00.15 systemd-journal
|
||||
559 root 20 0 127392 4136 2608 S 0.0 0.1 0:00.01 lvmetad
|
||||
573 root 20 0 48124 5288 2876 S 0.0 0.1 0:00.20 systemd-udevd
|
||||
608 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 xfs-buf/sda1
|
||||
610 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 xfs-data/sda1
|
||||
611 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 xfs-conv/sda1
|
||||
615 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 xfs-cil/sda1
|
||||
617 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 xfs-reclaim/sda
|
||||
622 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 xfs-log/sda1
|
||||
625 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 xfs-eofblocks/s
|
||||
626 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/u257:0
|
||||
629 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 hci0
|
||||
630 root 20 0 0 0 0 S 0.0 0.0 0:00.00 xfsaild/sda1
|
||||
633 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 hci0
|
||||
634 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/u257:1
|
||||
635 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/u257:2
|
||||
755 root 16 -4 55528 892 484 S 0.0 0.0 0:00.00 auditd
|
||||
778 root 20 0 52808 2744 1984 S 0.0 0.1 0:00.02 smartd
|
||||
779 dbus 20 0 66472 2624 1888 S 0.0 0.1 0:00.13 dbus-daemon
|
||||
781 root 20 0 57524 2568 2128 S 0.0 0.1 0:00.01 bluetoothd
|
||||
784 root 20 0 26420 1800 1480 S 0.0 0.0 0:00.02 systemd-logind
|
||||
789 polkitd 20 0 613016 15044 4904 S 0.0 0.4 0:00.09 polkitd
|
||||
796 chrony 20 0 117804 1720 1292 S 0.0 0.0 0:00.02 chronyd
|
||||
812 root 20 0 126288 1692 1052 S 0.0 0.0 0:00.47 crond
|
||||
831 root 20 0 110108 864 736 S 0.0 0.0 0:00.00 agetty
|
||||
833 root 20 0 96572 2532 1872 S 0.0 0.1 0:00.14 login
|
||||
852 root 20 0 358752 29532 7048 S 0.0 0.8 0:00.62 firewalld
|
||||
882 root 20 0 701724 9020 6872 S 0.0 0.2 0:00.10 NetworkManager
|
||||
1031 root 20 0 102896 5476 3412 S 0.0 0.1 0:00.01 dhclient
|
||||
1221 root 20 0 574204 17428 6128 S 0.0 0.5 0:00.18 tuned
|
||||
1223 root 20 0 112920 4316 3288 S 0.0 0.1 0:00.01 sshd
|
||||
1225 root 20 0 218548 4248 3300 S 0.0 0.1 0:00.11 rsyslogd
|
||||
1271 root 20 0 284640 12864 5188 S 0.0 0.3 0:00.15 docker-containe
|
||||
1496 root 20 0 89700 2072 1064 S 0.0 0.1 0:00.01 master
|
||||
1508 postfix 20 0 89872 4076 3076 S 0.0 0.1 0:00.00 qmgr
|
||||
1810 root 20 0 123264 732 504 S 0.0 0.0 0:00.00 anacron
|
||||
1867 kbrazil 20 0 115708 2312 1580 S 0.0 0.1 0:00.01 bash
|
||||
1887 root 20 0 158924 5696 4356 S 0.0 0.1 0:00.15 sshd
|
||||
1895 kbrazil 20 0 158924 2452 1088 S 0.0 0.1 0:00.04 sshd
|
||||
1896 kbrazil 20 0 115580 2128 1636 S 0.0 0.1 0:00.02 bash
|
||||
1933 postfix 20 0 89804 4060 3060 S 0.0 0.1 0:00.00 pickup
|
1
tests/fixtures/generic/git-log-full-shortstat-streaming.json
vendored
Normal file
1
tests/fixtures/generic/git-log-full-shortstat-streaming.json
vendored
Normal file
File diff suppressed because one or more lines are too long
1
tests/fixtures/generic/git-log-full-stat-streaming.json
vendored
Normal file
1
tests/fixtures/generic/git-log-full-stat-streaming.json
vendored
Normal file
File diff suppressed because one or more lines are too long
1
tests/fixtures/generic/git-log-full-streaming.json
vendored
Normal file
1
tests/fixtures/generic/git-log-full-streaming.json
vendored
Normal file
File diff suppressed because one or more lines are too long
1
tests/fixtures/generic/git-log-fuller-shortstat-streaming.json
vendored
Normal file
1
tests/fixtures/generic/git-log-fuller-shortstat-streaming.json
vendored
Normal file
File diff suppressed because one or more lines are too long
1
tests/fixtures/generic/git-log-fuller-stat-streaming.json
vendored
Normal file
1
tests/fixtures/generic/git-log-fuller-stat-streaming.json
vendored
Normal file
File diff suppressed because one or more lines are too long
1
tests/fixtures/generic/git-log-fuller-streaming.json
vendored
Normal file
1
tests/fixtures/generic/git-log-fuller-streaming.json
vendored
Normal file
File diff suppressed because one or more lines are too long
1
tests/fixtures/generic/git-log-hash-in-message-fix-streaming.json
vendored
Normal file
1
tests/fixtures/generic/git-log-hash-in-message-fix-streaming.json
vendored
Normal file
@ -0,0 +1 @@
|
||||
[{"commit":"e05824a36ca62aa9f3a21854ec8b40a3e0f7a68d","author":"Benedikt Heine","author_email":"bebe@bebehei.de","date":"Mon Oct 28 12:42:22 2019 +0100","commit_by":"Benedikt Heine","commit_by_email":"bebe@bebehei.de","commit_by_date":"Sun Apr 12 17:27:16 2020 +0200","stats":{"files_changed":1,"insertions":13,"deletions":3,"files":["salt/modules/monit.py"]},"message":"Split monit status fields on monit version\n\nWith the commit [0] on monit, the field size changed. So splitting hard\nafter 35 chars, new versions of monit break when using monit.status.\n\n[0] https://bitbucket.org/tildeslash/monit/commits/\n471c4bbc388c1c536f07ce1dd26b811bd39a9467","epoch":1572291742,"epoch_utc":null},{"commit":"910a2ac4809bb05b886adfe75f4857eb53fdfbb1","merge":"6c3964ce30 f0a1e923e3","author":"Daniel Wozniak","author_email":"dwozniak@saltstack.com","date":"Sun Apr 12 00:09:37 2020 -0700","commit_by":"GitHub","commit_by_email":"noreply@github.com","commit_by_date":"Sun Apr 12 00:09:37 2020 -0700","message":"Merge pull request #53911 from terminalmage/squelch-log\n\nalternatives: Don't log error when running \"alternatives --display\" on nonexistant target","epoch":1586675377,"epoch_utc":null},{"commit":"6c3964ce30929e749c0965bc0d60527e9fe8dbb1","merge":"3026c25faf 2ac4da54e3","author":"Daniel Wozniak","author_email":"dwozniak@saltstack.com","date":"Sun Apr 12 00:09:16 2020 -0700","commit_by":"GitHub","commit_by_email":"noreply@github.com","commit_by_date":"Sun Apr 12 00:09:16 2020 -0700","message":"Merge pull request #54199 from driskell/patch-2\n\nFix broken sdb.get_or_set_hash for Hashicorp Vault","epoch":1586675356,"epoch_utc":null}]
|
1
tests/fixtures/generic/git-log-hash-in-message-fix.json
vendored
Normal file
1
tests/fixtures/generic/git-log-hash-in-message-fix.json
vendored
Normal file
@ -0,0 +1 @@
|
||||
[{"commit":"e05824a36ca62aa9f3a21854ec8b40a3e0f7a68d","author":"Benedikt Heine","author_email":"bebe@bebehei.de","date":"Mon Oct 28 12:42:22 2019 +0100","commit_by":"Benedikt Heine","commit_by_email":"bebe@bebehei.de","commit_by_date":"Sun Apr 12 17:27:16 2020 +0200","stats":{"files_changed":1,"insertions":13,"deletions":3,"files":["salt/modules/monit.py"]},"message":"Split monit status fields on monit version\n\nWith the commit [0] on monit, the field size changed. So splitting hard\nafter 35 chars, new versions of monit break when using monit.status.\n\n[0] https://bitbucket.org/tildeslash/monit/commits/\n471c4bbc388c1c536f07ce1dd26b811bd39a9467","epoch":1572291742,"epoch_utc":null},{"commit":"910a2ac4809bb05b886adfe75f4857eb53fdfbb1","merge":"6c3964ce30 f0a1e923e3","author":"Daniel Wozniak","author_email":"dwozniak@saltstack.com","date":"Sun Apr 12 00:09:37 2020 -0700","commit_by":"GitHub","commit_by_email":"noreply@github.com","commit_by_date":"Sun Apr 12 00:09:37 2020 -0700","message":"Merge pull request #53911 from terminalmage/squelch-log\n\nalternatives: Don't log error when running \"alternatives --display\" on nonexistant target","epoch":1586675377,"epoch_utc":null},{"commit":"6c3964ce30929e749c0965bc0d60527e9fe8dbb1","merge":"3026c25faf 2ac4da54e3","author":"Daniel Wozniak","author_email":"dwozniak@saltstack.com","date":"Sun Apr 12 00:09:16 2020 -0700","commit_by":"GitHub","commit_by_email":"noreply@github.com","commit_by_date":"Sun Apr 12 00:09:16 2020 -0700","message":"Merge pull request #54199 from driskell/patch-2\n\nFix broken sdb.get_or_set_hash for Hashicorp Vault","epoch":1586675356,"epoch_utc":null}]
|
38
tests/fixtures/generic/git-log-hash-in-message-fix.out
vendored
Normal file
38
tests/fixtures/generic/git-log-hash-in-message-fix.out
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
commit e05824a36ca62aa9f3a21854ec8b40a3e0f7a68d
|
||||
Author: Benedikt Heine <bebe@bebehei.de>
|
||||
AuthorDate: Mon Oct 28 12:42:22 2019 +0100
|
||||
Commit: Benedikt Heine <bebe@bebehei.de>
|
||||
CommitDate: Sun Apr 12 17:27:16 2020 +0200
|
||||
|
||||
Split monit status fields on monit version
|
||||
|
||||
With the commit [0] on monit, the field size changed. So splitting hard
|
||||
after 35 chars, new versions of monit break when using monit.status.
|
||||
|
||||
[0] https://bitbucket.org/tildeslash/monit/commits/
|
||||
471c4bbc388c1c536f07ce1dd26b811bd39a9467
|
||||
|
||||
salt/modules/monit.py | 16 +++++++++++++---
|
||||
1 file changed, 13 insertions(+), 3 deletions(-)
|
||||
|
||||
commit 910a2ac4809bb05b886adfe75f4857eb53fdfbb1
|
||||
Merge: 6c3964ce30 f0a1e923e3
|
||||
Author: Daniel Wozniak <dwozniak@saltstack.com>
|
||||
AuthorDate: Sun Apr 12 00:09:37 2020 -0700
|
||||
Commit: GitHub <noreply@github.com>
|
||||
CommitDate: Sun Apr 12 00:09:37 2020 -0700
|
||||
|
||||
Merge pull request #53911 from terminalmage/squelch-log
|
||||
|
||||
alternatives: Don't log error when running "alternatives --display" on nonexistant target
|
||||
|
||||
commit 6c3964ce30929e749c0965bc0d60527e9fe8dbb1
|
||||
Merge: 3026c25faf 2ac4da54e3
|
||||
Author: Daniel Wozniak <dwozniak@saltstack.com>
|
||||
AuthorDate: Sun Apr 12 00:09:16 2020 -0700
|
||||
Commit: GitHub <noreply@github.com>
|
||||
CommitDate: Sun Apr 12 00:09:16 2020 -0700
|
||||
|
||||
Merge pull request #54199 from driskell/patch-2
|
||||
|
||||
Fix broken sdb.get_or_set_hash for Hashicorp Vault
|
1
tests/fixtures/generic/git-log-is-hash-regex-fix-streaming.json
vendored
Normal file
1
tests/fixtures/generic/git-log-is-hash-regex-fix-streaming.json
vendored
Normal file
@ -0,0 +1 @@
|
||||
[{"commit":"6170eac439e590d774eb2e448c68eec90ea3fac0","author":"Jasper Lievisse Adriaanse","author_email":"j@jasper.la","date":"Fri Jul 3 15:19:49 2020 +0200","commit_by":"Daniel Wozniak","commit_by_email":"dan.woz@gmail.com","commit_by_date":"Fri Aug 28 12:16:13 2020 -0700","stats":{"files_changed":1,"insertions":11,"deletions":12,"files":["doc/topics/installation/openbsd.rst"]},"message":"Sync OpenBSD installation documentation with reality\n\nOpenBSD's salt package moved to python3 a while ago and dependencies\nhave changed since this page was last updated.\n\nWhile here tweak a reference to the OpenBSD package, not pkg, repo.","epoch":1593814789,"epoch_utc":null},{"commit":"2d684bd506d473379670ff8905db689d051ff7db","author":"Bryce Larson","author_email":"blarson@saltstack.com","date":"Thu Aug 13 18:04:22 2020 +0000","commit_by":"Daniel Wozniak","commit_by_email":"dan.woz@gmail.com","commit_by_date":"Fri Aug 28 11:03:45 2020 -0700","stats":{"files_changed":88,"insertions":88,"deletions":0,"files":[".ci/kitchen-amazon2-py3",".ci/kitchen-amazon2-py3-pytest",".ci/kitchen-archlts-py3",".ci/kitchen-archlts-py3-pytest",".ci/kitchen-centos7-py3",".ci/kitchen-centos7-py3-cloud",".ci/kitchen-centos7-py3-cloud-pytest",".ci/kitchen-centos7-py3-m2crypto",".ci/kitchen-centos7-py3-m2crypto-pytest",".ci/kitchen-centos7-py3-proxy",".ci/kitchen-centos7-py3-pycryptodome",".ci/kitchen-centos7-py3-pycryptodome-pytest",".ci/kitchen-centos7-py3-pytest",".ci/kitchen-centos7-py3-tcp",".ci/kitchen-centos7-py3-tcp-pytest",".ci/kitchen-centos8-py3",".ci/kitchen-centos8-py3-pytest",".ci/kitchen-debian10-py3",".ci/kitchen-debian10-py3-pytest",".ci/kitchen-debian9-py3",".ci/kitchen-debian9-py3-pytest",".ci/kitchen-fedora31-py3",".ci/kitchen-fedora31-py3-pytest",".ci/kitchen-fedora32-py3",".ci/kitchen-fedora32-py3-pytest",".ci/kitchen-opensuse15-py3",".ci/kitchen-opensuse15-py3-pytest",".ci/kitchen-ubuntu1604-py3",".ci/kitchen-ubuntu1604-py3-m2crypto",".ci/kitchen-ubuntu1604-py3-m2crypto-pytest",".ci/kitchen-ubuntu1604-py3-proxy",".ci/kitchen-ubuntu1604-py3-pycryptodome",".ci/kitchen-ubuntu1604-py3-pycryptodome-pytest",".ci/kitchen-ubuntu1604-py3-pytest",".ci/kitchen-ubuntu1604-py3-tcp",".ci/kitchen-ubuntu1604-py3-tcp-pytest",".ci/kitchen-ubuntu1804-py3",".ci/kitchen-ubuntu1804-py3-pytest",".ci/kitchen-ubuntu2004-py3",".ci/kitchen-ubuntu2004-py3-pytest",".ci/kitchen-windows2016-py3",".ci/kitchen-windows2016-py3-pytest",".ci/kitchen-windows2019-py3",".ci/kitchen-windows2019-py3-pytest","cicd/jenkins/kitchen-amazon2-py3","cicd/jenkins/kitchen-amazon2-py3-pytest","cicd/jenkins/kitchen-archlts-py3","cicd/jenkins/kitchen-archlts-py3-pytest","cicd/jenkins/kitchen-centos7-py3","cicd/jenkins/kitchen-centos7-py3-cloud","cicd/jenkins/kitchen-centos7-py3-cloud-pytest","cicd/jenkins/kitchen-centos7-py3-m2crypto","cicd/jenkins/kitchen-centos7-py3-m2crypto-pytest","cicd/jenkins/kitchen-centos7-py3-proxy","cicd/jenkins/kitchen-centos7-py3-pycryptodome","cicd/jenkins/kitchen-centos7-py3-pycryptodome-pytest","cicd/jenkins/kitchen-centos7-py3-pytest","cicd/jenkins/kitchen-centos7-py3-tcp","cicd/jenkins/kitchen-centos7-py3-tcp-pytest","cicd/jenkins/kitchen-centos8-py3","cicd/jenkins/kitchen-centos8-py3-pytest","cicd/jenkins/kitchen-debian10-py3","cicd/jenkins/kitchen-debian10-py3-pytest","cicd/jenkins/kitchen-debian9-py3","cicd/jenkins/kitchen-debian9-py3-pytest","cicd/jenkins/kitchen-fedora31-py3","cicd/jenkins/kitchen-fedora31-py3-pytest","cicd/jenkins/kitchen-fedora32-py3","cicd/jenkins/kitchen-fedora32-py3-pytest","cicd/jenkins/kitchen-opensuse15-py3","cicd/jenkins/kitchen-opensuse15-py3-pytest","cicd/jenkins/kitchen-ubuntu1604-py3","cicd/jenkins/kitchen-ubuntu1604-py3-m2crypto","cicd/jenkins/kitchen-ubuntu1604-py3-m2crypto-pytest","cicd/jenkins/kitchen-ubuntu1604-py3-proxy","cicd/jenkins/kitchen-ubuntu1604-py3-pycryptodome","cicd/jenkins/kitchen-ubuntu1604-py3-pycryptodome-pytest","cicd/jenkins/kitchen-ubuntu1604-py3-pytest","cicd/jenkins/kitchen-ubuntu1604-py3-tcp","cicd/jenkins/kitchen-ubuntu1604-py3-tcp-pytest","cicd/jenkins/kitchen-ubuntu1804-py3","cicd/jenkins/kitchen-ubuntu1804-py3-pytest","cicd/jenkins/kitchen-ubuntu2004-py3","cicd/jenkins/kitchen-ubuntu2004-py3-pytest","cicd/jenkins/kitchen-windows2016-py3","cicd/jenkins/kitchen-windows2016-py3-pytest","cicd/jenkins/kitchen-windows2019-py3","cicd/jenkins/kitchen-windows2019-py3-pytest"]},"message":"hard-code ami ids","epoch":1597367062,"epoch_utc":1597341862},{"commit":"3332f5e131f223a9fd9fef22437c7830210d301f","author":"krionbsd","author_email":"krion@FreeBSD.org","date":"Thu Jul 30 14:50:44 2020 +0200","commit_by":"Daniel Wozniak","commit_by_email":"dan.woz@gmail.com","commit_by_date":"Thu Aug 27 13:04:37 2020 -0700","stats":{"files_changed":1,"insertions":31,"deletions":36,"files":["tests/unit/test_loader.py"]},"message":"[merge jam] port 53224","epoch":1596145844,"epoch_utc":null}]
|
1
tests/fixtures/generic/git-log-is-hash-regex-fix.json
vendored
Normal file
1
tests/fixtures/generic/git-log-is-hash-regex-fix.json
vendored
Normal file
@ -0,0 +1 @@
|
||||
[{"commit":"6170eac439e590d774eb2e448c68eec90ea3fac0","author":"Jasper Lievisse Adriaanse","author_email":"j@jasper.la","date":"Fri Jul 3 15:19:49 2020 +0200","commit_by":"Daniel Wozniak","commit_by_email":"dan.woz@gmail.com","commit_by_date":"Fri Aug 28 12:16:13 2020 -0700","stats":{"files_changed":1,"insertions":11,"deletions":12,"files":["doc/topics/installation/openbsd.rst"]},"message":"Sync OpenBSD installation documentation with reality\n\nOpenBSD's salt package moved to python3 a while ago and dependencies\nhave changed since this page was last updated.\n\nWhile here tweak a reference to the OpenBSD package, not pkg, repo.","epoch":1593814789,"epoch_utc":null},{"commit":"2d684bd506d473379670ff8905db689d051ff7db","author":"Bryce Larson","author_email":"blarson@saltstack.com","date":"Thu Aug 13 18:04:22 2020 +0000","commit_by":"Daniel Wozniak","commit_by_email":"dan.woz@gmail.com","commit_by_date":"Fri Aug 28 11:03:45 2020 -0700","stats":{"files_changed":88,"insertions":88,"deletions":0,"files":[".ci/kitchen-amazon2-py3",".ci/kitchen-amazon2-py3-pytest",".ci/kitchen-archlts-py3",".ci/kitchen-archlts-py3-pytest",".ci/kitchen-centos7-py3",".ci/kitchen-centos7-py3-cloud",".ci/kitchen-centos7-py3-cloud-pytest",".ci/kitchen-centos7-py3-m2crypto",".ci/kitchen-centos7-py3-m2crypto-pytest",".ci/kitchen-centos7-py3-proxy",".ci/kitchen-centos7-py3-pycryptodome",".ci/kitchen-centos7-py3-pycryptodome-pytest",".ci/kitchen-centos7-py3-pytest",".ci/kitchen-centos7-py3-tcp",".ci/kitchen-centos7-py3-tcp-pytest",".ci/kitchen-centos8-py3",".ci/kitchen-centos8-py3-pytest",".ci/kitchen-debian10-py3",".ci/kitchen-debian10-py3-pytest",".ci/kitchen-debian9-py3",".ci/kitchen-debian9-py3-pytest",".ci/kitchen-fedora31-py3",".ci/kitchen-fedora31-py3-pytest",".ci/kitchen-fedora32-py3",".ci/kitchen-fedora32-py3-pytest",".ci/kitchen-opensuse15-py3",".ci/kitchen-opensuse15-py3-pytest",".ci/kitchen-ubuntu1604-py3",".ci/kitchen-ubuntu1604-py3-m2crypto",".ci/kitchen-ubuntu1604-py3-m2crypto-pytest",".ci/kitchen-ubuntu1604-py3-proxy",".ci/kitchen-ubuntu1604-py3-pycryptodome",".ci/kitchen-ubuntu1604-py3-pycryptodome-pytest",".ci/kitchen-ubuntu1604-py3-pytest",".ci/kitchen-ubuntu1604-py3-tcp",".ci/kitchen-ubuntu1604-py3-tcp-pytest",".ci/kitchen-ubuntu1804-py3",".ci/kitchen-ubuntu1804-py3-pytest",".ci/kitchen-ubuntu2004-py3",".ci/kitchen-ubuntu2004-py3-pytest",".ci/kitchen-windows2016-py3",".ci/kitchen-windows2016-py3-pytest",".ci/kitchen-windows2019-py3",".ci/kitchen-windows2019-py3-pytest","cicd/jenkins/kitchen-amazon2-py3","cicd/jenkins/kitchen-amazon2-py3-pytest","cicd/jenkins/kitchen-archlts-py3","cicd/jenkins/kitchen-archlts-py3-pytest","cicd/jenkins/kitchen-centos7-py3","cicd/jenkins/kitchen-centos7-py3-cloud","cicd/jenkins/kitchen-centos7-py3-cloud-pytest","cicd/jenkins/kitchen-centos7-py3-m2crypto","cicd/jenkins/kitchen-centos7-py3-m2crypto-pytest","cicd/jenkins/kitchen-centos7-py3-proxy","cicd/jenkins/kitchen-centos7-py3-pycryptodome","cicd/jenkins/kitchen-centos7-py3-pycryptodome-pytest","cicd/jenkins/kitchen-centos7-py3-pytest","cicd/jenkins/kitchen-centos7-py3-tcp","cicd/jenkins/kitchen-centos7-py3-tcp-pytest","cicd/jenkins/kitchen-centos8-py3","cicd/jenkins/kitchen-centos8-py3-pytest","cicd/jenkins/kitchen-debian10-py3","cicd/jenkins/kitchen-debian10-py3-pytest","cicd/jenkins/kitchen-debian9-py3","cicd/jenkins/kitchen-debian9-py3-pytest","cicd/jenkins/kitchen-fedora31-py3","cicd/jenkins/kitchen-fedora31-py3-pytest","cicd/jenkins/kitchen-fedora32-py3","cicd/jenkins/kitchen-fedora32-py3-pytest","cicd/jenkins/kitchen-opensuse15-py3","cicd/jenkins/kitchen-opensuse15-py3-pytest","cicd/jenkins/kitchen-ubuntu1604-py3","cicd/jenkins/kitchen-ubuntu1604-py3-m2crypto","cicd/jenkins/kitchen-ubuntu1604-py3-m2crypto-pytest","cicd/jenkins/kitchen-ubuntu1604-py3-proxy","cicd/jenkins/kitchen-ubuntu1604-py3-pycryptodome","cicd/jenkins/kitchen-ubuntu1604-py3-pycryptodome-pytest","cicd/jenkins/kitchen-ubuntu1604-py3-pytest","cicd/jenkins/kitchen-ubuntu1604-py3-tcp","cicd/jenkins/kitchen-ubuntu1604-py3-tcp-pytest","cicd/jenkins/kitchen-ubuntu1804-py3","cicd/jenkins/kitchen-ubuntu1804-py3-pytest","cicd/jenkins/kitchen-ubuntu2004-py3","cicd/jenkins/kitchen-ubuntu2004-py3-pytest","cicd/jenkins/kitchen-windows2016-py3","cicd/jenkins/kitchen-windows2016-py3-pytest","cicd/jenkins/kitchen-windows2019-py3","cicd/jenkins/kitchen-windows2019-py3-pytest"]},"message":"hard-code ami ids","epoch":1597367062,"epoch_utc":1597341862},{"commit":"3332f5e131f223a9fd9fef22437c7830210d301f","author":"krionbsd","author_email":"krion@FreeBSD.org","date":"Thu Jul 30 14:50:44 2020 +0200","commit_by":"Daniel Wozniak","commit_by_email":"dan.woz@gmail.com","commit_by_date":"Thu Aug 27 13:04:37 2020 -0700","stats":{"files_changed":1,"insertions":31,"deletions":36,"files":["tests/unit/test_loader.py"]},"message":"[merge jam] port 53224","epoch":1596145844,"epoch_utc":null}]
|
124
tests/fixtures/generic/git-log-is-hash-regex-fix.out
vendored
Normal file
124
tests/fixtures/generic/git-log-is-hash-regex-fix.out
vendored
Normal file
@ -0,0 +1,124 @@
|
||||
commit 6170eac439e590d774eb2e448c68eec90ea3fac0
|
||||
Author: Jasper Lievisse Adriaanse <j@jasper.la>
|
||||
AuthorDate: Fri Jul 3 15:19:49 2020 +0200
|
||||
Commit: Daniel Wozniak <dan.woz@gmail.com>
|
||||
CommitDate: Fri Aug 28 12:16:13 2020 -0700
|
||||
|
||||
Sync OpenBSD installation documentation with reality
|
||||
|
||||
OpenBSD's salt package moved to python3 a while ago and dependencies
|
||||
have changed since this page was last updated.
|
||||
|
||||
While here tweak a reference to the OpenBSD package, not pkg, repo.
|
||||
|
||||
doc/topics/installation/openbsd.rst | 23 +++++++++++------------
|
||||
1 file changed, 11 insertions(+), 12 deletions(-)
|
||||
|
||||
commit 2d684bd506d473379670ff8905db689d051ff7db
|
||||
Author: Bryce Larson <blarson@saltstack.com>
|
||||
AuthorDate: Thu Aug 13 18:04:22 2020 +0000
|
||||
Commit: Daniel Wozniak <dan.woz@gmail.com>
|
||||
CommitDate: Fri Aug 28 11:03:45 2020 -0700
|
||||
|
||||
hard-code ami ids
|
||||
|
||||
.ci/kitchen-amazon2-py3 | 1 +
|
||||
.ci/kitchen-amazon2-py3-pytest | 1 +
|
||||
.ci/kitchen-archlts-py3 | 1 +
|
||||
.ci/kitchen-archlts-py3-pytest | 1 +
|
||||
.ci/kitchen-centos7-py3 | 1 +
|
||||
.ci/kitchen-centos7-py3-cloud | 1 +
|
||||
.ci/kitchen-centos7-py3-cloud-pytest | 1 +
|
||||
.ci/kitchen-centos7-py3-m2crypto | 1 +
|
||||
.ci/kitchen-centos7-py3-m2crypto-pytest | 1 +
|
||||
.ci/kitchen-centos7-py3-proxy | 1 +
|
||||
.ci/kitchen-centos7-py3-pycryptodome | 1 +
|
||||
.ci/kitchen-centos7-py3-pycryptodome-pytest | 1 +
|
||||
.ci/kitchen-centos7-py3-pytest | 1 +
|
||||
.ci/kitchen-centos7-py3-tcp | 1 +
|
||||
.ci/kitchen-centos7-py3-tcp-pytest | 1 +
|
||||
.ci/kitchen-centos8-py3 | 1 +
|
||||
.ci/kitchen-centos8-py3-pytest | 1 +
|
||||
.ci/kitchen-debian10-py3 | 1 +
|
||||
.ci/kitchen-debian10-py3-pytest | 1 +
|
||||
.ci/kitchen-debian9-py3 | 1 +
|
||||
.ci/kitchen-debian9-py3-pytest | 1 +
|
||||
.ci/kitchen-fedora31-py3 | 1 +
|
||||
.ci/kitchen-fedora31-py3-pytest | 1 +
|
||||
.ci/kitchen-fedora32-py3 | 1 +
|
||||
.ci/kitchen-fedora32-py3-pytest | 1 +
|
||||
.ci/kitchen-opensuse15-py3 | 1 +
|
||||
.ci/kitchen-opensuse15-py3-pytest | 1 +
|
||||
.ci/kitchen-ubuntu1604-py3 | 1 +
|
||||
.ci/kitchen-ubuntu1604-py3-m2crypto | 1 +
|
||||
.ci/kitchen-ubuntu1604-py3-m2crypto-pytest | 1 +
|
||||
.ci/kitchen-ubuntu1604-py3-proxy | 1 +
|
||||
.ci/kitchen-ubuntu1604-py3-pycryptodome | 1 +
|
||||
.ci/kitchen-ubuntu1604-py3-pycryptodome-pytest | 1 +
|
||||
.ci/kitchen-ubuntu1604-py3-pytest | 1 +
|
||||
.ci/kitchen-ubuntu1604-py3-tcp | 1 +
|
||||
.ci/kitchen-ubuntu1604-py3-tcp-pytest | 1 +
|
||||
.ci/kitchen-ubuntu1804-py3 | 1 +
|
||||
.ci/kitchen-ubuntu1804-py3-pytest | 1 +
|
||||
.ci/kitchen-ubuntu2004-py3 | 1 +
|
||||
.ci/kitchen-ubuntu2004-py3-pytest | 1 +
|
||||
.ci/kitchen-windows2016-py3 | 1 +
|
||||
.ci/kitchen-windows2016-py3-pytest | 1 +
|
||||
.ci/kitchen-windows2019-py3 | 1 +
|
||||
.ci/kitchen-windows2019-py3-pytest | 1 +
|
||||
cicd/jenkins/kitchen-amazon2-py3 | 1 +
|
||||
cicd/jenkins/kitchen-amazon2-py3-pytest | 1 +
|
||||
cicd/jenkins/kitchen-archlts-py3 | 1 +
|
||||
cicd/jenkins/kitchen-archlts-py3-pytest | 1 +
|
||||
cicd/jenkins/kitchen-centos7-py3 | 1 +
|
||||
cicd/jenkins/kitchen-centos7-py3-cloud | 1 +
|
||||
cicd/jenkins/kitchen-centos7-py3-cloud-pytest | 1 +
|
||||
cicd/jenkins/kitchen-centos7-py3-m2crypto | 1 +
|
||||
cicd/jenkins/kitchen-centos7-py3-m2crypto-pytest | 1 +
|
||||
cicd/jenkins/kitchen-centos7-py3-proxy | 1 +
|
||||
cicd/jenkins/kitchen-centos7-py3-pycryptodome | 1 +
|
||||
cicd/jenkins/kitchen-centos7-py3-pycryptodome-pytest | 1 +
|
||||
cicd/jenkins/kitchen-centos7-py3-pytest | 1 +
|
||||
cicd/jenkins/kitchen-centos7-py3-tcp | 1 +
|
||||
cicd/jenkins/kitchen-centos7-py3-tcp-pytest | 1 +
|
||||
cicd/jenkins/kitchen-centos8-py3 | 1 +
|
||||
cicd/jenkins/kitchen-centos8-py3-pytest | 1 +
|
||||
cicd/jenkins/kitchen-debian10-py3 | 1 +
|
||||
cicd/jenkins/kitchen-debian10-py3-pytest | 1 +
|
||||
cicd/jenkins/kitchen-debian9-py3 | 1 +
|
||||
cicd/jenkins/kitchen-debian9-py3-pytest | 1 +
|
||||
cicd/jenkins/kitchen-fedora31-py3 | 1 +
|
||||
cicd/jenkins/kitchen-fedora31-py3-pytest | 1 +
|
||||
cicd/jenkins/kitchen-fedora32-py3 | 1 +
|
||||
cicd/jenkins/kitchen-fedora32-py3-pytest | 1 +
|
||||
cicd/jenkins/kitchen-opensuse15-py3 | 1 +
|
||||
cicd/jenkins/kitchen-opensuse15-py3-pytest | 1 +
|
||||
cicd/jenkins/kitchen-ubuntu1604-py3 | 1 +
|
||||
cicd/jenkins/kitchen-ubuntu1604-py3-m2crypto | 1 +
|
||||
cicd/jenkins/kitchen-ubuntu1604-py3-m2crypto-pytest | 1 +
|
||||
cicd/jenkins/kitchen-ubuntu1604-py3-proxy | 1 +
|
||||
cicd/jenkins/kitchen-ubuntu1604-py3-pycryptodome | 1 +
|
||||
cicd/jenkins/kitchen-ubuntu1604-py3-pycryptodome-pytest | 1 +
|
||||
cicd/jenkins/kitchen-ubuntu1604-py3-pytest | 1 +
|
||||
cicd/jenkins/kitchen-ubuntu1604-py3-tcp | 1 +
|
||||
cicd/jenkins/kitchen-ubuntu1604-py3-tcp-pytest | 1 +
|
||||
cicd/jenkins/kitchen-ubuntu1804-py3 | 1 +
|
||||
cicd/jenkins/kitchen-ubuntu1804-py3-pytest | 1 +
|
||||
cicd/jenkins/kitchen-ubuntu2004-py3 | 1 +
|
||||
cicd/jenkins/kitchen-ubuntu2004-py3-pytest | 1 +
|
||||
cicd/jenkins/kitchen-windows2016-py3 | 1 +
|
||||
cicd/jenkins/kitchen-windows2016-py3-pytest | 1 +
|
||||
cicd/jenkins/kitchen-windows2019-py3 | 1 +
|
||||
cicd/jenkins/kitchen-windows2019-py3-pytest | 1 +
|
||||
88 files changed, 88 insertions(+)
|
||||
|
||||
commit 3332f5e131f223a9fd9fef22437c7830210d301f
|
||||
Author: krionbsd <krion@FreeBSD.org>
|
||||
AuthorDate: Thu Jul 30 14:50:44 2020 +0200
|
||||
Commit: Daniel Wozniak <dan.woz@gmail.com>
|
||||
CommitDate: Thu Aug 27 13:04:37 2020 -0700
|
||||
|
||||
[merge jam] port 53224
|
||||
|
||||
tests/unit/test_loader.py | 67 ++++++++++++++++++++++-------------------------
|
||||
1 file changed, 31 insertions(+), 36 deletions(-)
|
1
tests/fixtures/generic/git-log-medium-shortstat-streaming.json
vendored
Normal file
1
tests/fixtures/generic/git-log-medium-shortstat-streaming.json
vendored
Normal file
File diff suppressed because one or more lines are too long
1
tests/fixtures/generic/git-log-medium-stat-streaming.json
vendored
Normal file
1
tests/fixtures/generic/git-log-medium-stat-streaming.json
vendored
Normal file
File diff suppressed because one or more lines are too long
1
tests/fixtures/generic/git-log-medium-streaming.json
vendored
Normal file
1
tests/fixtures/generic/git-log-medium-streaming.json
vendored
Normal file
File diff suppressed because one or more lines are too long
1
tests/fixtures/generic/git-log-oneline-shortstat-streaming.json
vendored
Normal file
1
tests/fixtures/generic/git-log-oneline-shortstat-streaming.json
vendored
Normal file
File diff suppressed because one or more lines are too long
1
tests/fixtures/generic/git-log-oneline-stat-streaming.json
vendored
Normal file
1
tests/fixtures/generic/git-log-oneline-stat-streaming.json
vendored
Normal file
File diff suppressed because one or more lines are too long
1
tests/fixtures/generic/git-log-oneline-streaming.json
vendored
Normal file
1
tests/fixtures/generic/git-log-oneline-streaming.json
vendored
Normal file
File diff suppressed because one or more lines are too long
1
tests/fixtures/generic/git-log-short-shortstat-streaming.json
vendored
Normal file
1
tests/fixtures/generic/git-log-short-shortstat-streaming.json
vendored
Normal file
File diff suppressed because one or more lines are too long
1
tests/fixtures/generic/git-log-short-stat-streaming.json
vendored
Normal file
1
tests/fixtures/generic/git-log-short-stat-streaming.json
vendored
Normal file
File diff suppressed because one or more lines are too long
1
tests/fixtures/generic/git-log-short-streaming.json
vendored
Normal file
1
tests/fixtures/generic/git-log-short-streaming.json
vendored
Normal file
File diff suppressed because one or more lines are too long
1
tests/fixtures/generic/git-log-streaming-ignore-exceptions.json
vendored
Normal file
1
tests/fixtures/generic/git-log-streaming-ignore-exceptions.json
vendored
Normal file
File diff suppressed because one or more lines are too long
1
tests/fixtures/generic/git-log-streaming.json
vendored
Normal file
1
tests/fixtures/generic/git-log-streaming.json
vendored
Normal file
File diff suppressed because one or more lines are too long
@ -270,6 +270,72 @@ class MyTests(unittest.TestCase):
|
||||
|
||||
self.assertEqual(jc.parsers.asciitable_m.parse(input, quiet=True), expected)
|
||||
|
||||
def test_asciitable_m_sep_char_in_cell(self):
|
||||
"""
|
||||
Test 'asciitable_m' with a column separator character inside the data
|
||||
"""
|
||||
input = '''
|
||||
| Author | yada | yada2 | yada3 | yada4 | yada5 | yada6 | yada7 |
|
||||
├─────────────────┼─────────────┼─────────────────┼─────────────────┼─────────────────┼─────────────────┼────────────┼─────────────────┤
|
||||
│ Kelly Brazil │ │ a76d46f9ecb1eff │ kellyjonbrazil@ │ Fri Feb 4 12:14 │ refactor ignore │ 1644005656 │ │
|
||||
│ │ │ 4d6cc7ad633c97c │ gmail.com │ :16 2022 -0800 │ _exceptions │ │ │
|
||||
│ │ │ ec0e99001a │ │ │ │ │ │
|
||||
├─────────────────┼─────────────┼─────────────────┼─────────────────┼─────────────────┼─────────────────┼────────────┼─────────────────┤
|
||||
│ Kevin Lyter │ │ 6b069a82d0fa19c │ lyterk@sent.com │ Thu Feb 3 18:13 │ Add xrandr to l │ 1643940838 │ │
|
||||
│ │ │ 8d83b19b934bace │ │ :58 2022 -0800 │ ib.py │ │ │
|
||||
│ │ │ 556cb758d7 │ │ │ │ │ │
|
||||
├─────────────────┼─────────────┼─────────────────┼─────────────────┼─────────────────┼─────────────────┼────────────┼─────────────────┤
|
||||
│ Kevin Lyter │ │ 6b793d052147406 │ lyterk@sent.com │ Thu Feb 3 18:13 │ Clean up types │ 1643940791 │ │
|
||||
│ │ │ f388c4d5dc04f50 │ │ :11 2022 -0800 │ │ │ │
|
||||
│ │ │ 6a3456f409 │ │ │ │ │ │
|
||||
│ │ │ │ │ │ * | operator = │ │ │
|
||||
│ │ │ │ │ │ > Union[] │ │ │
|
||||
│ │ │ │ │ │ * Rem │ │ │
|
||||
│ │ │ │ │ │ ove unused impo │ │ │
|
||||
│ │ │ │ │ │ rt Iterator │ │ │
|
||||
│ │ │ │ │ │ * R │ │ │
|
||||
│ │ │ │ │ │ emove comment │ │ │
|
||||
├─────────────────┼─────────────┼─────────────────┼─────────────────┼─────────────────┼─────────────────┼────────────┼─────────────────┤
|
||||
│ Kevin Lyter │ │ ce9103f7cc66689 │ lyterk@sent.com │ Thu Feb 3 18:12 │ Delete old file │ 1643940766 │ │
|
||||
│ │ │ 5dc7840d32797d8 │ │ :46 2022 -0800 │ s in template f │ │ │
|
||||
│ │ │ c7274cf1b8 │ │ │ older │ │ │
|
||||
├─────────────────┼─────────────┼─────────────────┼─────────────────┼─────────────────┼─────────────────┼────────────┼─────────────────┤
|
||||
'''
|
||||
expected = [
|
||||
{
|
||||
"author": "Kelly Brazil",
|
||||
"yada": None,
|
||||
"yada2": "a76d46f9ecb1eff\n4d6cc7ad633c97c\nec0e99001a",
|
||||
"yada3": "kellyjonbrazil@\ngmail.com",
|
||||
"yada4": "Fri Feb 4 12:14\n:16 2022 -0800",
|
||||
"yada5": "refactor ignore\n_exceptions",
|
||||
"yada6": "1644005656",
|
||||
"yada7": None
|
||||
},
|
||||
{
|
||||
"author": "Kevin Lyter",
|
||||
"yada": None,
|
||||
"yada2": "6b069a82d0fa19c\n8d83b19b934bace\n556cb758d7",
|
||||
"yada3": "lyterk@sent.com",
|
||||
"yada4": "Thu Feb 3 18:13\n:58 2022 -0800",
|
||||
"yada5": "Add xrandr to l\nib.py",
|
||||
"yada6": "1643940838",
|
||||
"yada7": None
|
||||
},
|
||||
{
|
||||
"author": "Kevin Lyter",
|
||||
"yada": None,
|
||||
"yada2": "ce9103f7cc66689\n5dc7840d32797d8\nc7274cf1b8",
|
||||
"yada3": "lyterk@sent.com",
|
||||
"yada4": "Thu Feb 3 18:12\n:46 2022 -0800",
|
||||
"yada5": "Delete old file\ns in template f\nolder",
|
||||
"yada6": "1643940766",
|
||||
"yada7": None
|
||||
}
|
||||
]
|
||||
|
||||
self.assertEqual(jc.parsers.asciitable_m.parse(input, quiet=False), expected)
|
||||
|
||||
def test_asciitable_m_markdown(self):
|
||||
"""
|
||||
Test 'asciitable_m' with a markdown table. Should raise a ParseError
|
||||
|
35
tests/test_chage.py
Normal file
35
tests/test_chage.py
Normal file
@ -0,0 +1,35 @@
|
||||
import os
|
||||
import unittest
|
||||
import json
|
||||
import jc.parsers.chage
|
||||
|
||||
THIS_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
|
||||
class MyTests(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
# input
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/chage.out'), 'r', encoding='utf-8') as f:
|
||||
self.centos_7_7_chage = f.read()
|
||||
|
||||
# output
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/chage.json'), 'r', encoding='utf-8') as f:
|
||||
self.centos_7_7_chage_json = json.loads(f.read())
|
||||
|
||||
|
||||
def test_chage_nodata(self):
|
||||
"""
|
||||
Test 'chage' with no data
|
||||
"""
|
||||
self.assertEqual(jc.parsers.chage.parse('', quiet=True), {})
|
||||
|
||||
def test_chage_centos_7_7(self):
|
||||
"""
|
||||
Test 'chage' on Centos 7.7
|
||||
"""
|
||||
self.assertEqual(jc.parsers.chage.parse(self.centos_7_7_chage, quiet=True), self.centos_7_7_chage_json)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
@ -125,6 +125,13 @@ class MyTests(unittest.TestCase):
|
||||
"""
|
||||
self.assertEqual(jc.parsers.df.parse(self.generic_df_long_filesystem, quiet=True), self.generic_df_long_filesystem_json)
|
||||
|
||||
def test_df_centos_7_7_trailing_newline(self):
|
||||
"""
|
||||
Test plain 'df' on Centos 7.7 with a trailing newline
|
||||
"""
|
||||
cmd_output = self.centos_7_7_df + '\n'
|
||||
self.assertEqual(jc.parsers.df.parse(cmd_output, quiet=True), self.centos_7_7_df_json)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
@ -58,6 +58,12 @@ class MyTests(unittest.TestCase):
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/git-log-oneline-shortstat.out'), 'r', encoding='utf-8') as f:
|
||||
self.git_log_oneline_shortstat = f.read()
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/git-log-hash-in-message-fix.out'), 'r', encoding='utf-8') as f:
|
||||
self.git_log_fuller_hash_in_message_fix = f.read()
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/git-log-is-hash-regex-fix.out'), 'r', encoding='utf-8') as f:
|
||||
self.git_log_fuller_is_hash_regex_fix = f.read()
|
||||
|
||||
# output
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/git-log.json'), 'r', encoding='utf-8') as f:
|
||||
self.git_log_json = json.loads(f.read())
|
||||
@ -107,6 +113,12 @@ class MyTests(unittest.TestCase):
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/git-log-oneline-shortstat.json'), 'r', encoding='utf-8') as f:
|
||||
self.git_log_oneline_shortstat_json = json.loads(f.read())
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/git-log-hash-in-message-fix.json'), 'r', encoding='utf-8') as f:
|
||||
self.git_log_fuller_hash_in_message_fix_json = json.loads(f.read())
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/git-log-is-hash-regex-fix.json'), 'r', encoding='utf-8') as f:
|
||||
self.git_log_fuller_is_hash_regex_fix_json = json.loads(f.read())
|
||||
|
||||
|
||||
def test_git_log_nodata(self):
|
||||
"""
|
||||
@ -210,6 +222,20 @@ class MyTests(unittest.TestCase):
|
||||
"""
|
||||
self.assertEqual(jc.parsers.git_log.parse(self.git_log_oneline_shortstat, quiet=True), self.git_log_oneline_shortstat_json)
|
||||
|
||||
def test_git_log_fuller_hash_in_message_fix(self):
|
||||
"""
|
||||
Test 'git_log --format=fuller --stat' fix for when a commit message
|
||||
contains a line that is only a commit hash value.
|
||||
"""
|
||||
self.assertEqual(jc.parsers.git_log.parse(self.git_log_fuller_hash_in_message_fix, quiet=True), self.git_log_fuller_hash_in_message_fix_json)
|
||||
|
||||
def test_git_log_fuller_is_hash_fix(self):
|
||||
"""
|
||||
Test 'git_log --format=fuller --stat' fix for when a commit message
|
||||
contains a line that evaluated as true to an older _is_hash regex
|
||||
"""
|
||||
self.assertEqual(jc.parsers.git_log.parse(self.git_log_fuller_is_hash_regex_fix, quiet=True), self.git_log_fuller_is_hash_regex_fix_json)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
268
tests/test_git_log_s.py
Normal file
268
tests/test_git_log_s.py
Normal file
@ -0,0 +1,268 @@
|
||||
import os
|
||||
import json
|
||||
import unittest
|
||||
import jc.parsers.git_log_s
|
||||
from jc.exceptions import ParseError
|
||||
|
||||
THIS_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
# To create streaming output use:
|
||||
# $ cat git-log.out | jc --git-log-s | jello -c > git-log-streaming.json
|
||||
|
||||
|
||||
class MyTests(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
pass
|
||||
# input
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/git-log.out'), 'r', encoding='utf-8') as f:
|
||||
self.generic_git_log = f.read()
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/git-log-short.out'), 'r', encoding='utf-8') as f:
|
||||
self.generic_git_log_short = f.read()
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/git-log-short-stat.out'), 'r', encoding='utf-8') as f:
|
||||
self.generic_git_log_short_stat = f.read()
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/git-log-short-shortstat.out'), 'r', encoding='utf-8') as f:
|
||||
self.generic_git_log_short_shortstat = f.read()
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/git-log-medium.out'), 'r', encoding='utf-8') as f:
|
||||
self.generic_git_log_medium = f.read()
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/git-log-medium-stat.out'), 'r', encoding='utf-8') as f:
|
||||
self.generic_git_log_medium_stat = f.read()
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/git-log-medium-shortstat.out'), 'r', encoding='utf-8') as f:
|
||||
self.generic_git_log_medium_shortstat = f.read()
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/git-log-full.out'), 'r', encoding='utf-8') as f:
|
||||
self.generic_git_log_full = f.read()
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/git-log-full-stat.out'), 'r', encoding='utf-8') as f:
|
||||
self.generic_git_log_full_stat = f.read()
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/git-log-full-shortstat.out'), 'r', encoding='utf-8') as f:
|
||||
self.generic_git_log_full_shortstat = f.read()
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/git-log-fuller.out'), 'r', encoding='utf-8') as f:
|
||||
self.generic_git_log_fuller = f.read()
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/git-log-fuller-stat.out'), 'r', encoding='utf-8') as f:
|
||||
self.generic_git_log_fuller_stat = f.read()
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/git-log-fuller-shortstat.out'), 'r', encoding='utf-8') as f:
|
||||
self.generic_git_log_fuller_shortstat = f.read()
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/git-log-oneline.out'), 'r', encoding='utf-8') as f:
|
||||
self.generic_git_log_oneline = f.read()
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/git-log-oneline-stat.out'), 'r', encoding='utf-8') as f:
|
||||
self.generic_git_log_oneline_stat = f.read()
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/git-log-oneline-shortstat.out'), 'r', encoding='utf-8') as f:
|
||||
self.generic_git_log_oneline_shortstat = f.read()
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/git-log-hash-in-message-fix.out'), 'r', encoding='utf-8') as f:
|
||||
self.generic_git_log_fuller_hash_in_message_fix = f.read()
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/git-log-is-hash-regex-fix.out'), 'r', encoding='utf-8') as f:
|
||||
self.generic_git_log_fuller_is_hash_regex_fix = f.read()
|
||||
|
||||
# output
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/git-log-streaming.json'), 'r', encoding='utf-8') as f:
|
||||
self.generic_git_log_streaming_json = json.loads(f.read())
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/git-log-short-streaming.json'), 'r', encoding='utf-8') as f:
|
||||
self.generic_git_log_short_streaming_json = json.loads(f.read())
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/git-log-short-stat-streaming.json'), 'r', encoding='utf-8') as f:
|
||||
self.generic_git_log_short_stat_streaming_json = json.loads(f.read())
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/git-log-short-shortstat-streaming.json'), 'r', encoding='utf-8') as f:
|
||||
self.generic_git_log_short_shortstat_streaming_json = json.loads(f.read())
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/git-log-medium-streaming.json'), 'r', encoding='utf-8') as f:
|
||||
self.generic_git_log_medium_streaming_json = json.loads(f.read())
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/git-log-medium-stat-streaming.json'), 'r', encoding='utf-8') as f:
|
||||
self.generic_git_log_medium_stat_streaming_json = json.loads(f.read())
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/git-log-medium-shortstat-streaming.json'), 'r', encoding='utf-8') as f:
|
||||
self.generic_git_log_medium_shortstat_streaming_json = json.loads(f.read())
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/git-log-full-streaming.json'), 'r', encoding='utf-8') as f:
|
||||
self.generic_git_log_full_streaming_json = json.loads(f.read())
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/git-log-full-stat-streaming.json'), 'r', encoding='utf-8') as f:
|
||||
self.generic_git_log_full_stat_streaming_json = json.loads(f.read())
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/git-log-full-shortstat-streaming.json'), 'r', encoding='utf-8') as f:
|
||||
self.generic_git_log_full_shortstat_streaming_json = json.loads(f.read())
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/git-log-fuller-streaming.json'), 'r', encoding='utf-8') as f:
|
||||
self.generic_git_log_fuller_streaming_json = json.loads(f.read())
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/git-log-fuller-stat-streaming.json'), 'r', encoding='utf-8') as f:
|
||||
self.generic_git_log_fuller_stat_streaming_json = json.loads(f.read())
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/git-log-fuller-shortstat-streaming.json'), 'r', encoding='utf-8') as f:
|
||||
self.generic_git_log_fuller_shortstat_streaming_json = json.loads(f.read())
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/git-log-oneline-streaming.json'), 'r', encoding='utf-8') as f:
|
||||
self.generic_git_log_oneline_streaming_json = json.loads(f.read())
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/git-log-oneline-stat-streaming.json'), 'r', encoding='utf-8') as f:
|
||||
self.generic_git_log_oneline_stat_streaming_json = json.loads(f.read())
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/git-log-oneline-shortstat-streaming.json'), 'r', encoding='utf-8') as f:
|
||||
self.generic_git_log_oneline_shortstat_streaming_json = json.loads(f.read())
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/git-log-streaming-ignore-exceptions.json'), 'r', encoding='utf-8') as f:
|
||||
self.generic_git_log_streaming_ignore_exceptions_json = json.loads(f.read())
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/git-log-hash-in-message-fix-streaming.json'), 'r', encoding='utf-8') as f:
|
||||
self.generic_git_log_fuller_hash_in_message_fix_streaming_json = json.loads(f.read())
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/generic/git-log-is-hash-regex-fix-streaming.json'), 'r', encoding='utf-8') as f:
|
||||
self.generic_git_log_fuller_is_hash_regex_fix_streaming_json = json.loads(f.read())
|
||||
|
||||
def test_git_log_s_nodata(self):
|
||||
"""
|
||||
Test 'git_log' with no data
|
||||
"""
|
||||
self.assertEqual(list(jc.parsers.git_log_s.parse([], quiet=True)), [])
|
||||
|
||||
def test_git_log_s_unparsable(self):
|
||||
data = 'unparsable data'
|
||||
g = jc.parsers.git_log_s.parse(data.splitlines(), quiet=True)
|
||||
with self.assertRaises(ParseError):
|
||||
list(g)
|
||||
|
||||
def test_git_log_s_ignore_exceptions_success(self):
|
||||
"""
|
||||
Test 'git log' with -qq (ignore_exceptions) option
|
||||
"""
|
||||
self.assertEqual(list(jc.parsers.git_log_s.parse(self.generic_git_log.splitlines(), quiet=True, ignore_exceptions=True)), self.generic_git_log_streaming_ignore_exceptions_json)
|
||||
|
||||
def test_ping_s_ignore_exceptions_error(self):
|
||||
"""
|
||||
Test 'ping' with -qq (ignore_exceptions) option option and error
|
||||
"""
|
||||
data_in = 'not git log'
|
||||
expected = json.loads('[{"_jc_meta":{"success":false,"error":"ParseError: Not git_log_s data","line":"not git log"}}]')
|
||||
self.assertEqual(list(jc.parsers.git_log_s.parse(data_in.splitlines(), quiet=True, ignore_exceptions=True)), expected)
|
||||
|
||||
def test_git_log_s(self):
|
||||
"""
|
||||
Test 'git_log'
|
||||
"""
|
||||
self.assertEqual(list(jc.parsers.git_log_s.parse(self.generic_git_log.splitlines(), quiet=True)), self.generic_git_log_streaming_json)
|
||||
|
||||
def test_git_log_short_s(self):
|
||||
"""
|
||||
Test 'git_log --format=short'
|
||||
"""
|
||||
self.assertEqual(list(jc.parsers.git_log_s.parse(self.generic_git_log_short.splitlines(), quiet=True)), self.generic_git_log_short_streaming_json)
|
||||
|
||||
def test_git_log_short_stat_s(self):
|
||||
"""
|
||||
Test 'git_log --format=short --stat'
|
||||
"""
|
||||
self.assertEqual(list(jc.parsers.git_log_s.parse(self.generic_git_log_short_stat.splitlines(), quiet=True)), self.generic_git_log_short_stat_streaming_json)
|
||||
|
||||
def test_git_log_short_shortstat_s(self):
|
||||
"""
|
||||
Test 'git_log --format=short --shortstat'
|
||||
"""
|
||||
self.assertEqual(list(jc.parsers.git_log_s.parse(self.generic_git_log_short_shortstat.splitlines(), quiet=True)), self.generic_git_log_short_shortstat_streaming_json)
|
||||
|
||||
def test_git_log_medium_s(self):
|
||||
"""
|
||||
Test 'git_log --format=medium'
|
||||
"""
|
||||
self.assertEqual(list(jc.parsers.git_log_s.parse(self.generic_git_log_medium.splitlines(), quiet=True)), self.generic_git_log_medium_streaming_json)
|
||||
|
||||
def test_git_log_medium_stat_s(self):
|
||||
"""
|
||||
Test 'git_log --format=medium --stat'
|
||||
"""
|
||||
self.assertEqual(list(jc.parsers.git_log_s.parse(self.generic_git_log_medium_stat.splitlines(), quiet=True)), self.generic_git_log_medium_stat_streaming_json)
|
||||
|
||||
def test_git_log_medium_shortstat_s(self):
|
||||
"""
|
||||
Test 'git_log --format=medium --shortstat'
|
||||
"""
|
||||
self.assertEqual(list(jc.parsers.git_log_s.parse(self.generic_git_log_medium_shortstat.splitlines(), quiet=True)), self.generic_git_log_medium_shortstat_streaming_json)
|
||||
|
||||
def test_git_log_full_s(self):
|
||||
"""
|
||||
Test 'git_log --format=full'
|
||||
"""
|
||||
self.assertEqual(list(jc.parsers.git_log_s.parse(self.generic_git_log_full.splitlines(), quiet=True)), self.generic_git_log_full_streaming_json)
|
||||
|
||||
def test_git_log_full_stat_s(self):
|
||||
"""
|
||||
Test 'git_log --format=full --stat'
|
||||
"""
|
||||
self.assertEqual(list(jc.parsers.git_log_s.parse(self.generic_git_log_full_stat.splitlines(), quiet=True)), self.generic_git_log_full_stat_streaming_json)
|
||||
|
||||
def test_git_log_full_shortstat_s(self):
|
||||
"""
|
||||
Test 'git_log --format=full --shortstat'
|
||||
"""
|
||||
self.assertEqual(list(jc.parsers.git_log_s.parse(self.generic_git_log_full_shortstat.splitlines(), quiet=True)), self.generic_git_log_full_shortstat_streaming_json)
|
||||
|
||||
def test_git_log_fuller_s(self):
|
||||
"""
|
||||
Test 'git_log --format=fuller'
|
||||
"""
|
||||
self.assertEqual(list(jc.parsers.git_log_s.parse(self.generic_git_log_fuller.splitlines(), quiet=True)), self.generic_git_log_fuller_streaming_json)
|
||||
|
||||
def test_git_log_fulerl_stat_s(self):
|
||||
"""
|
||||
Test 'git_log --format=fuller --stat'
|
||||
"""
|
||||
self.assertEqual(list(jc.parsers.git_log_s.parse(self.generic_git_log_fuller_stat.splitlines(), quiet=True)), self.generic_git_log_fuller_stat_streaming_json)
|
||||
|
||||
def test_git_log_fuller_shortstat_s(self):
|
||||
"""
|
||||
Test 'git_log --format=fuller --shortstat'
|
||||
"""
|
||||
self.assertEqual(list(jc.parsers.git_log_s.parse(self.generic_git_log_fuller_shortstat.splitlines(), quiet=True)), self.generic_git_log_fuller_shortstat_streaming_json)
|
||||
|
||||
def test_git_log_oneline_s(self):
|
||||
"""
|
||||
Test 'git_log --format=oneline'
|
||||
"""
|
||||
self.assertEqual(list(jc.parsers.git_log_s.parse(self.generic_git_log_oneline.splitlines(), quiet=True)), self.generic_git_log_oneline_streaming_json)
|
||||
|
||||
def test_git_log_oneline_stat_s(self):
|
||||
"""
|
||||
Test 'git_log --format=oneline --stat'
|
||||
"""
|
||||
self.assertEqual(list(jc.parsers.git_log_s.parse(self.generic_git_log_oneline_stat.splitlines(), quiet=True)), self.generic_git_log_oneline_stat_streaming_json)
|
||||
|
||||
def test_git_log_oneline_shortstat_s(self):
|
||||
"""
|
||||
Test 'git_log --format=oneline --shortstat'
|
||||
"""
|
||||
self.assertEqual(list(jc.parsers.git_log_s.parse(self.generic_git_log_oneline_shortstat.splitlines(), quiet=True)), self.generic_git_log_oneline_shortstat_streaming_json)
|
||||
|
||||
def test_git_log_fuller_hash_in_message_fix(self):
|
||||
"""
|
||||
Test 'git_log --format=fuller --stat' fix for when a commit message
|
||||
contains a line that is only a commit hash value.
|
||||
"""
|
||||
self.assertEqual(list(jc.parsers.git_log_s.parse(self.generic_git_log_fuller_hash_in_message_fix.splitlines(), quiet=True)), self.generic_git_log_fuller_hash_in_message_fix_streaming_json)
|
||||
|
||||
def test_git_log_fuller_is_hash_fix(self):
|
||||
"""
|
||||
Test 'git_log --format=fuller --stat' fix for when a commit message
|
||||
contains a line that evaluated as true to an older _is_hash regex
|
||||
"""
|
||||
self.assertEqual(list(jc.parsers.git_log_s.parse(self.generic_git_log_fuller_is_hash_regex_fix.splitlines(), quiet=True)), self.generic_git_log_fuller_is_hash_regex_fix_streaming_json)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
Reference in New Issue
Block a user