Skip to content

Commit cd80df1

Browse files
committed
- improve explicit task readout for profiles without explicit tasks
1 parent 5657bff commit cd80df1

File tree

1 file changed

+22
-20
lines changed

1 file changed

+22
-20
lines changed

scripts/pmbuild.py

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1221,20 +1221,26 @@ def generate_pmbuild_config(config, taskname):
12211221
f.write(json.dumps(md, indent=4))
12221222

12231223

1224-
# print available profiles in config.jsn of cwd
1225-
def print_profiles(config):
1226-
print("\nprofiles:")
1227-
print(" config.jsn (edit task settings or add profiles in here)")
1228-
non_profiles = [
1224+
# return config keys that are not runnable tasks
1225+
def get_non_profiles():
1226+
return [
12291227
"tools",
12301228
"tools_help",
12311229
"extensions",
12321230
"user_vars",
12331231
"special_args",
12341232
"post_build_order",
12351233
"pre_build_order",
1236-
"build_order"
1234+
"build_order",
1235+
"user_args"
12371236
]
1237+
1238+
1239+
# print available profiles in config.jsn of cwd
1240+
def print_profiles(config):
1241+
print("\nprofiles:")
1242+
print(" config.jsn (edit task settings or add profiles in here)")
1243+
non_profiles = get_non_profiles()
12381244
for p_name in config.keys():
12391245
if p_name not in non_profiles:
12401246
p = config[p_name]
@@ -1289,17 +1295,7 @@ def pmbuild_profile_help(config, build_order):
12891295
print(" config.jsn (edit task settings or add new ones in here)")
12901296
print(" build order:")
12911297

1292-
non_profiles = [
1293-
"tools",
1294-
"tools_help",
1295-
"extensions",
1296-
"user_vars",
1297-
"special_args",
1298-
"post_build_order",
1299-
"pre_build_order",
1300-
"build_order",
1301-
"user_args"
1302-
]
1298+
non_profiles = get_non_profiles()
13031299

13041300
for task_name in build_order:
13051301
task = config[task_name]
@@ -1316,11 +1312,17 @@ def pmbuild_profile_help(config, build_order):
13161312

13171313
print(" " * 8 + task_name)
13181314

1319-
print("")
1320-
print(" explicit tasks:")
1315+
explicit_tasks = []
13211316
for key in config:
13221317
if key not in build_order and key not in non_profiles:
1323-
print(" " * 8 + key)
1318+
explicit_tasks.append(" " * 8 + key + "\n")
1319+
1320+
if len(explicit_tasks) > 0:
1321+
print("")
1322+
print(" explicit tasks:")
1323+
for task in explicit_tasks:
1324+
print(task)
1325+
13241326

13251327

13261328
# build help for core tasks

0 commit comments

Comments
 (0)