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
30
core/app.py
30
core/app.py
@ -535,21 +535,21 @@ class DupeGuru(Broadcaster):
|
|||||||
return
|
return
|
||||||
if not self.selected_dupes:
|
if not self.selected_dupes:
|
||||||
return
|
return
|
||||||
dupe = self.selected_dupes[0]
|
dupes = self.selected_dupes
|
||||||
group = self.results.get_group_of_duplicate(dupe)
|
refs = [self.results.get_group_of_duplicate(dupe).ref for dupe in dupes]
|
||||||
ref = group.ref
|
for dupe, ref in zip(dupes, refs):
|
||||||
cmd = cmd.replace("%d", str(dupe.path))
|
dupe_cmd = cmd.replace("%d", str(dupe.path))
|
||||||
cmd = cmd.replace("%r", str(ref.path))
|
dupe_cmd = dupe_cmd.replace("%r", str(ref.path))
|
||||||
match = re.match(r'"([^"]+)"(.*)', cmd)
|
match = re.match(r'"([^"]+)"(.*)', dupe_cmd)
|
||||||
if match is not None:
|
if match is not None:
|
||||||
# This code here is because subprocess. Popen doesn't seem to accept, under Windows,
|
# 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
|
# executable paths with spaces in it, *even* when they're enclosed in "". So this is
|
||||||
# a workaround to make the damn thing work.
|
# a workaround to make the damn thing work.
|
||||||
exepath, args = match.groups()
|
exepath, args = match.groups()
|
||||||
path, exename = op.split(exepath)
|
path, exename = op.split(exepath)
|
||||||
subprocess.Popen(exename + args, shell=True, cwd=path)
|
subprocess.Popen(exename + args, shell=True, cwd=path)
|
||||||
else:
|
else:
|
||||||
subprocess.Popen(cmd, shell=True)
|
subprocess.Popen(dupe_cmd, shell=True)
|
||||||
|
|
||||||
def load(self):
|
def load(self):
|
||||||
"""Load directory selection and ignore list from files in appdata.
|
"""Load directory selection and ignore list from files in appdata.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user