INNER CODE UNIT · Python

get_podcast_files_from_args

DataTalksClub/datatalksclub.github.io · scripts/add_dateadded_from_git.py:202

def get_podcast_files_from_args(args: argparse.Namespace) -> List[Path]:
    """Collect podcast files based on CLI arguments."""
    files: List[Path] = []
    project_root = get_project_root()

    if args.all:
        # Process all podcast files
        podcast_dir = project_root / '_podcast'
        if not podcast_dir.exists():
            print(f"Error: Podcast directory not found: {podcast_dir}", file=sys.stderr)
            sys.exit(1)
        files = sorted(podcast_dir.glob('*.md'))
        # Exclude template files
        files = [f for f in files if not f.name.startswith('_')]
    
    elif args.all_in_dir:
        # Get all .md files in directory
        dir_path = Path(args.all_in_dir)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…