rcmpy.watch package — docs

Skip to main content
`Ctrl`+`K`

# rcmpy.watch package

## Submodules

## rcmpy.watch.params module

An interface for implementing file-system watching parameters.

class rcmpy.watch.params.WatchParams(base: Path, directory: Path, cmd: List[str], check_contents: bool, shell: bool = False, single_pass: bool = False, poll_rate: float = 0.1)

  Bases: `NamedTuple`

  Watch task parameters.

  static add_args(parser: ArgumentParser) → None

    Add command-line argument options.

  base: Path

    Alias for field number 0

  check_contents: bool

    Alias for field number 3

  cmd: List[str]

    Alias for field number 2

  directory: Path

    Alias for field number 1

  static from_args(args: Namespace) → WatchParams

    Create watch parameters from parsed arugments.

  poll_rate: float

    Alias for field number 6

  shell: bool

    Alias for field number 4

  single_pass: bool

    Alias for field number 5

## Module contents

An interface for implementing file-system watching tasks.

async rcmpy.watch.command(*args: str, shell: bool = False) → int

  Run a subprocess and return the return code.

async rcmpy.watch.entry(stop_sig: Event, params: WatchParams) → int

  The async entry-point for the watch command.

rcmpy.watch.watch(params: WatchParams) → int | None

  Watch a directory for changes.

rcmpy.watch.watch_cache() → Path

  Obtain a file path to use as a cache.