File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33All notable changes to this project will be documented in this file. This project adheres to [ Semantic Versioning] ( http://semver.org/ ) .
44
55
6+ ## [ 1.8.0] - 2020-10-08
7+
8+ ### Changed
9+ - Replaced ` plistlib.readPlist() ` with ` plistlib.load() `
10+
11+
612## [ 1.7.0] - 2020-10-06
713
814### Added
Original file line number Diff line number Diff line change 77"""
88
99import argparse
10+ import json
1011import plistlib
1112from xml .parsers .expat import ExpatError
12- import json
13+
1314import ruamel .yaml
1415
1516yaml = ruamel .yaml .YAML (typ = "safe" )
@@ -44,7 +45,8 @@ def main(argv=None):
4445 ]
4546 elif filename .endswith (".plist" ):
4647 try :
47- recipe_list = plistlib .readPlist (filename )
48+ with open (filename , "rb" ) as openfile :
49+ recipe_list = plistlib .load (openfile )
4850 except (ExpatError , ValueError ) as err :
4951 print ("{}: plist parsing error: {}" .format (filename , err ))
5052 retval = 1
Original file line number Diff line number Diff line change @@ -383,7 +383,8 @@ def main(argv=None):
383383 retval = 0
384384 for filename in args .filenames :
385385 try :
386- recipe = plistlib .readPlist (filename )
386+ with open (filename , "rb" ) as openfile :
387+ recipe = plistlib .load (openfile )
387388
388389 except (ExpatError , ValueError ) as err :
389390 print ("{}: plist parsing error: {}" .format (filename , err ))
Original file line number Diff line number Diff line change @@ -27,7 +27,8 @@ def main(argv=None):
2727 retval = 0
2828 for filename in args .filenames :
2929 try :
30- profile = plistlib .readPlist (filename )
30+ with open (filename , "rb" ) as openfile :
31+ profile = plistlib .load (openfile )
3132 except (ExpatError , ValueError ) as err :
3233 print ("{}: plist parsing error: {}" .format (filename , err ))
3334 retval = 1
Original file line number Diff line number Diff line change @@ -49,7 +49,8 @@ def main(argv=None):
4949 retval = 0
5050 for filename in args .filenames :
5151 try :
52- pkginfo = plistlib .readPlist (filename )
52+ with open (filename , "rb" ) as openfile :
53+ pkginfo = plistlib .load (openfile )
5354 except (ExpatError , ValueError ) as err :
5455 print ("{}: plist parsing error: {}" .format (filename , err ))
5556 retval = 1
@@ -180,7 +181,7 @@ def main(argv=None):
180181 if script_type in pkginfo :
181182 if all (not pkginfo [script_type ].startswith (x + "\n " ) for x in shebangs ):
182183 print (
183- "{}: has a {} that does not start with a valid shebang." .format (
184+ "{}: Has a {} that does not start with a valid shebang." .format (
184185 filename , script_type
185186 )
186187 )
Original file line number Diff line number Diff line change @@ -81,7 +81,8 @@ def main(argv=None):
8181 for filename in args .filenames :
8282 if filename .endswith (".plist" ):
8383 try :
84- buildinfo = plistlib .readPlist (filename )
84+ with open (filename , "rb" ) as openfile :
85+ buildinfo = plistlib .load (openfile )
8586 except (ExpatError , ValueError ) as err :
8687 print ("{}: plist parsing error: {}" .format (filename , err ))
8788 retval = 1
Original file line number Diff line number Diff line change @@ -27,7 +27,8 @@ def main(argv=None):
2727 retval = 0
2828 for filename in args .filenames :
2929 try :
30- plist = plistlib .readPlist (filename )
30+ with open (filename , "rb" ) as openfile :
31+ plist = plistlib .load (openfile )
3132 # Possible future addition, but disabled for now.
3233 # if not isinstance(plist, dict):
3334 # print("{}: top level of plist should be type dict".format(filename))
Original file line number Diff line number Diff line change @@ -30,7 +30,8 @@ def main(argv=None):
3030 retval = 0
3131 for filename in args .filenames :
3232 try :
33- recipe = plistlib .readPlist (filename )
33+ with open (filename , "rb" ) as openfile :
34+ recipe = plistlib .load (openfile )
3435 for req_key in required_keys :
3536 if req_key not in recipe :
3637 print ("{}: possible AutoPkg recipe override" .format (filename ))
Original file line number Diff line number Diff line change @@ -28,7 +28,8 @@ def main(argv=None):
2828 retval = 0
2929 for filename in args .filenames :
3030 try :
31- recipe = plistlib .readPlist (filename )
31+ with open (filename , "rb" ) as openfile :
32+ recipe = plistlib .load (openfile )
3233 if "ParentRecipeTrustInfo" in recipe :
3334 print ("{}: trust info in recipe" .format (filename ))
3435 retval = 1
You can’t perform that action at this time.
0 commit comments