Merge pull request #56606 from Calinou/update-doc-status-script
Update doc_status script to support constructors and operators docs
This commit is contained in:
commit
c4ac35485e
1 changed files with 22 additions and 10 deletions
|
@ -66,10 +66,23 @@ table_columns = [
|
||||||
"methods",
|
"methods",
|
||||||
"constants",
|
"constants",
|
||||||
"members",
|
"members",
|
||||||
"signals",
|
|
||||||
"theme_items",
|
"theme_items",
|
||||||
|
"signals",
|
||||||
|
"operators",
|
||||||
|
"constructors",
|
||||||
|
]
|
||||||
|
table_column_names = [
|
||||||
|
"Name",
|
||||||
|
"Brief Desc.",
|
||||||
|
"Desc.",
|
||||||
|
"Methods",
|
||||||
|
"Constants",
|
||||||
|
"Members",
|
||||||
|
"Theme Items",
|
||||||
|
"Signals",
|
||||||
|
"Operators",
|
||||||
|
"Constructors",
|
||||||
]
|
]
|
||||||
table_column_names = ["Name", "Brief Desc.", "Desc.", "Methods", "Constants", "Members", "Signals", "Theme Items"]
|
|
||||||
colors = {
|
colors = {
|
||||||
"name": [36], # cyan
|
"name": [36], # cyan
|
||||||
"part_big_problem": [4, 31], # underline, red
|
"part_big_problem": [4, 31], # underline, red
|
||||||
|
@ -82,7 +95,7 @@ colors = {
|
||||||
"state_on": [1, 35], # bold, magenta/plum
|
"state_on": [1, 35], # bold, magenta/plum
|
||||||
"bold": [1], # bold
|
"bold": [1], # bold
|
||||||
}
|
}
|
||||||
overall_progress_description_weigth = 10
|
overall_progress_description_weight = 10
|
||||||
|
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
|
@ -180,6 +193,8 @@ class ClassStatus:
|
||||||
"members": ClassStatusProgress(),
|
"members": ClassStatusProgress(),
|
||||||
"theme_items": ClassStatusProgress(),
|
"theme_items": ClassStatusProgress(),
|
||||||
"signals": ClassStatusProgress(),
|
"signals": ClassStatusProgress(),
|
||||||
|
"operators": ClassStatusProgress(),
|
||||||
|
"constructors": ClassStatusProgress(),
|
||||||
}
|
}
|
||||||
|
|
||||||
def __add__(self, other):
|
def __add__(self, other):
|
||||||
|
@ -218,12 +233,12 @@ class ClassStatus:
|
||||||
output["description"] = ok_string if self.has_description else missing_string
|
output["description"] = ok_string if self.has_description else missing_string
|
||||||
|
|
||||||
description_progress = ClassStatusProgress(
|
description_progress = ClassStatusProgress(
|
||||||
(self.has_brief_description + self.has_description) * overall_progress_description_weigth,
|
(self.has_brief_description + self.has_description) * overall_progress_description_weight,
|
||||||
2 * overall_progress_description_weigth,
|
2 * overall_progress_description_weight,
|
||||||
)
|
)
|
||||||
items_progress = ClassStatusProgress()
|
items_progress = ClassStatusProgress()
|
||||||
|
|
||||||
for k in ["methods", "constants", "members", "signals", "theme_items"]:
|
for k in ["methods", "constants", "members", "theme_items", "signals", "constructors", "operators"]:
|
||||||
items_progress += self.progresses[k]
|
items_progress += self.progresses[k]
|
||||||
output[k] = self.progresses[k].to_configured_colored_string()
|
output[k] = self.progresses[k].to_configured_colored_string()
|
||||||
|
|
||||||
|
@ -260,7 +275,7 @@ class ClassStatus:
|
||||||
elif tag.tag == "description":
|
elif tag.tag == "description":
|
||||||
status.has_description = len(tag.text.strip()) > 0
|
status.has_description = len(tag.text.strip()) > 0
|
||||||
|
|
||||||
elif tag.tag in ["methods", "signals"]:
|
elif tag.tag in ["methods", "signals", "operators", "constructors"]:
|
||||||
for sub_tag in list(tag):
|
for sub_tag in list(tag):
|
||||||
descr = sub_tag.find("description")
|
descr = sub_tag.find("description")
|
||||||
status.progresses[tag.tag].increment(len(descr.text.strip()) > 0)
|
status.progresses[tag.tag].increment(len(descr.text.strip()) > 0)
|
||||||
|
@ -272,9 +287,6 @@ class ClassStatus:
|
||||||
elif tag.tag in ["tutorials"]:
|
elif tag.tag in ["tutorials"]:
|
||||||
pass # Ignore those tags for now
|
pass # Ignore those tags for now
|
||||||
|
|
||||||
elif tag.tag in ["theme_items"]:
|
|
||||||
pass # Ignore those tags, since they seem to lack description at all
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
print(tag.tag, tag.attrib)
|
print(tag.tag, tag.attrib)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue