pmb.helpers.run: Add some type hints (MR 2262)

This commit is contained in:
Newbyte 2024-02-20 14:01:27 +01:00 committed by Oliver Smith
parent 85f777073e
commit 5577495dc5
No known key found for this signature in database
GPG Key ID: 5AE7F5513E0885CB
1 changed files with 4 additions and 2 deletions

View File

@ -1,10 +1,12 @@
# Copyright 2023 Oliver Smith
# SPDX-License-Identifier: GPL-3.0-or-later
import pmb.helpers.run_core
from argparse import Namespace
from typing import Any, Dict, List, Optional
def user(args, cmd, working_dir=None, output="log", output_return=False,
check=None, env={}, sudo=False):
def user(args: Namespace, cmd: List[str], working_dir: Optional[str]=None, output: str="log", output_return: bool=False,
check: Optional[bool]=None, env: Dict[Any, Any]={}, sudo: bool=False) -> str:
"""
Run a command on the host system as user.