Merge pull request #341 from AngeDieu/apps-layout

[build] update apps_layout.csv from EPSILON_APPS flag in make command
This commit is contained in:
Yaya-Cout
2025-11-05 14:49:27 +00:00
committed by GitHub
2 changed files with 13 additions and 1 deletions

View File

@@ -17,12 +17,13 @@ i18n_files += $(call i18n_without_universal_for,home/base)
SFLAGS += -I$(BUILD_DIR)
apps_layout = apps/home/apps_layout.csv
apps_layout_list = $(foreach i, $${EPSILON_APPS}, $(if $(filter external, $(i)),,"$(i),"))
$(eval $(call rule_for, \
APPS_LAYOUT, \
apps/home/apps_layout.cpp, \
, \
$$(PYTHON) apps/home/apps_layout.py --layouts $(apps_layout) --header $$(subst .cpp,.h,$$@) --implementation $$@ --apps $$(EPSILON_APPS), \
$$(PYTHON) apps/home/apps_layout.py --layouts $(apps_layout) --header $$(subst .cpp,.h,$$@) --implementation $$@ --apps $$(EPSILON_APPS) --apps_layout $(apps_layout_list), \
global \
))

View File

@@ -12,9 +12,18 @@ parser.add_argument('--header', help='the .h file to generate')
parser.add_argument('--implementation', help='the .cpp file to generate')
parser.add_argument('--apps', nargs='+', help='apps that are actually compiled')
parser.add_argument('--layouts', help='the apps_layout.csv file')
parser.add_argument('--apps_layout', help='the apps_layout from the make command')
args = parser.parse_args()
with io.open(args.layouts, "w", encoding="utf-8") as f:
ordered = args.apps_layout.split()
line1 = 'Default,'+','.join(ordered)+'\n'
line2 = 'HidePython,'+','.join(ordered)+'\n'
after = line1 + line2
f.truncate()
f.write(after)
def build_permutation(apps, appsOrdered):
res = [0] * len(apps)
i = 0
@@ -29,6 +38,8 @@ def parse_config_file(layouts, apps):
with io.open(layouts, "r", encoding="utf-8") as f:
csvreader = csv.reader(f, delimiter=',')
for row in csvreader:
for stg in row:
stg.strip()
res['styles'].append(row[0])
res['permutations'].append(build_permutation(apps, row[1:]))
return res