def _locatable(path): """Whether that path is wanted in location results >>> not _locatable('/path/to/.svn/file') True """ return not repository.is_repository_path(path)
def tag_directory_recursively(source): """Write tags from the files in/under the directory""" path_to_directory = paths.path(source) tags = read_dirs_tags(path_to_directory) write_tags(path_to_directory, tags) for path_to_sub_directory in path_to_directory.walkdirs(): if repository.is_repository_path(path_to_sub_directory): continue tag_directory(path_to_directory)
def read_dirs(path_to_directory=None): """Read tags for directory/*.py, and recursively under it""" if not path_to_directory: path_to_directory = paths.pwd() tags = read_dir(path_to_directory) for path_to_sub_directory in path_to_directory.walkdirs(): if repository.is_repository_path(path_to_sub_directory): continue tags.append(read_dir(path_to_sub_directory)) return tags
def read_dirs_tags(path_to_directory=None): """Read tags for directory/*.py, and recursively under it""" if not path_to_directory: path_to_directory = paths.pwd() tags = read_dir_tags(path_to_directory) for path_to_sub_directory in path_to_directory.walkdirs(): if repository.is_repository_path(path_to_sub_directory): continue tags.append(read_dir_tags(path_to_sub_directory)) return tags
def read_write_dirs(source=None): """Write tags from the files in/under the directory""" if not source: if scripts.args.directories: [read_write_dirs(d) for d in scripts.args.directories] else: source = paths.pwd() path_to_directory = paths.path(source) tags = read_dirs(path_to_directory) write_dir(path_to_directory, tags) for path_to_sub_directory in path_to_directory.walkdirs(): if repository.is_repository_path(path_to_sub_directory): continue tags = read_dirs(path_to_sub_directory) write_dir(path_to_sub_directory, tags)
def _locatable(path): """Whether that path is wanted in location results""" return not repository.is_repository_path(path)