INNER CODE UNIT · Python

InstallationError

PKU-EMBL/BASALT · BASALT_setup_China_mainland.py:67

class InstallationError(RuntimeError):
    """A user-facing installation failure."""


def quote_command(command: Sequence[str]) -> str:
    """Return a shell-readable command without executing it through a shell."""
    return shlex.join([str(item) for item in command])


def run_command(
    command: Sequence[str],
    cwd: Optional[Path] = None,
    env: Optional[Dict[str, str]] = None,
    dry_run: bool = False,
    capture: bool = False,
) -> subprocess.CompletedProcess:
    """Run a command safely, or print it in dry-run mode."""
    location = " (in {})".format(cwd) if cwd else ""

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…