From caaeaf0d67cf44f8d2651cc53a7528d3ef0c74d3 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Mon, 29 Nov 2021 16:29:23 -0800 Subject: [PATCH] add 'str' type check on input --- jc/parsers/acpi.py | 6 +++--- jc/parsers/airport.py | 6 +++--- jc/parsers/airport_s.py | 6 +++--- jc/parsers/arp.py | 6 +++--- jc/parsers/blkid.py | 6 +++--- jc/parsers/cksum.py | 6 +++--- jc/parsers/crontab.py | 6 +++--- jc/parsers/crontab_u.py | 6 +++--- jc/parsers/csv.py | 6 +++--- jc/parsers/date.py | 6 +++--- jc/parsers/df.py | 6 +++--- jc/parsers/dig.py | 6 +++--- jc/parsers/dir.py | 6 +++--- jc/parsers/dmidecode.py | 6 +++--- jc/parsers/dpkg_l.py | 6 +++--- jc/parsers/du.py | 6 +++--- jc/parsers/env.py | 6 +++--- jc/parsers/file.py | 6 +++--- jc/parsers/finger.py | 6 +++--- jc/parsers/foo.py | 4 ++-- jc/parsers/free.py | 6 +++--- jc/parsers/fstab.py | 6 +++--- jc/parsers/group.py | 6 +++--- jc/parsers/gshadow.py | 6 +++--- jc/parsers/hash.py | 6 +++--- jc/parsers/hashsum.py | 6 +++--- jc/parsers/hciconfig.py | 6 +++--- jc/parsers/history.py | 6 +++--- jc/parsers/hosts.py | 6 +++--- jc/parsers/id.py | 6 +++--- jc/parsers/ifconfig.py | 6 +++--- jc/parsers/ini.py | 6 +++--- jc/parsers/iptables.py | 6 +++--- jc/parsers/iw_scan.py | 6 +++--- jc/parsers/jobs.py | 6 +++--- jc/parsers/last.py | 6 +++--- jc/parsers/ls.py | 6 +++--- jc/parsers/lsblk.py | 6 +++--- jc/parsers/lsmod.py | 6 +++--- jc/parsers/lsof.py | 6 +++--- jc/parsers/lsusb.py | 6 +++--- jc/parsers/mount.py | 6 +++--- jc/parsers/netstat.py | 6 +++--- jc/parsers/ntpq.py | 6 +++--- jc/parsers/passwd.py | 6 +++--- jc/parsers/ping.py | 6 +++--- jc/parsers/pip_list.py | 6 +++--- jc/parsers/pip_show.py | 6 +++--- jc/parsers/ps.py | 6 +++--- jc/parsers/route.py | 6 +++--- jc/parsers/rpm_qi.py | 6 +++--- jc/parsers/sfdisk.py | 6 +++--- jc/parsers/shadow.py | 6 +++--- jc/parsers/ss.py | 6 +++--- jc/parsers/stat.py | 6 +++--- jc/parsers/sysctl.py | 6 +++--- jc/parsers/systemctl.py | 6 +++--- jc/parsers/systemctl_lj.py | 6 +++--- jc/parsers/systemctl_ls.py | 6 +++--- jc/parsers/systemctl_luf.py | 6 +++--- jc/parsers/systeminfo.py | 6 +++--- jc/parsers/time.py | 6 +++--- jc/parsers/timedatectl.py | 6 +++--- jc/parsers/tracepath.py | 6 +++--- jc/parsers/traceroute.py | 6 +++--- jc/parsers/ufw.py | 6 +++--- jc/parsers/ufw_appinfo.py | 6 +++--- jc/parsers/uname.py | 6 +++--- jc/parsers/upower.py | 6 +++--- jc/parsers/uptime.py | 6 +++--- jc/parsers/vmstat.py | 6 +++--- jc/parsers/w.py | 6 +++--- jc/parsers/wc.py | 6 +++--- jc/parsers/who.py | 6 +++--- jc/parsers/xml.py | 6 +++--- jc/parsers/yaml.py | 6 +++--- 76 files changed, 227 insertions(+), 227 deletions(-) diff --git a/jc/parsers/acpi.py b/jc/parsers/acpi.py index 2125c38e..76e1e620 100644 --- a/jc/parsers/acpi.py +++ b/jc/parsers/acpi.py @@ -227,7 +227,7 @@ import jc.utils class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.2' + version = '1.3' description = '`acpi` command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -302,8 +302,8 @@ def parse(data, raw=False, quiet=False): List of Dictionaries. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") raw_output = [] output_line = {} diff --git a/jc/parsers/airport.py b/jc/parsers/airport.py index f541316d..c4830d07 100644 --- a/jc/parsers/airport.py +++ b/jc/parsers/airport.py @@ -80,7 +80,7 @@ import jc.utils class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.3' + version = '1.4' description = '`airport -I` command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -130,8 +130,8 @@ def parse(data, raw=False, quiet=False): Dictionary. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") raw_output = {} diff --git a/jc/parsers/airport_s.py b/jc/parsers/airport_s.py index 28ccc380..5c9cb96b 100644 --- a/jc/parsers/airport_s.py +++ b/jc/parsers/airport_s.py @@ -109,7 +109,7 @@ import jc.parsers.universal class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.4' + version = '1.5' description = '`airport -s` command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -166,8 +166,8 @@ def parse(data, raw=False, quiet=False): List of Dictionaries. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") raw_output = [] cleandata = list(filter(None, data.splitlines())) diff --git a/jc/parsers/arp.py b/jc/parsers/arp.py index fe45ea2b..1327fdde 100644 --- a/jc/parsers/arp.py +++ b/jc/parsers/arp.py @@ -118,7 +118,7 @@ import jc.parsers.universal class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.7' + version = '1.8' description = '`arp` command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -171,8 +171,8 @@ def parse(data, raw=False, quiet=False): List of Dictionaries. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") raw_output = [] cleandata = list(filter(None, data.splitlines())) diff --git a/jc/parsers/blkid.py b/jc/parsers/blkid.py index 6c4d7ab1..ab148137 100644 --- a/jc/parsers/blkid.py +++ b/jc/parsers/blkid.py @@ -121,7 +121,7 @@ import jc.utils class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.4' + version = '1.5' description = '`blkid` command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -176,8 +176,8 @@ def parse(data, raw=False, quiet=False): List of Dictionaries. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") raw_output = [] diff --git a/jc/parsers/cksum.py b/jc/parsers/cksum.py index 541abb82..66bc65e4 100644 --- a/jc/parsers/cksum.py +++ b/jc/parsers/cksum.py @@ -54,7 +54,7 @@ import jc.utils class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.2' + version = '1.3' description = '`cksum` and `sum` command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -103,8 +103,8 @@ def parse(data, raw=False, quiet=False): List of Dictionaries. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") raw_output = [] diff --git a/jc/parsers/crontab.py b/jc/parsers/crontab.py index ea71ce08..f8276c9b 100644 --- a/jc/parsers/crontab.py +++ b/jc/parsers/crontab.py @@ -171,7 +171,7 @@ import jc.parsers.universal class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.5' + version = '1.6' description = '`crontab` command and file parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -225,8 +225,8 @@ def parse(data, raw=False, quiet=False): Dictionary. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") raw_output = {} cleandata = data.splitlines() diff --git a/jc/parsers/crontab_u.py b/jc/parsers/crontab_u.py index d8697e05..097f2cb2 100644 --- a/jc/parsers/crontab_u.py +++ b/jc/parsers/crontab_u.py @@ -167,7 +167,7 @@ import jc.parsers.universal class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.6' + version = '1.7' description = '`crontab` file parser with user support' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -220,8 +220,8 @@ def parse(data, raw=False, quiet=False): Dictionary. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") raw_output = {} cleandata = data.splitlines() diff --git a/jc/parsers/csv.py b/jc/parsers/csv.py index 1f87ff9f..68ecdcbe 100644 --- a/jc/parsers/csv.py +++ b/jc/parsers/csv.py @@ -75,7 +75,7 @@ import csv class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.2' + version = '1.3' description = 'CSV file parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -119,8 +119,8 @@ def parse(data, raw=False, quiet=False): List of Dictionaries. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") raw_output = [] cleandata = data.splitlines() diff --git a/jc/parsers/date.py b/jc/parsers/date.py index 3dd2ae1c..0db77cdc 100644 --- a/jc/parsers/date.py +++ b/jc/parsers/date.py @@ -72,7 +72,7 @@ import jc.utils class info(): """Provides parser metadata (version, author, etc.)""" - version = '2.1' + version = '2.2' description = '`date` command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -115,8 +115,8 @@ def parse(data, raw=False, quiet=False): Dictionary. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") raw_output = {} diff --git a/jc/parsers/df.py b/jc/parsers/df.py index 19cca3d8..64972527 100644 --- a/jc/parsers/df.py +++ b/jc/parsers/df.py @@ -99,7 +99,7 @@ import jc.parsers.universal class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.8' + version = '1.9' description = '`df` command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -204,8 +204,8 @@ def parse(data, raw=False, quiet=False): List of Dictionaries. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") cleandata = data.splitlines() fix_data = [] diff --git a/jc/parsers/dig.py b/jc/parsers/dig.py index 5c485a7a..3d7120bc 100644 --- a/jc/parsers/dig.py +++ b/jc/parsers/dig.py @@ -316,7 +316,7 @@ import jc.utils class info(): """Provides parser metadata (version, author, etc.)""" - version = '2.1' + version = '2.2' description = '`dig` command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -529,8 +529,8 @@ def parse(data, raw=False, quiet=False): List of Dictionaries. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") raw_output = [] cleandata = data.splitlines() diff --git a/jc/parsers/dir.py b/jc/parsers/dir.py index ae1d2639..a433ae84 100644 --- a/jc/parsers/dir.py +++ b/jc/parsers/dir.py @@ -119,7 +119,7 @@ import jc.utils class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.3' + version = '1.4' description = '`dir` command parser' author = 'Rasheed Elsaleh' author_email = 'rasheed@rebelliondefense.com' @@ -173,8 +173,8 @@ def parse(data, raw=False, quiet=False): List of Dictionaries. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") raw_output = [] diff --git a/jc/parsers/dmidecode.py b/jc/parsers/dmidecode.py index b03dfff7..453a0edf 100644 --- a/jc/parsers/dmidecode.py +++ b/jc/parsers/dmidecode.py @@ -125,7 +125,7 @@ import jc.utils class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.3' + version = '1.4' description = '`dmidecode` command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -177,8 +177,8 @@ def parse(data, raw=False, quiet=False): List of Dictionaries. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") item_header = False item_values = False diff --git a/jc/parsers/dpkg_l.py b/jc/parsers/dpkg_l.py index f39e7cb5..37b2f6d6 100644 --- a/jc/parsers/dpkg_l.py +++ b/jc/parsers/dpkg_l.py @@ -131,7 +131,7 @@ import jc.parsers.universal class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.1' + version = '1.2' description = '`dpkg -l` command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -217,8 +217,8 @@ def parse(data, raw=False, quiet=False): List of Dictionaries. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") working_list = [] raw_output = [] diff --git a/jc/parsers/du.py b/jc/parsers/du.py index 5774f615..fac3b902 100644 --- a/jc/parsers/du.py +++ b/jc/parsers/du.py @@ -88,7 +88,7 @@ import jc.parsers.universal class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.4' + version = '1.5' description = '`du` command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -137,8 +137,8 @@ def parse(data, raw=False, quiet=False): List of Dictionaries. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") raw_output = [] diff --git a/jc/parsers/env.py b/jc/parsers/env.py index 072f91ae..bdf62e97 100644 --- a/jc/parsers/env.py +++ b/jc/parsers/env.py @@ -69,7 +69,7 @@ import jc.utils class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.3' + version = '1.4' description = '`env` command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -121,8 +121,8 @@ def parse(data, raw=False, quiet=False): Dictionary of raw structured data or List of Dictionaries of processed structured data """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") raw_output = {} diff --git a/jc/parsers/file.py b/jc/parsers/file.py index 2af927c7..4a7f782e 100644 --- a/jc/parsers/file.py +++ b/jc/parsers/file.py @@ -63,7 +63,7 @@ import jc.parsers.universal class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.4' + version = '1.5' description = '`file` command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -106,8 +106,8 @@ def parse(data, raw=False, quiet=False): List of Dictionaries. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") raw_output = [] diff --git a/jc/parsers/finger.py b/jc/parsers/finger.py index 1bd2b270..66b5fccc 100644 --- a/jc/parsers/finger.py +++ b/jc/parsers/finger.py @@ -92,7 +92,7 @@ import jc.parsers.universal class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.1' + version = '1.2' description = '`finger` command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -168,8 +168,8 @@ def parse(data, raw=False, quiet=False): List of Dictionaries. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") raw_output = [] diff --git a/jc/parsers/foo.py b/jc/parsers/foo.py index ee5cf395..3520c74e 100644 --- a/jc/parsers/foo.py +++ b/jc/parsers/foo.py @@ -86,8 +86,8 @@ def parse(data, raw=False, quiet=False): List of Dictionaries. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") raw_output = [] diff --git a/jc/parsers/free.py b/jc/parsers/free.py index b1d4db9d..6e1ab404 100644 --- a/jc/parsers/free.py +++ b/jc/parsers/free.py @@ -73,7 +73,7 @@ import jc.parsers.universal class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.4' + version = '1.5' description = '`free` command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -122,8 +122,8 @@ def parse(data, raw=False, quiet=False): List of Dictionaries. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") cleandata = data.splitlines() raw_output = [] diff --git a/jc/parsers/fstab.py b/jc/parsers/fstab.py index d7522c75..f1ce977b 100644 --- a/jc/parsers/fstab.py +++ b/jc/parsers/fstab.py @@ -85,7 +85,7 @@ import jc.utils class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.5' + version = '1.6' description = '`/etc/fstab` file parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -132,8 +132,8 @@ def parse(data, raw=False, quiet=False): List of Dictionaries. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") raw_output = [] cleandata = data.splitlines() diff --git a/jc/parsers/group.py b/jc/parsers/group.py index fe554df9..b38360ea 100644 --- a/jc/parsers/group.py +++ b/jc/parsers/group.py @@ -109,7 +109,7 @@ import jc.utils class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.3' + version = '1.4' description = '`/etc/group` file parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -160,8 +160,8 @@ def parse(data, raw=False, quiet=False): List of Dictionaries. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") raw_output = [] cleandata = data.splitlines() diff --git a/jc/parsers/gshadow.py b/jc/parsers/gshadow.py index 4f3c01eb..a4eeff68 100644 --- a/jc/parsers/gshadow.py +++ b/jc/parsers/gshadow.py @@ -77,7 +77,7 @@ import jc.utils class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.2' + version = '1.3' description = '`/etc/gshadow` file parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -126,8 +126,8 @@ def parse(data, raw=False, quiet=False): List of Dictionaries. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") raw_output = [] cleandata = data.splitlines() diff --git a/jc/parsers/hash.py b/jc/parsers/hash.py index 2fd7d0d4..a753776a 100644 --- a/jc/parsers/hash.py +++ b/jc/parsers/hash.py @@ -38,7 +38,7 @@ import jc.parsers.universal class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.2' + version = '1.3' description = '`hash` command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -85,8 +85,8 @@ def parse(data, raw=False, quiet=False): List of Dictionaries. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") cleandata = data.splitlines() raw_output = [] diff --git a/jc/parsers/hashsum.py b/jc/parsers/hashsum.py index 87d6fb21..ac29d8da 100644 --- a/jc/parsers/hashsum.py +++ b/jc/parsers/hashsum.py @@ -68,7 +68,7 @@ import jc.utils class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.1' + version = '1.2' description = 'hashsum command parser (`md5sum`, `shasum`, etc.)' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -113,8 +113,8 @@ def parse(data, raw=False, quiet=False): List of Dictionaries. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") raw_output = [] diff --git a/jc/parsers/hciconfig.py b/jc/parsers/hciconfig.py index 70d247fe..c48806fe 100644 --- a/jc/parsers/hciconfig.py +++ b/jc/parsers/hciconfig.py @@ -317,7 +317,7 @@ import jc.utils class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.2' + version = '1.3' description = '`hciconfig` command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -372,8 +372,8 @@ def parse(data, raw=False, quiet=False): List of Dictionaries. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") raw_output = [] device_object = {} diff --git a/jc/parsers/history.py b/jc/parsers/history.py index 88016928..7401e188 100644 --- a/jc/parsers/history.py +++ b/jc/parsers/history.py @@ -59,7 +59,7 @@ import jc.utils class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.5' + version = '1.6' description = '`history` command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -109,8 +109,8 @@ def parse(data, raw=False, quiet=False): Dictionary of raw structured data or List of Dictionaries of processed structured data """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") raw_output = {} diff --git a/jc/parsers/hosts.py b/jc/parsers/hosts.py index c1c397b2..f64ed7e8 100644 --- a/jc/parsers/hosts.py +++ b/jc/parsers/hosts.py @@ -74,7 +74,7 @@ import jc.utils class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.3' + version = '1.4' description = '`/etc/hosts` file parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -117,8 +117,8 @@ def parse(data, raw=False, quiet=False): List of Dictionaries. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") raw_output = [] diff --git a/jc/parsers/id.py b/jc/parsers/id.py index c3f54e44..4a16ad41 100644 --- a/jc/parsers/id.py +++ b/jc/parsers/id.py @@ -105,7 +105,7 @@ import jc.utils class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.3' + version = '1.4' description = '`id` command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -161,8 +161,8 @@ def parse(data, raw=False, quiet=False): Dictionary. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") raw_output = {} diff --git a/jc/parsers/ifconfig.py b/jc/parsers/ifconfig.py index bd73cfde..d3b37384 100644 --- a/jc/parsers/ifconfig.py +++ b/jc/parsers/ifconfig.py @@ -188,7 +188,7 @@ import jc.utils class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.10' + version = '1.11' description = '`ifconfig` command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -474,8 +474,8 @@ def parse(data, raw=False, quiet=False): List of Dictionaries. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") raw_output = [] diff --git a/jc/parsers/ini.py b/jc/parsers/ini.py index 2c4d12eb..0f9a4a0a 100644 --- a/jc/parsers/ini.py +++ b/jc/parsers/ini.py @@ -66,7 +66,7 @@ import configparser class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.4' + version = '1.5' description = 'INI file parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -125,8 +125,8 @@ def parse(data, raw=False, quiet=False): Dictionary representing the ini file """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") raw_output = {} diff --git a/jc/parsers/iptables.py b/jc/parsers/iptables.py index e59e6fa7..9575ed41 100644 --- a/jc/parsers/iptables.py +++ b/jc/parsers/iptables.py @@ -163,7 +163,7 @@ import jc.utils class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.6' + version = '1.7' description = '`iptables` command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -240,8 +240,8 @@ def parse(data, raw=False, quiet=False): List of Dictionaries. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") raw_output = [] chain = {} diff --git a/jc/parsers/iw_scan.py b/jc/parsers/iw_scan.py index a16513f0..a0d20f9a 100644 --- a/jc/parsers/iw_scan.py +++ b/jc/parsers/iw_scan.py @@ -121,7 +121,7 @@ import jc.utils class info(): """Provides parser metadata (version, author, etc.)""" - version = '0.6' + version = '0.7' description = '`iw dev [device] scan` command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -293,8 +293,8 @@ def parse(data, raw=False, quiet=False): List of Dictionaries. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") raw_output = [] section = {} diff --git a/jc/parsers/jobs.py b/jc/parsers/jobs.py index a920d7bb..1410a7c4 100644 --- a/jc/parsers/jobs.py +++ b/jc/parsers/jobs.py @@ -93,7 +93,7 @@ import jc.utils class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.4' + version = '1.5' description = '`jobs` command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -141,8 +141,8 @@ def parse(data, raw=False, quiet=False): List of Dictionaries. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") raw_output = [] diff --git a/jc/parsers/last.py b/jc/parsers/last.py index 84969db2..f54cbf18 100644 --- a/jc/parsers/last.py +++ b/jc/parsers/last.py @@ -104,7 +104,7 @@ import jc.utils class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.7' + version = '1.8' description = '`last` and `lastb` command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -185,8 +185,8 @@ def parse(data, raw=False, quiet=False): List of Dictionaries. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") raw_output = [] diff --git a/jc/parsers/ls.py b/jc/parsers/ls.py index d9f385d4..17b7a1bb 100644 --- a/jc/parsers/ls.py +++ b/jc/parsers/ls.py @@ -107,7 +107,7 @@ import jc.utils class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.9' + version = '1.10' description = '`ls` command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -162,8 +162,8 @@ def parse(data, raw=False, quiet=False): List of Dictionaries. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") raw_output = [] warned = False diff --git a/jc/parsers/lsblk.py b/jc/parsers/lsblk.py index b835d1fd..39d12efe 100644 --- a/jc/parsers/lsblk.py +++ b/jc/parsers/lsblk.py @@ -269,7 +269,7 @@ import jc.parsers.universal class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.7' + version = '1.8' description = '`lsblk` command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -321,8 +321,8 @@ def parse(data, raw=False, quiet=False): List of Dictionaries. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") # Clear any blank lines cleandata = list(filter(None, data.splitlines())) diff --git a/jc/parsers/lsmod.py b/jc/parsers/lsmod.py index 07b07cdd..7d89cc5e 100644 --- a/jc/parsers/lsmod.py +++ b/jc/parsers/lsmod.py @@ -126,7 +126,7 @@ import jc.parsers.universal class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.5' + version = '1.6' description = '`lsmod` command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -174,8 +174,8 @@ def parse(data, raw=False, quiet=False): List of Dictionaries. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") cleandata = data.splitlines() raw_output = [] diff --git a/jc/parsers/lsof.py b/jc/parsers/lsof.py index 8115763d..02a3fdca 100644 --- a/jc/parsers/lsof.py +++ b/jc/parsers/lsof.py @@ -120,7 +120,7 @@ import jc.parsers.universal class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.4' + version = '1.5' description = '`lsof` command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -168,8 +168,8 @@ def parse(data, raw=False, quiet=False): List of Dictionaries. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") raw_output = [] diff --git a/jc/parsers/lsusb.py b/jc/parsers/lsusb.py index e2fb6a31..a71caab6 100644 --- a/jc/parsers/lsusb.py +++ b/jc/parsers/lsusb.py @@ -262,7 +262,7 @@ from jc.exceptions import ParseError class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.0' + version = '1.1' description = '`lsusb` command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -815,8 +815,8 @@ def parse(data, raw=False, quiet=False): List of Dictionaries. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") lsusb = _LsUsb() diff --git a/jc/parsers/mount.py b/jc/parsers/mount.py index 1fa47038..7f26082a 100644 --- a/jc/parsers/mount.py +++ b/jc/parsers/mount.py @@ -75,7 +75,7 @@ import jc.utils class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.6' + version = '1.7' description = '`mount` command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -163,8 +163,8 @@ def parse(data, raw=False, quiet=False): List of Dictionaries. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") # Clear any blank lines cleandata = list(filter(None, data.splitlines())) diff --git a/jc/parsers/netstat.py b/jc/parsers/netstat.py index a5db5120..5267ddd8 100644 --- a/jc/parsers/netstat.py +++ b/jc/parsers/netstat.py @@ -354,7 +354,7 @@ import jc.utils class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.11' + version = '1.12' description = '`netstat` command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -424,8 +424,8 @@ def parse(data, raw=False, quiet=False): List of Dictionaries. Raw or processed structured data. """ import jc.utils - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") cleandata = list(filter(None, data.splitlines())) raw_output = [] diff --git a/jc/parsers/ntpq.py b/jc/parsers/ntpq.py index 4d2a8aef..82ed9797 100644 --- a/jc/parsers/ntpq.py +++ b/jc/parsers/ntpq.py @@ -207,7 +207,7 @@ import jc.parsers.universal class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.5' + version = '1.6' description = '`ntpq -p` command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -264,8 +264,8 @@ def parse(data, raw=False, quiet=False): List of Dictionaries. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") cleandata = data.splitlines() raw_output = [] diff --git a/jc/parsers/passwd.py b/jc/parsers/passwd.py index acb5d616..fa04c456 100644 --- a/jc/parsers/passwd.py +++ b/jc/parsers/passwd.py @@ -94,7 +94,7 @@ import jc.utils class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.3' + version = '1.4' description = '`/etc/passwd` file parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -142,8 +142,8 @@ def parse(data, raw=False, quiet=False): List of Dictionaries. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") raw_output = [] diff --git a/jc/parsers/ping.py b/jc/parsers/ping.py index c4600aec..06129d8a 100644 --- a/jc/parsers/ping.py +++ b/jc/parsers/ping.py @@ -158,7 +158,7 @@ import jc.utils class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.6' + version = '1.7' description = '`ping` and `ping6` command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -616,8 +616,8 @@ def parse(data, raw=False, quiet=False): Dictionary. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") raw_output = {} diff --git a/jc/parsers/pip_list.py b/jc/parsers/pip_list.py index eafcf176..80d76f8a 100644 --- a/jc/parsers/pip_list.py +++ b/jc/parsers/pip_list.py @@ -48,7 +48,7 @@ import jc.parsers.universal class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.4' + version = '1.5' description = '`pip list` command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -91,8 +91,8 @@ def parse(data, raw=False, quiet=False): List of Dictionaries. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") raw_output = [] diff --git a/jc/parsers/pip_show.py b/jc/parsers/pip_show.py index 023730c5..14c5ec16 100644 --- a/jc/parsers/pip_show.py +++ b/jc/parsers/pip_show.py @@ -65,7 +65,7 @@ import jc.utils class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.2' + version = '1.3' description = '`pip show` command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -108,8 +108,8 @@ def parse(data, raw=False, quiet=False): List of Dictionaries. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") raw_output = [] package = {} diff --git a/jc/parsers/ps.py b/jc/parsers/ps.py index bf8e4749..7fc067ad 100644 --- a/jc/parsers/ps.py +++ b/jc/parsers/ps.py @@ -207,7 +207,7 @@ import jc.parsers.universal class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.5' + version = '1.6' description = '`ps` command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -276,8 +276,8 @@ def parse(data, raw=False, quiet=False): List of Dictionaries. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") cleandata = data.splitlines() raw_output = [] diff --git a/jc/parsers/route.py b/jc/parsers/route.py index a3516e77..118e1fb0 100644 --- a/jc/parsers/route.py +++ b/jc/parsers/route.py @@ -109,7 +109,7 @@ import jc.parsers.universal class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.6' + version = '1.7' description = '`route` command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -180,8 +180,8 @@ def parse(data, raw=False, quiet=False): List of Dictionaries. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") cleandata = data.splitlines()[1:] diff --git a/jc/parsers/rpm_qi.py b/jc/parsers/rpm_qi.py index e63f63a0..49729c8e 100644 --- a/jc/parsers/rpm_qi.py +++ b/jc/parsers/rpm_qi.py @@ -156,7 +156,7 @@ import jc.utils class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.3' + version = '1.4' description = '`rpm -qi` command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -216,8 +216,8 @@ def parse(data, raw=False, quiet=False): List of Dictionaries. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") raw_output = [] entry_obj = {} diff --git a/jc/parsers/sfdisk.py b/jc/parsers/sfdisk.py index 91f7041a..28b9f512 100644 --- a/jc/parsers/sfdisk.py +++ b/jc/parsers/sfdisk.py @@ -201,7 +201,7 @@ import jc.parsers.universal class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.1' + version = '1.2' description = '`sfdisk` command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -265,8 +265,8 @@ def parse(data, raw=False, quiet=False): List of Dictionaries. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") raw_output = [] item = {} diff --git a/jc/parsers/shadow.py b/jc/parsers/shadow.py index ebaae347..9bd4fdf4 100644 --- a/jc/parsers/shadow.py +++ b/jc/parsers/shadow.py @@ -101,7 +101,7 @@ import jc.utils class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.3' + version = '1.4' description = '`/etc/shadow` file parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -149,8 +149,8 @@ def parse(data, raw=False, quiet=False): List of Dictionaries. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") raw_output = [] diff --git a/jc/parsers/ss.py b/jc/parsers/ss.py index 62d3fc2c..730f3b30 100644 --- a/jc/parsers/ss.py +++ b/jc/parsers/ss.py @@ -279,7 +279,7 @@ import jc.utils class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.4' + version = '1.5' description = '`ss` command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -337,8 +337,8 @@ def parse(data, raw=False, quiet=False): List of Dictionaries. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") contains_colon = ['nl', 'p_raw', 'raw', 'udp', 'tcp', 'v_str', 'icmp6'] raw_output = [] diff --git a/jc/parsers/stat.py b/jc/parsers/stat.py index 6ed8e6cc..6837f79b 100644 --- a/jc/parsers/stat.py +++ b/jc/parsers/stat.py @@ -169,7 +169,7 @@ import jc.utils class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.9' + version = '1.10' description = '`stat` command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -229,8 +229,8 @@ def parse(data, raw=False, quiet=False): List of Dictionaries. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") raw_output = [] diff --git a/jc/parsers/sysctl.py b/jc/parsers/sysctl.py index e29e3322..73352d27 100644 --- a/jc/parsers/sysctl.py +++ b/jc/parsers/sysctl.py @@ -54,7 +54,7 @@ import jc.utils class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.1' + version = '1.2' description = '`sysctl` command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -105,8 +105,8 @@ def parse(data, raw=False, quiet=False): Dictionary. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") raw_output = {} diff --git a/jc/parsers/systemctl.py b/jc/parsers/systemctl.py index 1a399296..613f2a43 100644 --- a/jc/parsers/systemctl.py +++ b/jc/parsers/systemctl.py @@ -58,7 +58,7 @@ import jc.utils class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.4' + version = '1.5' description = '`systemctl` command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -101,8 +101,8 @@ def parse(data, raw=False, quiet=False): List of Dictionaries. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") # Clear any blank lines linedata = list(filter(None, data.splitlines())) diff --git a/jc/parsers/systemctl_lj.py b/jc/parsers/systemctl_lj.py index ee0a701d..73bc0959 100644 --- a/jc/parsers/systemctl_lj.py +++ b/jc/parsers/systemctl_lj.py @@ -75,7 +75,7 @@ import jc.utils class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.5' + version = '1.6' description = '`systemctl list-jobs` command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -123,8 +123,8 @@ def parse(data, raw=False, quiet=False): List of Dictionaries. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") # Clear any blank lines linedata = list(filter(None, data.splitlines())) diff --git a/jc/parsers/systemctl_ls.py b/jc/parsers/systemctl_ls.py index de876419..18a52ee1 100644 --- a/jc/parsers/systemctl_ls.py +++ b/jc/parsers/systemctl_ls.py @@ -50,7 +50,7 @@ import jc.utils class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.4' + version = '1.5' description = '`systemctl list-sockets` command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -93,8 +93,8 @@ def parse(data, raw=False, quiet=False): List of Dictionaries. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") # Clear any blank lines linedata = list(filter(None, data.splitlines())) diff --git a/jc/parsers/systemctl_luf.py b/jc/parsers/systemctl_luf.py index 032df43d..6556a178 100644 --- a/jc/parsers/systemctl_luf.py +++ b/jc/parsers/systemctl_luf.py @@ -46,7 +46,7 @@ import jc.utils class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.4' + version = '1.5' description = '`systemctl list-unit-files` command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -89,8 +89,8 @@ def parse(data, raw=False, quiet=False): List of Dictionaries. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") # Clear any blank lines linedata = list(filter(None, data.splitlines())) diff --git a/jc/parsers/systeminfo.py b/jc/parsers/systeminfo.py index c8f6cc9e..ca95c0c2 100644 --- a/jc/parsers/systeminfo.py +++ b/jc/parsers/systeminfo.py @@ -205,7 +205,7 @@ import jc.utils class info: """Provides parser metadata (version, author, etc.)""" - version = "1.0" + version = "1.1" description = "`systeminfo` command parser" author = "Jon Smith" author_email = "jon@rebelliondefense.com" @@ -303,8 +303,8 @@ def parse(data, raw=False, quiet=False): List of Dictionaries. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") delim = ":" # k/v delimiter raw_data = {} # intermediary output diff --git a/jc/parsers/time.py b/jc/parsers/time.py index 99511e33..05d1f835 100644 --- a/jc/parsers/time.py +++ b/jc/parsers/time.py @@ -123,7 +123,7 @@ import jc.utils class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.2' + version = '1.3' description = '`/usr/bin/time` command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -198,8 +198,8 @@ def parse(data, raw=False, quiet=False): Dictionary. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") raw_output = {} diff --git a/jc/parsers/timedatectl.py b/jc/parsers/timedatectl.py index b1f99845..b585e855 100644 --- a/jc/parsers/timedatectl.py +++ b/jc/parsers/timedatectl.py @@ -63,7 +63,7 @@ import jc.utils class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.4' + version = '1.5' description = '`timedatectl status` command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -116,8 +116,8 @@ def parse(data, raw=False, quiet=False): Dictionary. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") raw_output = {} diff --git a/jc/parsers/tracepath.py b/jc/parsers/tracepath.py index 24b226a3..748cf9ce 100644 --- a/jc/parsers/tracepath.py +++ b/jc/parsers/tracepath.py @@ -132,7 +132,7 @@ import jc.utils class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.2' + version = '1.3' description = '`tracepath` and `tracepath6` command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -192,8 +192,8 @@ def parse(data, raw=False, quiet=False): Dictionary. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") RE_TTL_HOST = re.compile(r'^\s?(?P\d+)(?P\??):\s+(?P(?:no reply|\S+))') # groups: ttl, ttl_guess, host RE_PMTU = re.compile(r'\spmtu\s(?P[\d]+)') # group: pmtu diff --git a/jc/parsers/traceroute.py b/jc/parsers/traceroute.py index 740a06a6..3094dce9 100644 --- a/jc/parsers/traceroute.py +++ b/jc/parsers/traceroute.py @@ -119,7 +119,7 @@ import jc.utils class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.3' + version = '1.4' description = '`traceroute` and `traceroute6` command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -368,8 +368,8 @@ def parse(data, raw=False, quiet=False): Dictionary. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") raw_output = {} diff --git a/jc/parsers/ufw.py b/jc/parsers/ufw.py index c4ae15c2..5965c433 100644 --- a/jc/parsers/ufw.py +++ b/jc/parsers/ufw.py @@ -199,7 +199,7 @@ import ipaddress class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.0' + version = '1.1' description = '`ufw status` command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -394,8 +394,8 @@ def parse(data, raw=False, quiet=False): Dictionary. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") raw_output = {} rules_list = [] diff --git a/jc/parsers/ufw_appinfo.py b/jc/parsers/ufw_appinfo.py index ecde58c1..4885dc14 100644 --- a/jc/parsers/ufw_appinfo.py +++ b/jc/parsers/ufw_appinfo.py @@ -130,7 +130,7 @@ import jc.utils class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.0' + version = '1.1' description = '`ufw app info [application]` command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -265,8 +265,8 @@ def parse(data, raw=False, quiet=False): List of Dictionaries. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") raw_output = [] item_obj = {} diff --git a/jc/parsers/uname.py b/jc/parsers/uname.py index bd03582d..1c89c4a8 100644 --- a/jc/parsers/uname.py +++ b/jc/parsers/uname.py @@ -48,7 +48,7 @@ from jc.exceptions import ParseError class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.6' + version = '1.7' description = '`uname -a` command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -91,8 +91,8 @@ def parse(data, raw=False, quiet=False): Dictionary. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") raw_output = {} diff --git a/jc/parsers/upower.py b/jc/parsers/upower.py index ebc92efc..aa55f12e 100644 --- a/jc/parsers/upower.py +++ b/jc/parsers/upower.py @@ -194,7 +194,7 @@ import jc.utils class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.2' + version = '1.3' description = '`upower` command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -323,8 +323,8 @@ def parse(data, raw=False, quiet=False): List of Dictionaries. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") raw_output = [] device_obj = {} diff --git a/jc/parsers/uptime.py b/jc/parsers/uptime.py index cccf78d0..f7ae11de 100644 --- a/jc/parsers/uptime.py +++ b/jc/parsers/uptime.py @@ -65,7 +65,7 @@ import jc.utils class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.5' + version = '1.6' description = '`uptime` command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -155,8 +155,8 @@ def parse(data, raw=False, quiet=False): Dictionary. Raw or processed structured data """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") raw_output = {} cleandata = data.splitlines() diff --git a/jc/parsers/vmstat.py b/jc/parsers/vmstat.py index 7978d4ba..6a261d4b 100644 --- a/jc/parsers/vmstat.py +++ b/jc/parsers/vmstat.py @@ -121,7 +121,7 @@ import jc.utils class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.0' + version = '1.1' description = '`vmstat` command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -181,8 +181,8 @@ def parse(data, raw=False, quiet=False): List of Dictionaries. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") raw_output = [] output_line = {} diff --git a/jc/parsers/w.py b/jc/parsers/w.py index 65682166..4fcd93c3 100644 --- a/jc/parsers/w.py +++ b/jc/parsers/w.py @@ -104,7 +104,7 @@ import jc.utils class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.4' + version = '1.5' description = '`w` command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -153,8 +153,8 @@ def parse(data, raw=False, quiet=False): List of Dictionaries. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") cleandata = data.splitlines()[1:] raw_output = [] diff --git a/jc/parsers/wc.py b/jc/parsers/wc.py index 6a3c4f4d..7eddfc15 100644 --- a/jc/parsers/wc.py +++ b/jc/parsers/wc.py @@ -54,7 +54,7 @@ import jc.utils class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.2' + version = '1.3' description = '`wc` command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -103,8 +103,8 @@ def parse(data, raw=False, quiet=False): List of Dictionaries. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") raw_output = [] diff --git a/jc/parsers/who.py b/jc/parsers/who.py index bf55caf5..e0be6286 100644 --- a/jc/parsers/who.py +++ b/jc/parsers/who.py @@ -133,7 +133,7 @@ import jc.utils class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.4' + version = '1.5' description = '`who` command parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -186,8 +186,8 @@ def parse(data, raw=False, quiet=False): List of Dictionaries. Raw or processed structured data. """ - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") raw_output = [] diff --git a/jc/parsers/xml.py b/jc/parsers/xml.py index 6db0b590..1ac5971a 100644 --- a/jc/parsers/xml.py +++ b/jc/parsers/xml.py @@ -71,7 +71,7 @@ from jc.exceptions import LibraryNotInstalled class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.5' + version = '1.6' description = 'XML file parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -121,8 +121,8 @@ def parse(data, raw=False, quiet=False): except Exception: raise LibraryNotInstalled('The xmltodict library is not installed.') - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") raw_output = [] diff --git a/jc/parsers/yaml.py b/jc/parsers/yaml.py index bfcbe85a..89a1d374 100644 --- a/jc/parsers/yaml.py +++ b/jc/parsers/yaml.py @@ -85,7 +85,7 @@ from jc.exceptions import LibraryNotInstalled class info(): """Provides parser metadata (version, author, etc.)""" - version = '1.5' + version = '1.6' description = 'YAML file parser' author = 'Kelly Brazil' author_email = 'kellyjonbrazil@gmail.com' @@ -135,8 +135,8 @@ def parse(data, raw=False, quiet=False): except Exception: raise LibraryNotInstalled('The ruamel.yaml library is not installed.') - if not quiet: - jc.utils.compatibility(__name__, info.compatible) + if not quiet: jc.utils.compatibility(__name__, info.compatible) + if not isinstance(data, str): raise TypeError("Input data must be a 'str' object.") raw_output = []