# Generate a List of "Parent names"
parents = []
parent_ids = []
parent_index = 0 for demo in demos: if"/"in demo[1]:
slash_index = demo[1].index('/')
parent_name = demo[1][:slash_index]
do_break = False
# Check for duplicates ifnot parent_name in parents:
parents.append(parent_name)
parent_ids.append(parent_index)
demos.append(("NULL", parent_name, set(), "NULL", "NULL", parent_index))
parent_index = parent_index + 1
# Sort demos by title
demos = sorted(demos, key=lambda x: x[1])
# For every child with a parent, generate a list of child demos
i = 0 for parent in parents:
id = parent_ids[i]
file_output += "\nDemoData child" + str(id) + "[] = {\n" # iterate over all demos and check if the name starts with the given parent name for child in demos: if child[1].startswith(parent + "/"):
title = child[1][child[1].rfind('/') + 1:]
file_output += " { \"" + child[0] + "\", \"" + title + "\", " + "(const char*[]) {" + ", ".join(list(map(add_quotes, sorted(child[2]))) + ["NULL"]) + " }, \"" + child[3] + "\", " + child[4] + ", NULL },\n"
file_output += " { NULL }\n};\n"
i = i + 1
file_output += "\nDemoData gtk_demos[] = {\n" for demo in demos: # Do not generate one of these for demos with a parent demo if"/"notin demo[1]:
child_array = "NULL"
name = demo[0]
title = demo[1]
keywords = demo[2]
file = demo[3] if name != "NULL":
name = "\"" + name + "\"" if title != "NULL":
title = "\"" + title + "\"" if file != "NULL":
file = "\"" + file + "\""
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.