Beispiel #1
0
def execution_modes_list() -> ParagraphItem:
    items = [
        docs.list_item(doc_format.enum_name_text(x[0]), x[1])
        for x in _mode_name_and_paragraphs_list()
    ]
    return docs.simple_list_with_space_between_elements_and_content(
        items, lists.ListType.VARIABLE_LIST)
Beispiel #2
0
 def _relativity_options_paragraph(self) -> ParagraphItem:
     return docs.simple_list_with_space_between_elements_and_content([
         docs.list_item(
             self._options_for_directories_in_the(concepts.HDS_CONCEPT_INFO),
             self._options_for_directories_in_the_hds(),
         ),
         docs.list_item(
             self._options_for_directories_in_the(concepts.SDS_CONCEPT_INFO),
             self._options_for_directories_in_the_sds(),
         ),
         docs.list_item(
             self._parser.format('Option for {cd}'),
             self._options_for_current_directory(),
         ),
         docs.list_item(
             self._parser.format('Option for a path denoted by a {symbol}'),
             self._options_for_symbol(),
         ),
         docs.list_item(
             self._parser.format('Option for the location of the current source file'),
             self._options_for_rel_source_file(),
         ),
     ],
         docs.lists.ListType.ITEMIZED_LIST,
     )
Beispiel #3
0
 def _relativity_options_paragraph(self) -> ParagraphItem:
     return docs.simple_list_with_space_between_elements_and_content([
         docs.list_item(
             self._options_for_directories_in_the(concepts.HOME_DIRECTORY_STRUCTURE_CONCEPT_INFO),
             self._options_for_directories_in_the_hds(),
         ),
         docs.list_item(
             self._options_for_directories_in_the(concepts.SANDBOX_CONCEPT_INFO),
             self._options_for_directories_in_the_sds(),
         ),
         docs.list_item(
             self._parser.format('Option for {cd}'),
             self._options_for_current_directory(),
         ),
         docs.list_item(
             self._parser.format('Option for a path denoted by a {symbol}'),
             self._options_for_symbol(),
         ),
         docs.list_item(
             self._parser.format('Option for the location of the current source file'),
             self._options_for_rel_source_file(),
         ),
     ],
         docs.lists.ListType.ITEMIZED_LIST,
     )
 def _dir_structure_list(self) -> List[docs.ParagraphItem]:
     items = [
         self._dir_structure_item(concept, tc_dir_infos)
         for concept, tc_dir_infos in _DIR_STRUCTURES
     ]
     return [
         docs.simple_list_with_space_between_elements_and_content(items, lists.ListType.ITEMIZED_LIST)
     ]
Beispiel #5
0
def _types_list() -> ParagraphItem:
    return docs.simple_list_with_space_between_elements_and_content(
        [
            _types_category_list_item(category)
            for category in type_system.TypeCategory
        ],
        ListType.ITEMIZED_LIST,
    )
Beispiel #6
0
def _categories_list(data_types_header: str, logic_types_header: str) -> ParagraphItem:
    items = [
        docs.list_item(data_types_header,
                       [_list_types_in_category(TypeCategory.DATA)]),
        docs.list_item(logic_types_header,
                       [_list_types_in_category(TypeCategory.LOGIC)]),
    ]
    return docs.simple_list_with_space_between_elements_and_content(items, ListType.ITEMIZED_LIST)
Beispiel #7
0
def _types_categories_list(tp: TextParser) -> ParagraphItem:
    return docs.simple_list_with_space_between_elements_and_content(
        [
            docs.list_item(type_system.TYPE_CATEGORY_NAME[category],
                           tp.fnap(_TYPE_CATEGORY_DESCRIPTION[category]))
            for category in type_system.TypeCategory
        ],
        ListType.ITEMIZED_LIST,
    )
Beispiel #8
0
    def _instruction_groups_list(self) -> List[docs.ParagraphItem]:
        def item(purpose: AssertPhasePurpose) -> lists.HeaderContentListItem:
            info = _INSTRUCTION_TYPES[purpose]
            return docs.list_item(info[0],
                                  self._tp.fnap(info[2]))

        return [
            docs.simple_list_with_space_between_elements_and_content(map(item, list(AssertPhasePurpose)),
                                                                     ListType.ITEMIZED_LIST)
        ]
Beispiel #9
0
 def _grouped_instructions(self, environment: ConstructionEnvironment) -> ParagraphItem:
     items = []
     for group in self.instruction_group_by(self.instruction_set.instruction_documentations):
         items.append(docs.list_item(group.header,
                                     [
                                         self.instruction_set_list(group.instruction_documentations,
                                                                   environment)])
                      )
     return docs.simple_list_with_space_between_elements_and_content(items,
                                                                     ListType.ITEMIZED_LIST)
 def _add_section_for_environment(self, output: List[docs.SectionItem]):
     list_items = []
     list_items += self._current_directory_items()
     list_items += self._environment_variables_items()
     list_items += self._timeout_items()
     list_items += self.doc.execution_environment_info().custom_items
     if list_items:
         properties_list = docs.simple_list_with_space_between_elements_and_content(
             list_items, lists.ListType.ITEMIZED_LIST)
         output.append(docs.section('Environment', [properties_list]))
Beispiel #11
0
    def _instruction_groups_list(self) -> List[docs.ParagraphItem]:
        def item(purpose: AssertPhasePurpose) -> lists.HeaderContentListItem:
            info = _INSTRUCTION_TYPES[purpose]
            return docs.list_item(info[0],
                                  self._tp.fnap(info[2]))

        return [
            docs.simple_list_with_space_between_elements_and_content(map(item, list(AssertPhasePurpose)),
                                                                     ListType.ITEMIZED_LIST)
        ]
 def _add_section_for_environment(self, output: List[docs.SectionItem]):
     list_items = []
     list_items += self._current_directory_items()
     list_items += self._environment_variables_items()
     list_items += self.doc.execution_environment_info().custom_items
     if list_items:
         properties_list = docs.simple_list_with_space_between_elements_and_content(list_items,
                                                                                    lists.ListType.ITEMIZED_LIST)
         output.append(docs.section('Environment',
                                    [properties_list]))
Beispiel #13
0
 def files(self) -> Optional[docs.SectionContents]:
     list_items = [
         docs.list_item(_TP.text(_FILES_WHEN_REPORTING_FOR_A_CASE_HEADER),
                        _TP.fnap(FILES_DESCRIPTION_WITH_DEFAULT_SUITE)),
         docs.list_item(_TP.text(_FILES_WHEN_REPORTING_FOR_A_SUITE_HEADER),
                        _TP.fnap(DEFAULT_SUITE_FILES_DESCRIPTION)),
     ]
     return docs.section_contents([
         docs.simple_list_with_space_between_elements_and_content(
             list_items, docs.lists.ListType.ITEMIZED_LIST)
     ])
Beispiel #14
0
 def _variants_table(self) -> ParagraphItem:
     return docs.simple_list_with_space_between_elements_and_content(
         [
             self._item([
                 syntax_elements.LINE_MATCHER_SYNTAX_ELEMENT.
                 single_mandatory
             ], _DESCRIPTION__LINE_MATCHER),
             self._item(_ARGUMENTS__LINE_NUMS, _DESCRIPTION__LINE_NUMS),
         ],
         lists.ListType.VARIABLE_LIST,
     )
Beispiel #15
0
 def _options_table() -> ParagraphItem:
     return docs.simple_list_with_space_between_elements_and_content(
         [
             SyntaxDescription._item(
                 names.CHARACTER_CASE_TO_LOWER_OPTION_NAME,
                 TextParser({'case': _CASE__LOWER})),
             SyntaxDescription._item(
                 names.CHARACTER_CASE_TO_UPPER_OPTION_NAME,
                 TextParser({'case': _CASE__UPPER})),
         ],
         lists.ListType.VARIABLE_LIST,
     )
