mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2025-07-09 01:05:53 +02:00
pytest warning fixes
This commit is contained in:
@ -1,8 +1,10 @@
|
|||||||
jc changelog
|
jc changelog
|
||||||
|
|
||||||
20230402 v1.23.2
|
20230417 v1.23.2
|
||||||
|
- Add `bluetoothctl` command parser
|
||||||
- Fix `iwconfig` command parser for SSIDs with dashes in the name
|
- Fix `iwconfig` command parser for SSIDs with dashes in the name
|
||||||
- Fix `crontab` command parsers for incorrect variable parsing in some cases
|
- Fix `crontab` command parsers for incorrect variable parsing in some cases
|
||||||
|
- Fix pytest warnings
|
||||||
|
|
||||||
20230323 v1.23.1
|
20230323 v1.23.1
|
||||||
- Fix `zpool-status` command parser for lines that start with tab
|
- Fix `zpool-status` command parser for lines that start with tab
|
||||||
|
@ -96,14 +96,14 @@ class PBParser(object):
|
|||||||
prefix = self.data[0:6]
|
prefix = self.data[0:6]
|
||||||
for case in Switch(prefix):
|
for case in Switch(prefix):
|
||||||
if case('bplist'):
|
if case('bplist'):
|
||||||
self.file_type = 'binary'
|
# self.file_type = 'binary'
|
||||||
import biplist
|
# import biplist
|
||||||
parsed_plist = biplist.readPlist(self.file_path)
|
# parsed_plist = biplist.readPlist(self.file_path)
|
||||||
break
|
break
|
||||||
if case('<?xml '):
|
if case('<?xml '):
|
||||||
self.file_type = 'xml'
|
# self.file_type = 'xml'
|
||||||
import plistlib
|
# import plistlib
|
||||||
parsed_plist = plistlib.readPlist(self.file_path)
|
# parsed_plist = plistlib.readPlist(self.file_path)
|
||||||
break
|
break
|
||||||
if case():
|
if case():
|
||||||
self.file_type = 'ascii'
|
self.file_type = 'ascii'
|
||||||
@ -111,7 +111,7 @@ class PBParser(object):
|
|||||||
if self.data[0:2] == '//':
|
if self.data[0:2] == '//':
|
||||||
# this is to try to see if we can locate the desired string encoding of the file
|
# this is to try to see if we can locate the desired string encoding of the file
|
||||||
import re
|
import re
|
||||||
result = re.search('^// !\$\*(.+?)\*\$!', self.data) # pylint: disable=anomalous-backslash-in-string
|
result = re.search(r'^// !\$\*(.+?)\*\$!', self.data) # pylint: disable=anomalous-backslash-in-string
|
||||||
if result:
|
if result:
|
||||||
self.string_encoding = result.group(1)
|
self.string_encoding = result.group(1)
|
||||||
#now return the parse
|
#now return the parse
|
||||||
|
@ -57,7 +57,7 @@ def KeySorter(obj1, obj2):
|
|||||||
result = StringCmp(str(obj1), str(obj2))
|
result = StringCmp(str(obj1), str(obj2))
|
||||||
return result
|
return result
|
||||||
|
|
||||||
class pbRoot(collections.MutableMapping):
|
class pbRoot(collections.abc.MutableMapping):
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
self.store = dict()
|
self.store = dict()
|
||||||
|
2
man/jc.1
2
man/jc.1
@ -1,4 +1,4 @@
|
|||||||
.TH jc 1 2023-04-16 1.23.2 "JSON Convert"
|
.TH jc 1 2023-04-17 1.23.2 "JSON Convert"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
\fBjc\fP \- JSON Convert JSONifies the output of many CLI tools, file-types,
|
\fBjc\fP \- JSON Convert JSONifies the output of many CLI tools, file-types,
|
||||||
and strings
|
and strings
|
||||||
|
Reference in New Issue
Block a user