1
0
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:
Kelly Brazil
2023-04-17 15:15:40 -07:00
parent 67164e7b23
commit fc48874a5d
4 changed files with 12 additions and 10 deletions

View File

@ -1,8 +1,10 @@
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 `crontab` command parsers for incorrect variable parsing in some cases
- Fix pytest warnings
20230323 v1.23.1
- Fix `zpool-status` command parser for lines that start with tab

View File

@ -96,14 +96,14 @@ class PBParser(object):
prefix = self.data[0:6]
for case in Switch(prefix):
if case('bplist'):
self.file_type = 'binary'
import biplist
parsed_plist = biplist.readPlist(self.file_path)
# self.file_type = 'binary'
# import biplist
# parsed_plist = biplist.readPlist(self.file_path)
break
if case('<?xml '):
self.file_type = 'xml'
import plistlib
parsed_plist = plistlib.readPlist(self.file_path)
# self.file_type = 'xml'
# import plistlib
# parsed_plist = plistlib.readPlist(self.file_path)
break
if case():
self.file_type = 'ascii'
@ -111,7 +111,7 @@ class PBParser(object):
if self.data[0:2] == '//':
# this is to try to see if we can locate the desired string encoding of the file
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:
self.string_encoding = result.group(1)
#now return the parse

View File

@ -57,7 +57,7 @@ def KeySorter(obj1, obj2):
result = StringCmp(str(obj1), str(obj2))
return result
class pbRoot(collections.MutableMapping):
class pbRoot(collections.abc.MutableMapping):
def __init__(self, *args, **kwargs):
self.store = dict()

View File

@ -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
\fBjc\fP \- JSON Convert JSONifies the output of many CLI tools, file-types,
and strings