mirror of
https://github.com/arsenetar/dupeguru.git
synced 2025-03-10 05:34:36 +00:00
Update invoke_custom_command to run for all selected items
This commit is contained in:
parent
e22d7d2fc9
commit
1d60e124ee
14
core/app.py
14
core/app.py
@ -535,12 +535,12 @@ class DupeGuru(Broadcaster):
|
||||
return
|
||||
if not self.selected_dupes:
|
||||
return
|
||||
dupe = self.selected_dupes[0]
|
||||
group = self.results.get_group_of_duplicate(dupe)
|
||||
ref = group.ref
|
||||
cmd = cmd.replace("%d", str(dupe.path))
|
||||
cmd = cmd.replace("%r", str(ref.path))
|
||||
match = re.match(r'"([^"]+)"(.*)', cmd)
|
||||
dupes = self.selected_dupes
|
||||
refs = [self.results.get_group_of_duplicate(dupe).ref for dupe in dupes]
|
||||
for dupe, ref in zip(dupes, refs):
|
||||
dupe_cmd = cmd.replace("%d", str(dupe.path))
|
||||
dupe_cmd = dupe_cmd.replace("%r", str(ref.path))
|
||||
match = re.match(r'"([^"]+)"(.*)', dupe_cmd)
|
||||
if match is not None:
|
||||
# This code here is because subprocess. Popen doesn't seem to accept, under Windows,
|
||||
# executable paths with spaces in it, *even* when they're enclosed in "". So this is
|
||||
@ -549,7 +549,7 @@ class DupeGuru(Broadcaster):
|
||||
path, exename = op.split(exepath)
|
||||
subprocess.Popen(exename + args, shell=True, cwd=path)
|
||||
else:
|
||||
subprocess.Popen(cmd, shell=True)
|
||||
subprocess.Popen(dupe_cmd, shell=True)
|
||||
|
||||
def load(self):
|
||||
"""Load directory selection and ignore list from files in appdata.
|
||||
|
Loading…
x
Reference in New Issue
Block a user