diff options
Diffstat (limited to 'doc/tools/doc_status.py')
-rwxr-xr-x | doc/tools/doc_status.py | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/doc/tools/doc_status.py b/doc/tools/doc_status.py index 6e34cffc05..e6e6d5f606 100755 --- a/doc/tools/doc_status.py +++ b/doc/tools/doc_status.py @@ -69,8 +69,8 @@ long_flags = { 'empty': 'e', } -table_columns = ['name', 'brief_description', 'description', 'methods', 'constants', 'members', 'signals'] -table_column_names = ['Name', 'Brief Desc.', 'Desc.', 'Methods', 'Constants', 'Members', 'Signals'] +table_columns = ['name', 'brief_description', 'description', 'methods', 'constants', 'members', 'signals', 'theme_items'] +table_column_names = ['Name', 'Brief Desc.', 'Desc.', 'Methods', 'Constants', 'Members', 'Signals', 'Theme Items'] colors = { 'name': [36], # cyan 'part_big_problem': [4, 31], # underline, red @@ -81,6 +81,7 @@ colors = { 'section': [1, 4], # bold, underline 'state_off': [36], # cyan 'state_on': [1, 35], # bold, magenta/plum + 'bold': [1], # bold } overall_progress_description_weigth = 10 @@ -176,6 +177,7 @@ class ClassStatus: 'methods': ClassStatusProgress(), 'constants': ClassStatusProgress(), 'members': ClassStatusProgress(), + 'theme_items': ClassStatusProgress(), 'signals': ClassStatusProgress() } @@ -220,13 +222,13 @@ class ClassStatus: ) items_progress = ClassStatusProgress() - for k in ['methods', 'constants', 'members', 'signals']: + for k in ['methods', 'constants', 'members', 'signals', 'theme_items']: items_progress += self.progresses[k] output[k] = self.progresses[k].to_configured_colored_string() output['items'] = items_progress.to_configured_colored_string() - output['overall'] = (description_progress + items_progress).to_colored_string('{percent}%', '{pad_percent}{s}') + output['overall'] = (description_progress + items_progress).to_colored_string(color('bold', '{percent}%'), '{pad_percent}{s}') if self.name.startswith('Total'): output['url'] = color('url', 'https://docs.godotengine.org/en/latest/classes/') @@ -257,7 +259,7 @@ class ClassStatus: for sub_tag in list(tag): descr = sub_tag.find('description') status.progresses[tag.tag].increment(len(descr.text.strip()) > 0) - elif tag.tag in ['constants', 'members']: + elif tag.tag in ['constants', 'members', 'theme_items']: for sub_tag in list(tag): if not sub_tag.text is None: status.progresses[tag.tag].increment(len(sub_tag.text.strip()) > 0) @@ -300,7 +302,7 @@ for arg in sys.argv[1:]: sys.exit(1) if flags['i']: - for r in ['methods', 'constants', 'members', 'signals']: + for r in ['methods', 'constants', 'members', 'signals', 'theme_items']: index = table_columns.index(r) del table_column_names[index] del table_columns[index] @@ -308,7 +310,7 @@ if flags['i']: table_columns.append('items') if flags['o'] == (not flags['i']): - table_column_names.append('Overall') + table_column_names.append(color('bold', 'Overall')) table_columns.append('overall') if flags['u']: @@ -434,6 +436,11 @@ if len(table) > 2 or not flags['a']: row.append('') table.append(row) +if flags['a']: + # Duplicate the headers at the bottom of the table so they can be viewed + # without having to scroll back to the top. + table.append(table_column_names) + table_column_sizes = [] for row in table: for cell_i, cell in enumerate(row): @@ -459,7 +466,10 @@ for row_i, row in enumerate(table): print(row_string) - if row_i == 0 or row_i == len(table) - 2: + # Account for the possible double header (if the `a` flag is enabled). + # No need to have a condition for the flag, as this will behave correctly + # if the flag is disabled. + if row_i == 0 or row_i == len(table) - 3 or row_i == len(table) - 2: print(divider_string) print(divider_string) |