diff options
| author | Birte Kristina Friesel <derf@finalrewind.org> | 2025-10-25 07:14:16 +0200 | 
|---|---|---|
| committer | Birte Kristina Friesel <derf@finalrewind.org> | 2025-10-25 07:14:16 +0200 | 
| commit | 6698f655161e25471b0c62c73dd92c548519b4f8 (patch) | |
| tree | 9a76380ad07159facc750a3e21c96a026df96963 /script/nfpvalues.py | |
| parent | d705599e2a0fa99e791af9b349e901b54cb93304 (diff) | |
nfpvalues, size: handle missing sections in size output
Diffstat (limited to 'script/nfpvalues.py')
| -rwxr-xr-x | script/nfpvalues.py | 6 | 
1 files changed, 3 insertions, 3 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} | 
