Skip to content

watcher ¤

Repositories watcher.

Classes:

Functions:

GracefulExit ¤

GracefulExit()

Signal handler to exit gracefully.

Methods:

  • sleep

    Sleep for a bit.

sleep ¤

sleep(seconds: int) -> None

Sleep for a bit.

Parameters:

  • seconds (int) –

    Number of seconds of sleep.

start_watcher ¤

start_watcher(
    *,
    conf_path: str | Path = DEFAULT_CONF_PATH,
    repo_dir: str | Path = DEFAULT_REPO_DIR,
    index_url: str = DEFAULT_INDEX_URL,
    sleep: int = DEFAULT_WATCHER_SLEEP
) -> None

Start the watcher in the background.

Parameters:

  • conf_path (str | Path, default: DEFAULT_CONF_PATH ) –

    The path to the configuration file.

  • repo_dir (str | Path, default: DEFAULT_REPO_DIR ) –

    The directory in which the repositories are cloned.

  • index_url (str, default: DEFAULT_INDEX_URL ) –

    The URL of the PyPI index to upload to.

  • sleep (int, default: DEFAULT_WATCHER_SLEEP ) –

    The time to sleep in between iterations, in seconds.

stop_watcher ¤

stop_watcher() -> bool

Stop the watcher.

Returns:

  • bool

    Whether a process was killed or not.

watcher_logs ¤

watcher_logs() -> None

Show the watcher logs.

watcher_loop ¤

watcher_loop(
    *,
    conf_path: str | Path = DEFAULT_CONF_PATH,
    repo_dir: str | Path = DEFAULT_REPO_DIR,
    index_url: str = DEFAULT_INDEX_URL,
    sleep: int = DEFAULT_WATCHER_SLEEP
) -> None

Run the watcher in the foreground.

Parameters:

  • conf_path (str | Path, default: DEFAULT_CONF_PATH ) –

    The path to the configuration file.

  • repo_dir (str | Path, default: DEFAULT_REPO_DIR ) –

    The directory containing the repository clones.

  • index_url (str, default: DEFAULT_INDEX_URL ) –

    The URL of the PyPI index to upload to.

  • sleep (int, default: DEFAULT_WATCHER_SLEEP ) –

    The time to sleep in between iterations, in seconds.

watcher_status ¤

watcher_status() -> dict | None

Return the watcher status as a dict of metadata.

Returns:

  • dict | None

    Some metadata about the watcher process.