mirror of
https://github.com/corpnewt/gibMacOS.git
synced 2024-09-20 01:30:33 +00:00
Fixed issue with starting char, fixed plist reading from string in py2
This commit is contained in:
parent
f75c0dbb54
commit
3b921fa211
2 changed files with 307 additions and 304 deletions
|
@ -63,7 +63,10 @@ def load(fp, fmt=None, use_builtin_types=True, dict_type=dict):
|
|||
def loads(value, fmt=None, use_builtin_types=True, dict_type=dict):
|
||||
if isinstance(value, _get_inst()):
|
||||
# We were sent a string - let's encode it to some utf-8 bytes for fun!
|
||||
try:
|
||||
value = value.encode("utf-8")
|
||||
except:
|
||||
pass
|
||||
fp = BytesIO(value)
|
||||
if _check_py3():
|
||||
return plistlib.load(fp, fmt=fmt, use_builtin_types=use_builtin_types, dict_type=dict_type)
|
||||
|
|
6
gibMacOS.command
Normal file → Executable file
6
gibMacOS.command
Normal file → Executable file
|
@ -107,11 +107,11 @@ class gibMacOS:
|
|||
for prod in prods:
|
||||
# Grab the ServerMetadataURL for the passed product key if it exists
|
||||
prodd = {"product":prod}
|
||||
try:
|
||||
#try:
|
||||
b = self.d.get_bytes(plist_dict.get("Products",{}).get(prod,{}).get("ServerMetadataURL",""), False)
|
||||
smd = plist.loads(b)
|
||||
except:
|
||||
smd = {}
|
||||
#except:
|
||||
# smd = {}
|
||||
# Populate some info!
|
||||
prodd["date"] = plist_dict.get("Products",{}).get(prod,{}).get("PostDate","")
|
||||
prodd["time"] = time.mktime(prodd["date"].timetuple()) + prodd["date"].microsecond / 1E6
|
||||
|
|
Loading…
Reference in a new issue