Changeset 0d2ef60
- Timestamp:
- 07/31/2023 04:27:35 PM (11 months ago)
- Branches:
- 12.0, 12.1, ken/TL2024, ken/tuningfonts, lazarus, plabs/newcss, python3.11, rahul/power-profiles-daemon, renodr/vulkan-addition, trunk, xry111/llvm18
- Children:
- bd141376
- Parents:
- cceadef
- git-author:
- Xi Ruoyao <xry111@…> (07/31/2023 03:57:30 PM)
- git-committer:
- Xi Ruoyao <xry111@…> (07/31/2023 04:27:35 PM)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel-config/kernel-config.py
rcceadef r0d2ef60 62 62 def parse_config(buf): 63 63 global ind0, ind1, stack, menu_id 64 is_menu = buf[0].startswith('menu') 65 is_nonconfig_menu = buf[0].startswith('menu ') 64 is_choice = buf[0].strip() == 'choice' 65 is_menu = buf[0].startswith('menu') or is_choice 66 is_nonconfig_menu = buf[0].startswith('menu ') or is_choice 66 67 key = None if is_nonconfig_menu else buf[0].split()[1].strip() 67 68 title = buf[0][len('menu '):] if is_nonconfig_menu else None … … 146 147 147 148 key = key or 'menu' 148 stack_ent = (key, 2, 0, menu_id) if is_menu else (key, 0, x, cur_menu()) 149 menu = (menu_id if is_menu else cur_menu()) 150 menu |= choice_bit if is_choice else 0 151 stack_ent = (key, 2, 0, menu) if is_menu else (key, 0, x, menu) 149 152 ind0 += stack_ent[1] 150 153 ind1 += stack_ent[2] 151 154 stack += [stack_ent] 152 155 153 return r154 155 def parse_choice(buf):156 global ind0, ind1, stack, menu_id157 assert(buf[0] == 'choice\n')158 title = ''159 for line in buf:160 line = line.strip()161 if line.startswith('prompt '):162 title = line[len('prompt '):].strip().strip('"')163 164 menu_id += 1165 166 if stack:167 fa = stack[-1][0]168 if fa == 'menu':169 fa = cur_menu() & ~choice_bit170 main_dep[menu_id] = fa171 172 r = [ind0, None, ind1, title, ' --->', menu_id, cur_menu(), None]173 stack += [('menu', 2, 0, menu_id | choice_bit)]174 ind0 += 2175 156 return r 176 157 … … 183 164 if config_buf: 184 165 if not (line.startswith('\t') or line.startswith(' ')): 185 if config_buf[0] == 'choice\n': 186 r += [parse_choice(config_buf)] 187 else: 188 r += [parse_config(config_buf)] 166 r += [parse_config(config_buf)] 189 167 config_buf = [] 190 168 else:
Note:
See TracChangeset
for help on using the changeset viewer.