Skip to content

dp3.bin.setup

DP3 Setup Script for creating a DP3 application.

replace_template

replace_template(directory: Path, template: str, replace_with: str)

Replace all occurrences of template with the given text.

Source code in dp3/bin/setup.py
def replace_template(directory: Path, template: str, replace_with: str):
    """Replace all occurrences of `template` with the given text."""
    for file in directory.rglob("*"):
        if file.is_file():
            replace_template_file(file, template, replace_with)

init_parser

init_parser(parser)

Initialize an argparse object to parse the project directory and the app name.

Source code in dp3/bin/setup.py
def init_parser(parser):
    """
    Initialize an argparse object to parse the project directory and the app name.
    """
    parser.add_argument("project_dir", help="The project directory.", type=str)
    parser.add_argument("app_name", help="The name of the application.", type=str)