瀏覽代碼

🔨 Fix config.ini custom items, and 'all' (#24720)

ButchMonkey 2 年之前
父節點
當前提交
c46ed8f57d
沒有連結到貢獻者的電子郵件帳戶。
共有 1 個檔案被更改,包括 9 行新增5 行删除
  1. 9
    5
      buildroot/share/PlatformIO/scripts/configuration.py

+ 9
- 5
buildroot/share/PlatformIO/scripts/configuration.py 查看文件

78
                 elif not isdef:
78
                 elif not isdef:
79
                     break
79
                     break
80
                 linenum += 1
80
                 linenum += 1
81
-            lines.insert(linenum, f"{prefix}#define {added} // Added by config.ini\n")
82
-            fullpath.write_text('\n'.join(lines), encoding='utf-8')
81
+            lines.insert(linenum, f"{prefix}#define {added:30} // Added by config.ini\n")
82
+            fullpath.write_text(''.join(lines), encoding='utf-8')
83
 
83
 
84
 # Fetch configuration files from GitHub given the path.
84
 # Fetch configuration files from GitHub given the path.
85
 # Return True if any files were fetched.
85
 # Return True if any files were fetched.
127
         iniok = False
127
         iniok = False
128
         items = section_items(cp, 'config:base') + section_items(cp, 'config:root')
128
         items = section_items(cp, 'config:base') + section_items(cp, 'config:root')
129
     else:
129
     else:
130
-        items = cp.items(sect)
130
+        items = section_items(cp, sect)
131
 
131
 
132
     for item in items:
132
     for item in items:
133
         if iniok or not item[0].startswith('ini_'):
133
         if iniok or not item[0].startswith('ini_'):
195
             fetch_example(ckey)
195
             fetch_example(ckey)
196
             ckey = 'base'
196
             ckey = 'base'
197
 
197
 
198
-        # Apply keyed sections after external files are done
199
-        apply_sections(cp, 'config:' + ckey)
198
+        elif ckey == 'all':
199
+            apply_sections(cp)
200
+
201
+        else:
202
+            # Apply keyed sections after external files are done
203
+            apply_sections(cp, 'config:' + ckey)
200
 
204
 
201
 if __name__ == "__main__":
205
 if __name__ == "__main__":
202
     #
206
     #

Loading…
取消
儲存