forked from YaolongChen/flutter-string-extractor
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_parse.py
More file actions
23 lines (17 loc) · 723 Bytes
/
test_parse.py
File metadata and controls
23 lines (17 loc) · 723 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
with open("test_config.yaml") as f:
lines = f.read().splitlines()
insideConfigBlock = False
useExtension = False
for line in lines:
trimmed = line.strip()
if trimmed.startswith("flutter_string_extractor:"):
insideConfigBlock = True
continue
if insideConfigBlock and line and not line.startswith(" ") and not line.startswith("\t") and not line.startswith("#"):
insideConfigBlock = False
if insideConfigBlock:
if trimmed.startswith("use_extension:"):
# Kotlin: useExtension = trimmed.substringAfter(":").trim().lowercase() == "true"
val = trimmed.split(":", 1)[1].strip().lower()
useExtension = (val == "true")
print(useExtension)