Beispiel #16
0
    def _options_table(tp: TextParser) -> ParagraphItem:
        def item(option: a.OptionName,
                 description_template: str) -> lists.HeaderContentListItem:
            return docs.list_item(
                doc_format.syntax_text(option_syntax.option_syntax(option)),
                tp.fnap(description_template))

        return docs.simple_list_with_space_between_elements_and_content(
            [
                item(names.STRIP_TRAILING_SPACE_OPTION_NAME,
                     _DESCRIPTION__TRAILING_SPACE),
                item(names.STRIP_TRAILING_NEW_LINES_OPTION_NAME,
                     _DESCRIPTION__TRAILING_NEW_LINES),
            ],
            lists.ListType.VARIABLE_LIST,
        )
Beispiel #17
0
def sections_short_list(sections: Sequence[SectionDocumentation],
                        default_section_name: str = '',
                        section_concept_name: str = 'section') -> ParagraphItem:
    def add_default_info(doc: SectionDocumentation, output: List[docs.ParagraphItem]):
        if doc.name.plain == default_section_name:
            output.append(default_section_para(section_concept_name))

    def list_item(doc: SectionDocumentation) -> HeaderContentListItem:
        paras = [docs.para(doc.purpose().single_line_description)]
        add_default_info(doc, paras)
        return docs.list_item(doc.syntax_name_cross_ref_text, paras)

    items = map(list_item, sections)
    return docs.simple_list_with_space_between_elements_and_content(
        items,
        lists.ListType.VARIABLE_LIST)
Beispiel #18
0
def execution_modes_list() -> ParagraphItem:
    items = [docs.list_item(doc_format.enum_name_text(x[0]), x[1])
             for x in _mode_name_and_paragraphs_list()]
    return docs.simple_list_with_space_between_elements_and_content(items,
                                                                    lists.ListType.VARIABLE_LIST)
Beispiel #19
0
"""
_DIRECTORY_SPECIFICATIONS_HEADER = 'Directory specifications:'

_FOOTER = """\
For a literal match, wrap the meta-characters in brackets. For example, '[?]' matches the character '?'.
"""

_PATTERNS = docs.simple_list_with_space_between_elements_and_content([
    docs.list_item(syntax_text('?'),
                   docs.paras('Matches any single character.')
                   ),
    docs.list_item(syntax_text('*'),
                   docs.paras('Matches any number of any characters including none.')
                   ),
    docs.list_item(syntax_text('[CHARACTERS]'),
                   docs.paras('Matches a single character that is listed in CHARACTERS.')
                   ),
    docs.list_item(syntax_text('[CHARACTER-CHARACTER]'),
                   docs.paras('Matches a single character in the given range.')
                   ),
    docs.list_item(syntax_text('[!CHARACTERS]'),
                   docs.paras('Matches a single character that is not listed in CHARACTERS.')
                   ),
],
    lists.ListType.ITEMIZED_LIST)

_DIRECTORY_SPECIFICATIONS = docs.simple_list_with_space_between_elements_and_content([
    docs.list_item(syntax_text('/'),
                   docs.paras('Directory separator.')
                   ),
],
    lists.ListType.ITEMIZED_LIST)
Beispiel #20
0
_FOOTER = """\
For a literal match, wrap the meta-characters in brackets. For example, '[?]' matches the character '?'.


A patterns cannot denote an absolute path.
"""

_PATTERNS = docs.simple_list_with_space_between_elements_and_content([
    docs.list_item(syntax_text('?'),
                   docs.paras('Matches any single character.')
                   ),
    docs.list_item(syntax_text('*'),
                   docs.paras('Matches any number of any characters including none.')
                   ),
    docs.list_item(syntax_text('[CHARACTERS]'),
                   docs.paras('Matches a single character that is listed in CHARACTERS.   ')
                   ),
    docs.list_item(syntax_text('[CHARACTER-CHARACTER]'),
                   docs.paras('Matches a single character in the given range.')
                   ),
    docs.list_item(syntax_text('[!CHARACTER-SET]'),
                   docs.paras('Matches a single character NOT in CHARACTER-SET.')
                   ),
],
    lists.ListType.ITEMIZED_LIST)

_DIRECTORY_SPECIFICATIONS = docs.simple_list_with_space_between_elements_and_content([
    docs.list_item(syntax_text('**'),
                   docs.paras('The directory where the pattern is applied, and all subdirectories, recursively.')
                   ),
    docs.list_item(syntax_text('/'),
                   docs.paras('Directory separator.')