def def_instruction_rel_cd_description(path_arg_name: str) -> List[ParagraphItem]: tp = TextParser({ 'current_directory_concept': formatting.concept_( concepts.CURRENT_WORKING_DIRECTORY_CONCEPT_INFO), 'path_arg': path_arg_name, 'symbol_concept': formatting.concept(concepts.SYMBOL_CONCEPT_INFO.singular_name), 'symbols_concept': formatting.concept(concepts.SYMBOL_CONCEPT_INFO.plural_name), }) return tp.fnap(_DEF_INSTRUCTION_REL_CD_DESCRIPTION)
def def_instruction_rel_cd_description(path_arg_name: str) -> List[ParagraphItem]: tp = TextParser({ 'current_directory_concept': formatting.concept_( concepts.CURRENT_WORKING_DIRECTORY_CONCEPT_INFO), 'path_arg': path_arg_name, 'symbol_concept': formatting.concept(concepts.SYMBOL_CONCEPT_INFO.singular_name), 'symbols_concept': formatting.concept(concepts.SYMBOL_CONCEPT_INFO.plural_name), 'Note': headers.NOTE_LINE_HEADER, }) return tp.fnap(_DEF_INSTRUCTION_REL_CD_DESCRIPTION)
def __init__(self): super().__init__(concepts.HOME_DIRECTORY_STRUCTURE_CONCEPT_INFO) self._tp = TextParser({ 'HDS': formatting.concept_(concepts.HOME_DIRECTORY_STRUCTURE_CONCEPT_INFO), 'phase': phase_names.PHASE_NAME_DICTIONARY, 'program_name': formatting.program_name(program_info.PROGRAM_NAME), 'symbol': formatting.concept_(concepts.SYMBOL_CONCEPT_INFO), 'symbols': formatting.concept(concepts.SYMBOL_CONCEPT_INFO.plural_name), 'conf_params': formatting.concept(concepts.CONFIGURATION_PARAMETER_CONCEPT_INFO.plural_name), 'PATH': syntax_elements.PATH_SYNTAX_ELEMENT.singular_name, })
def __init__(self, name: str, is_in_assert_phase: bool = False): self.name = syntax_elements.SYMBOL_NAME_SYNTAX_ELEMENT.argument self.string_value = syntax_elements.STRING_SYNTAX_ELEMENT.argument super().__init__(name, { 'NAME': self.name.name, 'current_directory_concept': formatting.concept_( concepts.CURRENT_WORKING_DIRECTORY_CONCEPT_INFO), 'PATH_ARG': _PATH_ARGUMENT.name, 'SYMBOL_CONCEPT': formatting.concept(concepts.SYMBOL_CONCEPT_INFO.singular_name), 'SYMBOLS_CONCEPT': formatting.concept(concepts.SYMBOL_CONCEPT_INFO.plural_name), }, is_in_assert_phase)
def purpose(self) -> DescriptionWithSubSections: tp = TextParser({ 'cd_concept': formatting.concept(self.singular_name()), 'CD': self.acronym(), 'program_name': formatting.program_name(program_info.PROGRAM_NAME), 'sds_concept': formatting.concept_(concepts.SDS_CONCEPT_INFO), 'act_sub_dir': SUB_DIRECTORY__ACT + '/', 'path_type': formatting.symbol_type_(types.PATH_TYPE_INFO), 'act_phase': phase_names.ACT.emphasis, 'rel_cd_option': formatting.cli_option(path.REL_CWD_OPTION), 'cd_instruction': InstructionName(instruction_names.CHANGE_DIR_INSTRUCTION_NAME), 'def_instruction': InstructionName(instruction_names.SYMBOL_DEFINITION_INSTRUCTION_NAME), 'instruction': concepts.INSTRUCTION_CONCEPT_INFO.name, 'os_process': misc_texts.OS_PROCESS_NAME, }) return DescriptionWithSubSections( self.single_line_description(), SectionContents( tp.fnap(_INITIAL_PARAGRAPHS), [ docs.section( tp.text(_USING_THE_CD_HEADER), tp.fnap(_USING_THE_CD) ), docs.section( tp.text(_DESCRIPTION_DEF_INSTRUCTION_HEADER), cd_instruction_section_on_def_instruction() ), ] ))
def cd_instruction_section_on_def_instruction() -> List[ParagraphItem]: tp = TextParser({ 'current_directory_concept': formatting.concept_(concepts.CURRENT_WORKING_DIRECTORY_CONCEPT_INFO), 'def_instruction': InstructionName(instruction_names.SYMBOL_DEFINITION_INSTRUCTION_NAME), 'symbol_concept': formatting.concept(concepts.SYMBOL_CONCEPT_INFO.singular_name), 'rel_cd_option': formatting.cli_option(file_ref.REL_CWD_OPTION), 'path_type': formatting.keyword(types.PATH_TYPE_INFO.name.singular), }) return tp.fnap(_CD_INSTRUCTION_SECTION_ON_DEF_INSTRUCTION)
def cd_instruction_section_on_def_instruction() -> List[ParagraphItem]: tp = TextParser({ 'current_directory_concept': formatting.concept_(concepts.CURRENT_WORKING_DIRECTORY_CONCEPT_INFO), 'def_instruction': InstructionName(instruction_names.SYMBOL_DEFINITION_INSTRUCTION_NAME), 'symbol_concept': formatting.concept(concepts.SYMBOL_CONCEPT_INFO.singular_name), 'rel_cd_option': formatting.cli_option(path.REL_CWD_OPTION), 'path_type': types.PATH_TYPE_INFO.name, }) return tp.fnap(_CD_INSTRUCTION_SECTION_ON_DEF_INSTRUCTION)
def __init__(self): super().__init__(TypeCategory.DATA, syntax_elements.STRING_SYNTAX_ELEMENT) self._tp = TextParser({ 'string_type': formatting.keyword(types.STRING_TYPE_INFO.name.singular), 'list_type': formatting.keyword(types.LIST_TYPE_INFO.name.singular), 'path_type': formatting.keyword(types.PATH_TYPE_INFO.name.singular), 'symbol': formatting.concept_(concepts.SYMBOL_CONCEPT_INFO), 'CHR': 'CHARACTER', 'SOFT_Q': token.SOFT_QUOTE_CHAR, 'HARD_Q': token.HARD_QUOTE_CHAR, 'soft_quotes': formatting.concept(token.SOFT_QUOTE_NAME.plural), 'hard_quotes': formatting.concept(token.HARD_QUOTE_NAME.plural), 'SYMBOL_REFERENCE_SYNTAX_ELEMENT': syntax_elements.SYMBOL_REFERENCE_SYNTAX_ELEMENT.singular_name, 'REL_CD_OPTION': file_ref.REL_CWD_OPTION, })
def purpose(self) -> DescriptionWithSubSections: tp = TextParser({ 'the_concept': formatting.concept(self.name().singular), 'preprocessor_option': formatting.cli_option(OPTION_FOR_PREPROCESSOR), 'is_a_shell_cmd': misc_texts.IS_A_SHELL_CMD, 'an_exit_code': misc_texts.EXIT_CODE.singular_determined.capitalize(), }) return from_simple_description( Description(self.single_line_description(), tp.fnap(_DESCRIPTION_REST)))
def path_type_path_rendering() -> SectionItem: tp = TextParser({ 'current_directory_concept': formatting.concept_(concepts.CURRENT_WORKING_DIRECTORY_CONCEPT_INFO), 'def_instruction': InstructionName(instruction_names.SYMBOL_DEFINITION_INSTRUCTION_NAME), 'symbol_concept': formatting.concept(concepts.SYMBOL_CONCEPT_INFO.singular_name), 'rel_cd_option': formatting.cli_option(file_ref.REL_CWD_OPTION), 'path_type': formatting.keyword(types.PATH_TYPE_INFO.name.singular), }) return Section(tp.text(_PATH_TYPE_PATH_RENDERING_DESCRIPTION_HEADER), tp.section_contents(_PATH_TYPE_PATH_RENDERING_DESCRIPTION))
def __init__(self, name: str, instruction_set: SectionInstructionSet): super().__init__(name, instruction_set) self._parser = TextParser({ 'configuration_parameters': formatting.concept(concepts.CONFIGURATION_PARAMETER_CONCEPT_INFO.plural_name), 'execution_mode': formatting.conf_param_(conf_params.TEST_CASE_STATUS_CONF_PARAM_INFO), 'SKIP': NAME_SKIP, 'setup': phase_names.SETUP, })
def path_type_path_rendering() -> SectionItem: tp = TextParser({ 'current_directory_concept': formatting.concept_(concepts.CURRENT_WORKING_DIRECTORY_CONCEPT_INFO), 'def_instruction': InstructionName(instruction_names.SYMBOL_DEFINITION_INSTRUCTION_NAME), 'symbol_concept': formatting.concept(concepts.SYMBOL_CONCEPT_INFO.singular_name), 'rel_cd_option': formatting.cli_option(path.REL_CWD_OPTION), 'path_type': types.PATH_TYPE_INFO.name, 'external_program': misc_texts.EXTERNAL_PROGRAM, 'os_process': misc_texts.OS_PROCESS_NAME, 'Note': headers.NOTE_LINE_HEADER, }) return Section(tp.text(_PATH_TYPE_PATH_RENDERING_DESCRIPTION_HEADER), tp.section_contents(_PATH_TYPE_PATH_RENDERING_DESCRIPTION))
def __init__(self, name: str): super().__init__(name, {}) self._tp = TextParser({ 'stdin': misc_texts.STDIN, 'atc': formatting.concept(concepts.ACTION_TO_CHECK_NAME.singular), 'PROGRAM': syntax_elements.PROGRAM_SYNTAX_ELEMENT.singular_name, 'run_program_actor': formatting.entity_(actors.COMMAND_LINE_ACTOR), 'actor': formatting.concept_(concepts.ACTOR_CONCEPT_INFO), })
def purpose(self) -> DescriptionWithSubSections: tp = TextParser({ 'the_concept': formatting.concept(self.name().singular), 'preprocessor_option': formatting.cli_option(OPTION_FOR_PREPROCESSOR), 'is_a_system_cmd': misc_texts.IS_A_SYSTEM_CMD, 'exit_code': misc_texts.EXIT_CODE, }) return from_simple_description( Description(self.single_line_description(), tp.fnap(_DESCRIPTION_REST)))
def __init__(self): super().__init__(concepts.HDS_CONCEPT_INFO) self._tp = TextParser({ 'HDS': concepts.HDS_CONCEPT_INFO.acronym, 'hds_concept': formatting.concept_(concepts.HDS_CONCEPT_INFO), 'phase': phase_names.PHASE_NAME_DICTIONARY, 'program_name': formatting.program_name(program_info.PROGRAM_NAME), 'symbol': formatting.concept_(concepts.SYMBOL_CONCEPT_INFO), 'symbols': formatting.concept(concepts.SYMBOL_CONCEPT_INFO.plural_name), 'conf_params': formatting.concept( concepts.CONFIGURATION_PARAMETER_CONCEPT_INFO.plural_name), 'PATH': syntax_elements.PATH_SYNTAX_ELEMENT.singular_name, 'Note': headers.NOTE_LINE_HEADER, })
def __init__(self, name: str, instruction_set: SectionInstructionSet): super().__init__(name, instruction_set) self._parser = TextParser({ 'configuration_parameters': formatting.concept( concepts.CONFIGURATION_PARAMETER_CONCEPT_INFO.plural_name), 'execution_mode': formatting.conf_param_( conf_params.TEST_CASE_STATUS_CONF_PARAM_INFO), 'SKIP': NAME_SKIP, 'setup': phase_names.SETUP, })
def purpose(self) -> DescriptionWithSubSections: tp = TextParser({ 'cd_concept': formatting.concept(self.singular_name()), 'CD': self.acronym(), 'program_name': formatting.program_name(program_info.PROGRAM_NAME), 'sds_concept': formatting.concept_(concepts.SANDBOX_CONCEPT_INFO), 'act_sub_dir': SUB_DIRECTORY__ACT + '/', 'path_type': formatting.symbol_type_(types.PATH_TYPE_INFO), 'act_phase': phase_names.ACT.syntax, 'rel_cd_option': formatting.cli_option(file_ref.REL_CWD_OPTION), 'cd_instruction': InstructionName(instruction_names.CHANGE_DIR_INSTRUCTION_NAME), 'run_instruction': InstructionName(instruction_names.RUN_INSTRUCTION_NAME), 'shell_instruction': InstructionName(instruction_names.SHELL_INSTRUCTION_NAME), 'def_instruction': InstructionName(instruction_names.SYMBOL_DEFINITION_INSTRUCTION_NAME), 'os_process': misc_texts.OS_PROCESS_NAME, }) return DescriptionWithSubSections( self.single_line_description(), SectionContents( tp.fnap(_INITIAL_PARAGRAPHS), [ docs.section( tp.text(_USING_THE_CD_HEADER), tp.fnap(_USING_THE_CD) ), docs.section( tp.text(_DESCRIPTION_DEF_INSTRUCTION_HEADER), cd_instruction_section_on_def_instruction() ), ] ))
ACTION_TO_CHECK_NAME = NameWithGender('an', 'action to check', "actions to check") _FORMAT_MAP = { 'program_name': formatting.program_name(program_info.PROGRAM_NAME), 'phase': phase_names.PHASE_NAME_DICTIONARY, 'act': phase_infos.ACT.name, 'assert': phase_infos.ASSERT.name, 'actor': formatting.concept(all_entity_types.ACTOR_ENTITY_TYPE_NAMES.name.singular), 'action_to_check': formatting.concept(ACTION_TO_CHECK_NAME.singular), 'current_directory_concept': formatting.concept(_CURRENT_DIRECTORY_SINGULAR), 'os_process': misc_texts.OS_PROCESS_NAME, } def _format(s: str) -> str: return s.format_map(_FORMAT_MAP) _CONFIGURATION_PARAMETER_SINGLE_LINE_DESCRIPTION = """\ A value set in the {0} phase that determine how the remaining phases are executed."""
def root(header: str) -> generator.SectionHierarchyGenerator: tp = TextParser({ 'program_name': formatting.program_name(program_info.PROGRAM_NAME), 'conf_param': formatting.concept_(concepts.CONFIGURATION_PARAMETER_CONCEPT_INFO), 'tcds_concept': formatting.concept_(concepts.TCDS_CONCEPT_INFO), 'TCDS': concepts.TCDS_CONCEPT_INFO.acronym, 'SDS': concepts.SDS_CONCEPT_INFO.acronym, 'sds_concept': formatting.concept_(concepts.SDS_CONCEPT_INFO), 'Sds_concept_header': concepts.SDS_CONCEPT_INFO.singular_name.capitalize(), 'sds_single_line_description': concepts.SDS_CONCEPT_INFO.single_line_description_str.capitalize(), 'HDS': concepts.HDS_CONCEPT_INFO.acronym, 'hds_concept': formatting.concept_(concepts.HDS_CONCEPT_INFO), 'Hds_concept_header': concepts.HDS_CONCEPT_INFO.singular_name.capitalize(), 'hds_single_line_description': concepts.HDS_CONCEPT_INFO.single_line_description_str.capitalize(), 'conf_phase': phase_names.CONFIGURATION, 'act_phase': phase_names.ACT, 'act_hds_conf_param': formatting.conf_param(test_case_file_structure.HDS_ACT_INFO.identifier), 'path_type': types.PATH_TYPE_INFO.name, 'symbol_concept': formatting.concept_(concepts.SYMBOL_CONCEPT_INFO), 'def_instruction': InstructionName(instruction_names.SYMBOL_DEFINITION_INSTRUCTION_NAME), 'os_process': misc_texts.OS_PROCESS_NAME, 'env_var': concepts.ENVIRONMENT_VARIABLE_CONCEPT_INFO.name, 'timeout': concepts.TIMEOUT_CONCEPT_INFO.name, 'timeout_instruction': InstructionName(instruction_names.TIMEOUT_INSTRUCTION_NAME), 'type': concepts.TYPE_CONCEPT_INFO.name, 'instruction': concepts.INSTRUCTION_CONCEPT_INFO.name, 'relativity': formatting.concept(misc_texts.RELATIVITY.singular), 'relativities': formatting.concept(misc_texts.RELATIVITY.plural), 'cd': formatting.emphasis(instruction_names.CHANGE_DIR_INSTRUCTION_NAME), 'env': formatting.emphasis(instruction_names.ENV_VAR_INSTRUCTION_NAME), 'CD': formatting.concept_(concepts.CURRENT_WORKING_DIRECTORY_CONCEPT_INFO), }) def const_paragraphs_child(local_target_name: str, header_: str, paragraphs_: List[ParagraphItem]) -> generator.SectionHierarchyGenerator: return h.child(local_target_name, h.leaf(header_, sections.constant_contents(section_contents(paragraphs_))) ) return h.hierarchy( header, children=[ h.child_hierarchy( 'dir-structure', 'Directory structure and Current directory', paragraphs.constant(tp.fnap(_DS_CD_PREAMBLE)), [ const_paragraphs_child( 'sds', concepts.SDS_CONCEPT_INFO.singular_name.capitalize() + ' and Current directory', tp.fnap(_SDS_AND_CD) ), const_paragraphs_child( 'hds', concepts.HDS_CONCEPT_INFO.singular_name.capitalize(), tp.fnap(_HDS), ), const_paragraphs_child( 'file-ref', 'File references', tp.fnap(_FILE_REFERENCES) ), h.leaf_not_in_toc( see_also.SEE_ALSO_TITLE, see_also.SeeAlsoSectionContentsConstructor( see_also.items_of_targets(_dir_struct_see_also_targets()) )), ] ), h.child_hierarchy( 'symbols', concepts.SYMBOL_CONCEPT_INFO.plural_name.capitalize(), paragraphs.constant(tp.fnap(_SYMBOLS)), [ h.leaf_not_in_toc( see_also.SEE_ALSO_TITLE, see_also.SeeAlsoSectionContentsConstructor( see_also.items_of_targets(_symbols_see_also_targets()) )) ] ), h.child_hierarchy( 'os-proc', tp.text(misc_texts.OS_PROCESS_ENVIRONMENT_SECTION_HEADER), paragraphs.constant(tp.fnap(_OS_PROC_INTRO)), [ const_paragraphs_child( 'cd', 'Current directory', tp.fnap(_OS_PROC_CURRENT_DIRECTORY), ), const_paragraphs_child( 'env-vars', tp.format('{env_var:s/u}'), environment_variable.common_description(), ), const_paragraphs_child( 'timeout', 'Timeout', tp.fnap(_OS_PROC_TIMEOUT), ), h.leaf_not_in_toc( see_also.SEE_ALSO_TITLE, see_also.SeeAlsoSectionContentsConstructor( see_also.items_of_targets(_os_process_see_also_targets()) ) ), ], ), ] )
def root(header: str) -> generator.SectionHierarchyGenerator: tp = TextParser({ 'program_name': formatting.program_name(program_info.PROGRAM_NAME), 'conf_param': formatting.concept_(concepts.CONFIGURATION_PARAMETER_CONCEPT_INFO), 'tcds_concept': formatting.concept_(concepts.TEST_CASE_DIRECTORY_STRUCTURE_CONCEPT_INFO), 'TCDS': concepts.TEST_CASE_DIRECTORY_STRUCTURE_CONCEPT_INFO.acronym, 'SDS': concepts.SANDBOX_CONCEPT_INFO.acronym, 'sds_concept': formatting.concept_(concepts.SANDBOX_CONCEPT_INFO), 'Sds_concept_header': concepts.SANDBOX_CONCEPT_INFO.singular_name.capitalize(), 'sds_single_line_description': concepts.SANDBOX_CONCEPT_INFO.single_line_description_str.capitalize(), 'HDS': concepts.HOME_DIRECTORY_STRUCTURE_CONCEPT_INFO.acronym, 'hds_concept': formatting.concept_(concepts.HOME_DIRECTORY_STRUCTURE_CONCEPT_INFO), 'Hds_concept_header': concepts.HOME_DIRECTORY_STRUCTURE_CONCEPT_INFO.singular_name.capitalize(), 'hds_single_line_description': concepts.HOME_DIRECTORY_STRUCTURE_CONCEPT_INFO.single_line_description_str.capitalize(), 'conf_phase': phase_names.CONFIGURATION, 'act_phase': phase_names.ACT, 'act_home_conf_param': formatting.conf_param(test_case_file_structure.HDS_ACT_INFO.identifier), 'data': type_system.DATA_TYPE_CATEGORY_NAME, 'path_type': formatting.term(types.PATH_TYPE_INFO.singular_name), 'symbol_concept': formatting.concept_(concepts.SYMBOL_CONCEPT_INFO), 'def_instruction': InstructionName(instruction_names.SYMBOL_DEFINITION_INSTRUCTION_NAME), 'os_process': misc_texts.OS_PROCESS_NAME, 'time_out_conf_param': formatting.conf_param_(conf_params.TIMEOUT_CONF_PARAM_INFO), 'relativity': formatting.concept(misc_texts.RELATIVITY.singular), 'relativities': formatting.concept(misc_texts.RELATIVITY.plural), 'cd': formatting.emphasis(instruction_names.CHANGE_DIR_INSTRUCTION_NAME), 'env': formatting.emphasis(instruction_names.ENV_VAR_INSTRUCTION_NAME), 'CD': formatting.concept_(concepts.CURRENT_WORKING_DIRECTORY_CONCEPT_INFO), }) def const_paragraphs_child(local_target_name: str, header_: str, paragraphs_: List[ParagraphItem]) -> generator.SectionHierarchyGenerator: return h.child(local_target_name, h.leaf(header_, sections.constant_contents(section_contents(paragraphs_))) ) return h.hierarchy( header, children=[ h.child_hierarchy( 'dir-structure', 'Directory structure and Current directory', paragraphs.constant(tp.fnap(_DS_CD_PREAMBLE)), [ const_paragraphs_child( 'sds', concepts.SANDBOX_CONCEPT_INFO.singular_name.capitalize() + ' and Current directory', tp.fnap(_SDS_AND_CD) ), const_paragraphs_child( 'hds', concepts.HOME_DIRECTORY_STRUCTURE_CONCEPT_INFO.singular_name.capitalize(), tp.fnap(_HDS), ), const_paragraphs_child( 'file-ref', 'File references', tp.fnap(_FILE_REFERENCES) ), h.child('see-also', h.with_not_in_toc( h.leaf( see_also.SEE_ALSO_TITLE, see_also.SeeAlsoSectionContentsConstructor( see_also.items_of_targets(_dir_struct_see_also_targets()) ))) ), ] ), h.child_hierarchy( 'symbols', concepts.SYMBOL_CONCEPT_INFO.plural_name.capitalize(), paragraphs.constant(tp.fnap(_SYMBOLS)), [ h.with_not_in_toc( h.child_leaf( 'see-also', see_also.SEE_ALSO_TITLE, see_also.SeeAlsoSectionContentsConstructor( see_also.items_of_targets(_symbols_see_also_targets()) )) ) ] ), h.child_hierarchy( 'os-proc', tp.text('{os_process} environment'), paragraphs.constant(tp.fnap(_OS_PROC_INTRO)), [ const_paragraphs_child( 'cd', 'Current directory', tp.fnap(_OS_PROC_CURRENT_DIRECTORY), ), const_paragraphs_child( 'env-vars', 'Environment variables', tp.fnap(_OS_PROC_ENVIRONMENT_VARIABLES), ), const_paragraphs_child( 'timeout', 'Timeout', tp.fnap(_OS_PROC_TIMEOUT), ), h.with_not_in_toc( h.child_leaf( 'see-also', see_also.SEE_ALSO_TITLE, see_also.SeeAlsoSectionContentsConstructor( see_also.items_of_targets(_os_process_see_also_targets()) ))) , ], ), ] )