Limit results with -r, and no winders resizing

This commit is contained in:
CorpNewt 2018-09-27 15:50:42 -05:00 committed by GitHub
parent 970eb7f272
commit 79a23ca60a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -37,6 +37,9 @@ class gibMacOS:
) )
def resize(self, width=0, height=0): def resize(self, width=0, height=0):
if os.name=="nt":
# Winders resizing is dumb... bail
return
width = width if width > self.min_w else self.min_w width = width if width > self.min_w else self.min_w
height = height if height > self.min_h else self.min_h height = height if height > self.min_h else self.min_h
self.u.resize(width, height) self.u.resize(width, height)
@ -149,7 +152,12 @@ class gibMacOS:
desctext = None desctext = None
prodd["description"] = desctext prodd["description"] = desctext
# Iterate the available packages and save their urls and sizes # Iterate the available packages and save their urls and sizes
prodd["packages"] = plist_dict.get("Products",{}).get(prod,{}).get("Packages",{}) if self.find_recovery:
# Only get the recovery packages
prodd["packages"] = [x for x in plist_dict.get("Products",{}).get(prod,{}).get("Packages",[]) if x["URL"].endswith(self.recovery_suffixes)]
else:
# Add them all!
prodd["packages"] = plist_dict.get("Products",{}).get(prod,{}).get("Packages",[])
prod_list.append(prodd) prod_list.append(prodd)
# Sort by newest # Sort by newest
prod_list = sorted(prod_list, key=lambda x:x["time"], reverse=True) prod_list = sorted(prod_list, key=lambda x:x["time"], reverse=True)
@ -205,7 +213,6 @@ class gibMacOS:
if dmg: if dmg:
print("NOTE: Only Downloading DMG Files") print("NOTE: Only Downloading DMG Files")
print("") print("")
print(x)
print("Downloading {} for {}...".format(os.path.basename(x), name)) print("Downloading {} for {}...".format(os.path.basename(x), name))
print("") print("")
try: try: