summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xscript/nfpvalues.py6
-rwxr-xr-xscript/size.py4
2 files changed, 5 insertions, 5 deletions
diff --git a/script/nfpvalues.py b/script/nfpvalues.py
index d82a124..0680fa6 100755
--- a/script/nfpvalues.py
+++ b/script/nfpvalues.py
@@ -24,15 +24,15 @@ def main(size_executable, rom_sections, ram_sections):
section_size = dict()
for line in status.stdout.split("\n"):
- match = re.match("[.](\S+)\s+(\d+)", line)
+ match = re.match(r"[.](\S+)\s+(\d+)", line)
if match:
section = match.group(1)
size = int(match.group(2))
section_size[section] = size
total = {
- "ROM": sum(map(lambda section: section_size[section], rom_sections)),
- "RAM": sum(map(lambda section: section_size[section], ram_sections)),
+ "ROM": sum(map(lambda section: section_size.get(section, 0), rom_sections)),
+ "RAM": sum(map(lambda section: section_size.get(section, 0), ram_sections)),
}
output = {"OS Image": total}
diff --git a/script/size.py b/script/size.py
index e1f6605..c11e4cd 100755
--- a/script/size.py
+++ b/script/size.py
@@ -31,8 +31,8 @@ def main(size_executable, rom_sections, ram_sections):
section_size[section] = size
total = {
- "ROM": sum(map(lambda section: section_size[section], rom_sections)),
- "RAM": sum(map(lambda section: section_size[section], ram_sections)),
+ "ROM": sum(map(lambda section: section_size.get(section, 0), rom_sections)),
+ "RAM": sum(map(lambda section: section_size.get(section, 0), ram_sections)),
}
output = {"section": section_size, "total": total}