From 551938269907d1e1ed879e4a3a8dba7f5b3e6b5b Mon Sep 17 00:00:00 2001 From: notfound405 Date: Fri, 24 Feb 2023 20:28:04 +0800 Subject: [PATCH 1/3] Do not recurse into subdirs for `edl wl` --- edlclient/Library/firehose_client.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/edlclient/Library/firehose_client.py b/edlclient/Library/firehose_client.py index 4b24ac5..2fd0195 100644 --- a/edlclient/Library/firehose_client.py +++ b/edlclient/Library/firehose_client.py @@ -724,9 +724,8 @@ class firehose_client(metaclass=LogBase): filenames = [] if self.firehose.modules is not None: self.firehose.modules.writeprepare() - for dirName, subdirList, fileList in os.walk(directory): - for fname in fileList: - filenames.append(os.path.join(dirName, fname)) + for fname in filter(os.path.isfile, [ os.path.join(directory, i) for i in os.listdir(directory) ]): + filenames.append(fname) for lun in luns: data, guid_gpt = self.firehose.get_gpt(lun, int(options["--gpt-num-part-entries"]), int(options["--gpt-part-entry-size"]), From fdf036223e710b5ff327e36f847145dee14ce451 Mon Sep 17 00:00:00 2001 From: notfound405 Date: Fri, 24 Feb 2023 20:29:49 +0800 Subject: [PATCH 2/3] Add a small log to give user more tips --- edlclient/Library/firehose_client.py | 1 + 1 file changed, 1 insertion(+) diff --git a/edlclient/Library/firehose_client.py b/edlclient/Library/firehose_client.py index 2fd0195..16c525a 100644 --- a/edlclient/Library/firehose_client.py +++ b/edlclient/Library/firehose_client.py @@ -731,6 +731,7 @@ class firehose_client(metaclass=LogBase): int(options["--gpt-part-entry-size"]), int(options["--gpt-part-entry-start-lba"])) if guid_gpt is None: + self.error("Error: Can not fetch GPT table from device, you may need to use `edl w gpt` to write a partition table first.`") break for filename in filenames: partname = filename[filename.rfind("/") + 1:] From 8fb292a2a8e21ef080ed2ed647901e49a4f14b29 Mon Sep 17 00:00:00 2001 From: notfound405 Date: Fri, 24 Feb 2023 20:30:33 +0800 Subject: [PATCH 3/3] Fix `edl wl` for Windows --- edlclient/Library/firehose_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/edlclient/Library/firehose_client.py b/edlclient/Library/firehose_client.py index 16c525a..5d13b70 100644 --- a/edlclient/Library/firehose_client.py +++ b/edlclient/Library/firehose_client.py @@ -734,7 +734,7 @@ class firehose_client(metaclass=LogBase): self.error("Error: Can not fetch GPT table from device, you may need to use `edl w gpt` to write a partition table first.`") break for filename in filenames: - partname = filename[filename.rfind("/") + 1:] + partname = os.path.basename(filename) if ".bin" in partname[-4:] or ".img" in partname[-4:] or ".mbn" in partname[-4:]: partname = partname[:-4] if partname in skip: