File: cmd.py

package info (click to toggle)
python-plumbum 1.9.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,300 kB
  • sloc: python: 10,016; makefile: 130; sh: 8
file content (11 lines) | stat: -rw-r--r-- 328 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
from __future__ import annotations

import plumbum


def __getattr__(name: str) -> plumbum.machines.LocalCommand:
    """The module-hack that allows us to use ``from plumbum.cmd import some_program``"""
    try:
        return plumbum.local[name]
    except plumbum.CommandNotFound:
        raise AttributeError(name) from None