def __init__(self, src_dir: PathDdv): self._src_dir = src_dir self._validator = path_check.PathCheckDdvValidator( path_check.PathCheckDdv( src_dir, file_properties.must_exist_as( file_properties.FileType.DIRECTORY, follow_symlinks=True)))
def __init__( self, names: NamesSetup, model_constructor: ModelConstructor[CONTENTS_MATCHER_MODEL], contents_matcher: MatcherWTrace[CONTENTS_MATCHER_MODEL], ): super().__init__() self._names = names self._model_constructor = model_constructor self._expected_file_check = file_properties.must_exist_as( names.accepted_file_type, follow_symlinks=True) self._contents_matcher = contents_matcher
def check(self, environment: InstructionEnvironmentForPostSdsStep, os_services: OsServices, files_source: FilesSource) -> FilesSource: expect_existing_dir = file_properties.must_exist_as( file_properties.FileType.DIRECTORY, True) path_resolving_env = environment.path_resolving_environment_pre_or_post_sds failure_message = path_check.pre_or_post_sds_failure_message_or_none( path_check.PathCheck(files_source.path_of_dir, expect_existing_dir), path_resolving_env) if failure_message is not None: raise pfh_ex_method.PfhHardErrorException(failure_message) else: return files_source
def __init__( self, symbol_usages: Sequence[SymbolUsage], interpreter_and_args_validator: SdvValidator, source_file: PathSdv, make_command: Callable[[FullResolvingEnvironment], Command], ): self._symbol_usages = symbol_usages self._source_file = source_file self._make_command = make_command self._validator = sdv_validation.all_of([ interpreter_and_args_validator, PathCheckValidator( PathCheck( source_file, file_properties.must_exist_as( file_properties.FileType.REGULAR))), ])
def _the_property_check() -> sut.FilePropertiesCheck: return sut.must_exist_as(FileType.SYMLINK, False)
def _the_property_check() -> sut.FilePropertiesCheck: return sut.must_exist_as(FileType.DIRECTORY, False)
def _the_property_check(self) -> sut.FilePropertiesCheck: return sut.must_exist_as(FileType.REGULAR)
def __init__(self): super().__init__() self._is_regular_file_check = file_properties.must_exist_as( file_properties.FileType.REGULAR, follow_symlinks=True)
def __init__(self, file_type: FileType, maker: Callable[[DescribedPath], None], ): self._file_check = file_properties.must_exist_as(file_type, follow_symlinks=True) self._maker = maker
def __init__(self, path: PathDdv): self._path = path self._validator = path_check.PathCheckDdvValidator( path_check.PathCheckDdv( path, file_properties.must_exist_as(FileType.REGULAR)))
def get_file_validator(symbols: SymbolTable) -> DdvValidator: return PathCheckDdvValidator( PathCheckDdv(file_that_must_exist.resolve(symbols), file_properties.must_exist_as(file_type)))