fix: retain native save completion through cancellation and restart

This commit is contained in:
阿白叔 committed 2026-11-24 08:48:33 +08:00
1 parent 18349413c5
commit 443668aa4b
11 files changed
+220 -45

No files matched your search

+4 -1
View File
@@ -373,6 +373,9 @@ def _owner_matches_scope(item, library, roots):
return None
candidates = []
worker_flags = {'--verify-worker', '--repair-worker', '--management-worker', '--native-backup-worker'}
path_flags = {'-icdb', '-project', '-p'}
if ntpath.basename(str(item.get('name') or args[0])).casefold() == 'icdbnetserver.exe':
path_flags.add('-db')
for index, arg in enumerate(args[1:], 1):
if arg.casefold() in worker_flags and index + 1 < len(args):
try:
@@ -388,7 +391,7 @@ def _owner_matches_scope(item, library, roots):
value = arg.split('=', 1)[1] if arg.startswith('-') and '=' in arg else arg
if (ntpath.isabs(value) and (ntpath.splitext(value)[1].casefold() in ('.prj', '.pcb', '.lmc')
or arg.casefold().startswith(('-project=', '-icdb='))
or args[index - 1].casefold() in ('-icdb', '-project', '-p'))):
or args[index - 1].casefold() in path_flags)):
candidates.append(value)
normalized_roots = [ntpath.normcase(ntpath.normpath(str(root))) for root in roots]
expected_library = ntpath.normcase(ntpath.normpath(str(library)))