Ejemplo n.º 1
0
 def __init__(self, name: str):
     format_map = {
         'current_dir': formatting.concept_(concepts.CURRENT_WORKING_DIRECTORY_CONCEPT_INFO),
         'sandbox': formatting.concept_(concepts.SANDBOX_CONCEPT_INFO),
         'SOURCE': instruction_arguments.SOURCE_PATH_ARGUMENT.name,
         'DESTINATION': instruction_arguments.DESTINATION_PATH_ARGUMENT.name,
     }
     super().__init__(name, format_map)
     self._doc_elements = src_dst.DocumentationElements(
         format_map,
         REL_OPTION_ARG_CONF_FOR_SOURCE,
         the_path_of('an existing file or directory.'),
         REL_OPTION_ARG_CONF_FOR_DESTINATION,
         the_path_of('an existing directory, or a non-existing file.')
     )
Ejemplo n.º 2
0
 def syntax_element_descriptions(self) -> list:
     return [
         self._file_contents_sed(),
         rel_path_doc.path_element_2(self._src_rel_opt_arg_conf,
                                     docs.paras(the_path_of('an existing file.'))),
         self._transformation_sed(),
     ]
Ejemplo n.º 3
0
    def syntax_element_descriptions(self) -> List[SyntaxElementDescription]:
        actual_file_arg_sed = path_element(
            self.actual_file_arg.name,
            ACTUAL_RELATIVITY_CONFIGURATION.options,
            self._tp.fnap(the_path_of("the file who's contents is checked."))
        )

        return [actual_file_arg_sed]
Ejemplo n.º 4
0
 def _exe_file() -> InvokationVariant:
     return invokation_variant_from_args(
         [syntax_elements.PATH_SYNTAX_ELEMENT.single_mandatory],
         rel_path_doc.path_element_relativity_paragraphs(
             path_relativities.REL_OPTIONS_CONFIGURATION,
             _TEXT_PARSER.paras(the_path_of('{executable_file:a}.')),
             _TEXT_PARSER.fnap(_DIFFERENT_RELATIVITIES_FOR_PROGRAM_ACTOR),
         ))
Ejemplo n.º 5
0
    def syntax_element_descriptions(self) -> List[SyntaxElementDescription]:
        ret_val = [
            rel_path_doc.path_element(_DST_PATH_ARGUMENT.name,
                                      REL_OPT_ARG_CONF.options,
                                      docs.paras(the_path_of('a non-existing file.'))),
        ]
        ret_val += self._file_contents_doc.syntax_element_descriptions()

        return ret_val
Ejemplo n.º 6
0
    def syntax_element_descriptions(self) -> List[SyntaxElementDescription]:
        actual_file_arg_sed = path_element(
            _PATH_ARGUMENT.name, ACTUAL_RELATIVITY_CONFIGURATION.options,
            docs.paras(
                the_path_of("the directory who's contents is checked.")))

        return [
            actual_file_arg_sed,
            file_or_dir_contents_doc.get_traversal_options_sed(),
        ]
Ejemplo n.º 7
0
 def __init__(self, name: str,
              phase_is_after_act: bool):
     super().__init__(name, {})
     self._src_rel_opt_arg_conf = src_rel_opt_arg_conf_for_phase(phase_is_after_act)
     format_map = {
         'current_dir': formatting.concept_(concepts.CURRENT_WORKING_DIRECTORY_CONCEPT_INFO),
         'sandbox': formatting.concept_(concepts.SDS_CONCEPT_INFO),
         'SOURCE': self._src_rel_opt_arg_conf.argument.name,
         'DESTINATION': REL_OPTION_ARG_CONF_FOR_DESTINATION.argument.name,
         'dir_file_type': file_types.DIRECTORY,
     }
     super().__init__(name, format_map)
     self._doc_elements = src_dst.DocumentationElements(
         format_map,
         self._src_rel_opt_arg_conf,
         the_path_of('an existing file or directory.'),
         REL_OPTION_ARG_CONF_FOR_DESTINATION,
         the_path_of('an existing directory, or a non-existing path.')
     )
Ejemplo n.º 8
0
    def __init__(self):
        super().__init__(TypeCategory.LOGIC,
                         syntax_elements.STRING_MATCHER_SYNTAX_ELEMENT)

        self.matcher_element_name = instruction_arguments.STRING_MATCHER_PRIMITIVE_SYNTAX_ELEMENT
        self.expected_file_arg = a.Option(FILE_ARGUMENT_OPTION,
                                          _EXPECTED_PATH_NAME)
        self.string_or_here_doc_or_file_arg = StringOrHereDocOrFile(
            _EXPECTED_PATH_NAME,
            _RELATIVITY_OF_EXPECTED_PATH_NAME,
            EXPECTED_FILE_REL_OPT_ARG_CONFIG,
            the_path_of('the file that contains the expected contents.'))
        self._parser = TextParser({
            'symbol_concept': formatting.concept_(concepts.SYMBOL_CONCEPT_INFO),
            'expected_file_arg': _EXPECTED_PATH_NAME,
            'any': instruction_arguments.EXISTS_QUANTIFIER_ARGUMENT,
            'every': instruction_arguments.ALL_QUANTIFIER_ARGUMENT,
            'LINE_MATCHER': instruction_arguments.LINE_MATCHER.name,
            'HERE_DOCUMENT': formatting.syntax_element_(syntax_elements.HERE_DOCUMENT_SYNTAX_ELEMENT),
            'INTEGER_COMPARISON': syntax_elements.INTEGER_COMPARISON_SYNTAX_ELEMENT.singular_name,
            'REGEX': syntax_elements.REGEX_SYNTAX_ELEMENT.singular_name,
            'full_regex_match': option_syntax.option_syntax(matcher_options.FULL_MATCH_ARGUMENT_OPTION),
            'this_type': formatting.symbol_type(types.STRING_MATCHER_TYPE_INFO.singular_name),
        })
Ejemplo n.º 9
0
    def syntax_element_descriptions(self) -> List[SyntaxElementDescription]:
        actual_file_arg_sed = path_element(
            self.actual_file_arg.name, ACTUAL_RELATIVITY_CONFIGURATION.options,
            self._tp.fnap(the_path_of("the file who's contents is checked.")))

        return [actual_file_arg_sed]
Ejemplo n.º 10
0
def _executable_file_description() -> Sequence[ParagraphItem]:
    return rel_path_doc.path_element_relativity_paragraphs(
        parse_act_interpreter.EXE_FILE_RELATIVITIES.options,
        _TEXT_PARSER.paras(path_syntax.the_path_of('{executable_file:a}.')),
    )
Ejemplo n.º 11
0
 def sub_syntax_element_definition_trees(self) -> List[SyntaxElementDescriptionTree]:
     return [
         rel_path_doc.path_element_3(PATH_OF_EXISTING_FILE_OPT_CONFIG,
                                     _TEXT_PARSER.paras(the_path_of('an existing file.')))
     ]
Ejemplo n.º 12
0
 def syntax_element_descriptions(self) -> List[SyntaxElementDescription]:
     return [
         rel_path_doc.path_element(_PATH_ARGUMENT.name,
                                   RELATIVITY_VARIANTS.options,
                                   docs.paras(the_path_of('a non-existing file.')))
     ]