From 651303f0a1adaaf1267698f465c508b737af425e Mon Sep 17 00:00:00 2001 From: CorpNewt Date: Wed, 26 Sep 2018 05:01:35 -0500 Subject: [PATCH] Log downloaded files as you go --- gibMacOS.command | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/gibMacOS.command b/gibMacOS.command index 5ede2bd..2180bdc 100644 --- a/gibMacOS.command +++ b/gibMacOS.command @@ -169,12 +169,14 @@ class gibMacOS: self.u.grab("Press [enter] to return...") return c = 0 - failed = [] - succeeded = [] + done = [] for x in dl_list: c += 1 self.u.head("Downloading File {} of {}".format(c, len(dl_list))) print("") + if len(done): + print("\n".join(["{} --> {}".format(x["name"], "Succeeded" if x["status"] else "Failed") for x in done])) + print("") if dmg: print("NOTE: Only Downloading DMG Files") print("") @@ -182,25 +184,30 @@ class gibMacOS: print("") try: self.d.stream_to_file(x, os.path.join(os.getcwd(), self.saves, self.current_catalog, name, os.path.basename(x))) - succeeded.append(os.path.basename(x)) + done.append({"name":os.path.basename(x), "status":True}) except: - failed.append(os.path.basename(x)) + done.append({"name":os.path.basename(x), "status":False}) + succeeded = [x for x in done if x["status"]] + failed = [x for x in done if not x["status"]] self.u.head("Downloaded {} of {}".format(len(succeeded), len(dl_list))) print("") print("Succeeded:") if len(succeeded): for x in succeeded: - print(" {}".format(x)) + print(" {}".format(x["name"])) else: print(" None") print("") print("Failed:") if len(failed): for x in failed: - print(" {}".format(x)) + print(" {}".format(x["name"])) else: print(" None") print("") + print("Files saved to:") + print(" {}".format(os.path.join(os.getcwd(), self.saves, self.current_catalog, name))) + print("") self.u.grab("Press [enter] to return...") def main(self, dmg = False):