Update sku list script
Refactor some of the code and add an interactive variant chooserpull/4/head
parent
96ea3f71fe
commit
96d590c3eb
|
@ -4,8 +4,7 @@ import os
|
||||||
import sys
|
import sys
|
||||||
import json
|
import json
|
||||||
|
|
||||||
variant = ""
|
variants = []
|
||||||
ucm_suffixes = []
|
|
||||||
sku_ids = {}
|
sku_ids = {}
|
||||||
|
|
||||||
with open("project-config.json", "r") as project:
|
with open("project-config.json", "r") as project:
|
||||||
|
@ -13,10 +12,18 @@ with open("project-config.json", "r") as project:
|
||||||
|
|
||||||
configs = p_json['chromeos']['configs']
|
configs = p_json['chromeos']['configs']
|
||||||
|
|
||||||
|
print("Variants:")
|
||||||
|
for config in configs:
|
||||||
|
variant = config['name']
|
||||||
|
if not variant in variants:
|
||||||
|
variants.append(variant)
|
||||||
|
print(variant)
|
||||||
|
|
||||||
|
variant = input("Choose a variant: ")
|
||||||
|
|
||||||
for config in configs:
|
for config in configs:
|
||||||
if config['audio']['main']['cras-config-dir'] == variant:
|
if config['audio']['main']['cras-config-dir'] == variant:
|
||||||
if not config['audio']['main']['ucm-suffix'] in ucm_suffixes:
|
if not config['audio']['main']['ucm-suffix'] in sku_ids:
|
||||||
ucm_suffixes.append(config['audio']['main']['ucm-suffix'])
|
|
||||||
sku_ids[config['audio']['main']['ucm-suffix']] = []
|
sku_ids[config['audio']['main']['ucm-suffix']] = []
|
||||||
sku_ids[config['audio']['main']['ucm-suffix']].append(config['identity']['sku-id'])
|
sku_ids[config['audio']['main']['ucm-suffix']].append(config['identity']['sku-id'])
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue