예제 #1
0
파일: hds.py 프로젝트: emilkarlen/exactly
    def _dir_item(self, x: _DirInfo) -> HeaderContentListItem:
        def prop_row(header: str, value_str_or_text) -> List[docs.TableCell]:
            return [
                docs.text_cell(header),
                docs.text_cell(value_str_or_text),
            ]

        from exactly_lib.tcfs.relative_path_options import REL_HDS_OPTIONS_MAP
        properties_table = docs.first_column_is_header_table([
            prop_row('Default value', x.default_value_description),
            prop_row(
                concepts.CONFIGURATION_PARAMETER_CONCEPT_INFO.singular_name.
                capitalize(), x.conf_param.configuration_parameter_name_text),
            prop_row('Set by instruction',
                     instruction_name_text(x.instruction_name)),
            prop_row(
                BUILTIN_SYMBOL_ENTITY_TYPE_NAMES.name.singular.capitalize(),
                REL_HDS_OPTIONS_MAP[
                    x.relativity_option_type].directory_symbol_name_text),
            prop_row(
                'Path relativity option', REL_HDS_OPTIONS_MAP[
                    x.relativity_option_type].option_name_text),
        ])

        paras = [
            docs.para(x.conf_param.single_line_description_str),
            properties_table,
        ]
        return docs.list_item(self._tp.text(x.item_name), paras)
    def _dir_item(self, x: _DirInfo) -> HeaderContentListItem:
        def prop_row(header: str, value_str_or_text) -> List[docs.TableCell]:
            return [docs.text_cell(header),
                    docs.text_cell(value_str_or_text),
                    ]

        from exactly_lib.test_case_file_structure.relative_path_options import REL_HOME_OPTIONS_MAP
        properties_table = docs.first_column_is_header_table(
            [
                prop_row('Default value',
                         x.default_value_description),
                prop_row(concepts.CONFIGURATION_PARAMETER_CONCEPT_INFO.singular_name.capitalize(),
                         x.conf_param.configuration_parameter_name_text),
                prop_row('Set by instruction',
                         instruction_name_text(x.instruction_name)),
                prop_row('Variable name',
                         REL_HOME_OPTIONS_MAP[x.relativity_option_type].directory_variable_name_text),
                prop_row('Relativity option',
                         REL_HOME_OPTIONS_MAP[x.relativity_option_type].option_name_text),
            ]
        )

        paras = [
            docs.para(x.conf_param.single_line_description_str),
            properties_table,
        ]
        return docs.list_item(self._tp.text(x.item_name), paras)
예제 #3
0
def _options_for_directories_in_the_(rel_opt_2_rel_option_info: dict,
                                     rel_opts_in_display_order: Sequence) -> List[ParagraphItem]:
    rows = list(map(lambda rel_opt: _mk_dir_info_row(rel_opt_2_rel_option_info[rel_opt]),
                    rel_opts_in_display_order))
    return [
        docs.first_column_is_header_table(rows)
    ]
예제 #4
0
def _options_for_directories_in_the_(rel_opt_2_rel_option_info: dict,
                                     rel_opts_in_display_order: list) -> List[ParagraphItem]:
    rows = list(map(lambda rel_opt: _mk_dir_info_row(rel_opt_2_rel_option_info[rel_opt]),
                    rel_opts_in_display_order))
    return [
        docs.first_column_is_header_table(rows)
    ]
예제 #5
0
파일: utils.py 프로젝트: emilkarlen/exactly
def singe_exit_value_display(exit_value: ExitValue) -> ParagraphItem:
    return first_column_is_header_table([
        [
            cell([para(misc_texts.EXIT_CODE_TITLE)]),
            cell([para(str(exit_value.exit_code))]),
        ],
        [
            cell([para(misc_texts.EXIT_IDENTIFIER_TITLE)]),
            cell([para(exit_value_text(exit_value))]),
        ],
    ])
예제 #6
0
 def _options_for_rel_source_file(self) -> List[ParagraphItem]:
     return ([
                 docs.first_column_is_header_table([
                     [
                         docs.text_cell(syntax_text(REL_source_file_dir_OPTION)),
                     ]
                 ])
             ]
             +
             self._parser.fnap(_REL_SOURCE_FILE_DESCRIPTION)
             )
예제 #7
0
 def _options_for_symbol(self) -> List[ParagraphItem]:
     return ([
                 docs.first_column_is_header_table([
                     [
                         docs.text_cell(syntax_text(render_argument(REL_SYMBOL_OPTION))),
                     ]
                 ])
             ]
             +
             self._parser.fnap(_REL_SYMBOL_DESCRIPTION)
             )
예제 #8
0
 def _options_for_rel_source_file(self) -> List[ParagraphItem]:
     return ([
                 docs.first_column_is_header_table([
                     [
                         docs.text_cell(syntax_text(REL_source_file_dir_OPTION)),
                     ]
                 ])
             ]
             +
             self._parser.fnap(_REL_SOURCE_FILE_DESCRIPTION)
             )
예제 #9
0
 def _options_for_symbol(self) -> List[ParagraphItem]:
     return ([
                 docs.first_column_is_header_table([
                     [
                         docs.text_cell(syntax_text(render_argument(REL_SYMBOL_OPTION))),
                     ]
                 ])
             ]
             +
             self._parser.fnap(_REL_SYMBOL_DESCRIPTION)
             )
예제 #10
0
def singe_exit_value_display(exit_value: ExitValue) -> ParagraphItem:
    return first_column_is_header_table([
        [
            cell([para(misc_texts.EXIT_CODE_TITLE)]),
            cell([para(str(exit_value.exit_code))]),
        ],
        [
            cell([para(misc_texts.EXIT_IDENTIFIER_TITLE)]),
            cell([para(exit_value_text(exit_value))]),
        ],
    ])
예제 #11
0
def _dir_info_items_table(env_var_name: Text,
                          rel_option: Text,
                          env_var_description: str) -> ParagraphItem:
    return docs.first_column_is_header_table([
        [
            docs.cell(docs.paras(env_var_name)),
            docs.cell(docs.paras(env_var_description)),
        ],
        [
            docs.cell(docs.paras(rel_option)),
            docs.cell(docs.paras('This option (accepted by many instructions) refers to this directory.')),
        ],
    ])
예제 #12
0
파일: type_.py 프로젝트: emilkarlen/exactly
def _list_types_in_category(type_category: TypeCategory) -> ParagraphItem:
    from exactly_lib.help.entities.types.contents_structure import TypeDocumentation

    def row(type_doc: TypeDocumentation) -> List[docs.TableCell]:
        return [
            docs.text_cell(type_doc.name().singular),
            docs.text_cell(type_doc.single_line_description()),
        ]

    type_docs = all_types.type_docs_of_type_category(type_category, all_types.all_types())
    rows = list(map(row,
                    sorted(type_docs,
                           key=lambda type_doc: type_doc.name().singular)))
    return docs.first_column_is_header_table(rows, docs.COLON_TABLE_COLUMN_SEPARATOR)
예제 #13
0
def _dir_info_items_table(symbol_name: Text, rel_option: Text,
                          symbol_description: str) -> ParagraphItem:
    return docs.first_column_is_header_table([
        [
            docs.cell(docs.paras(symbol_name)),
            docs.cell(docs.paras(symbol_description)),
        ],
        [
            docs.cell(docs.paras(rel_option)),
            docs.cell(
                docs.paras(
                    'The path relativity option that refers to this directory.'
                )),
        ],
    ])
예제 #14
0
def _list_types_in_category(type_category: TypeCategory) -> ParagraphItem:
    from exactly_lib.help.entities.types.contents_structure import TypeDocumentation

    def row(type_doc: TypeDocumentation) -> List[docs.TableCell]:
        return [
            docs.text_cell(type_doc.singular_name_text),
            docs.text_cell(type_doc.single_line_description()),
        ]

    type_docs = all_types.type_docs_of_type_category(type_category,
                                                     all_types.all_types())
    rows = list(
        map(row,
            sorted(type_docs, key=lambda type_doc: type_doc.name().singular)))
    return docs.first_column_is_header_table(rows,
                                             docs.COLON_TABLE_COLUMN_SEPARATOR)
예제 #15
0
def _symbol_reference_syntax_table() -> ParagraphItem:
    return docs.first_column_is_header_table([
        [
            docs.text_cell('Plain name'),
            docs.text_cell(
                syntax_text(
                    syntax_elements.SYMBOL_NAME_SYNTAX_ELEMENT.argument.name)),
        ],
        [
            docs.text_cell('Special syntax'),
            docs.text_cell(
                syntax_text(
                    symbol_reference_syntax_for_name(
                        syntax_elements.SYMBOL_NAME_SYNTAX_ELEMENT.argument.
                        name))),
        ],
    ], ' : ')
 def _dirs_list(self, tc_dir_infos: List[TcDirInfo]) -> docs.ParagraphItem:
     return docs.first_column_is_header_table([
         self._dir_row(tc_dir_info)
         for tc_dir_info in tc_dir_infos
     ])