| 1 |
import sys |
| 2 |
from _typeshed import StrOrBytesPath |
| 3 |
from typing_extensions import TypeAlias |
| 4 |
|
| 5 |
__all__ = ["netrc", "NetrcParseError"] |
| 6 |
|
| 7 |
class NetrcParseError(Exception): |
| 8 |
filename: str | None |
| 9 |
lineno: int | None |
| 10 |
msg: str |
| 11 |
def __init__(self, msg: str, filename: StrOrBytesPath | None = None, lineno: int | None = None) -> None: ... |
| 12 |
|
| 13 |
|
| 14 |
if sys.version_info >= (3, 11): |
| 15 |
_NetrcTuple: TypeAlias = tuple[str, str, str] |
| 16 |
else: |
| 17 |
_NetrcTuple: TypeAlias = tuple[str, str | None, str | None] |
| 18 |
|
| 19 |
class netrc: |
| 20 |
hosts: dict[str, _NetrcTuple] |
| 21 |
macros: dict[str, list[str]] |
| 22 |
def __init__(self, file: StrOrBytesPath | None = None) -> None: ... |
| 23 |
def authenticators(self, host: str) -> _NetrcTuple | None: ... |