mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-11-26 11:28:51 -06:00
refactor: split campaign checks by stage
This commit is contained in:
1 parent
f2fd49a9c9
commit
fa5c02fb66
3 files changed
+220
-134
No files matched your search
@@ -95,11 +95,11 @@ def key_lines(lines: list[str], first: int, stop: int, key_indent: int) -> dict[
|
||||
match = KEY.match(line)
|
||||
if match and len(match["indent"]) == key_indent:
|
||||
order.append((match["key"], i))
|
||||
for position, (key, line) in enumerate(order):
|
||||
for position, (key, start) in enumerate(order):
|
||||
end = order[position + 1][1] if position + 1 < len(order) else stop
|
||||
while end > line + 1 and (not lines[end - 1].strip() or lines[end - 1].strip().startswith("#")):
|
||||
while end > start + 1 and (not lines[end - 1].strip() or lines[end - 1].strip().startswith("#")):
|
||||
end -= 1
|
||||
keys[key] = (line, end)
|
||||
keys[key] = (start, end)
|
||||
return keys
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user