File: netrc.pyi

package info (click to toggle)
typeshed 0.0~git20241223.ea91db2-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 28,756 kB
  • sloc: python: 7,741; makefile: 20; sh: 18
file content (23 lines) | stat: -rw-r--r-- 745 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import sys
from _typeshed import StrOrBytesPath
from typing_extensions import TypeAlias

__all__ = ["netrc", "NetrcParseError"]

class NetrcParseError(Exception):
    filename: str | None
    lineno: int | None
    msg: str
    def __init__(self, msg: str, filename: StrOrBytesPath | None = None, lineno: int | None = None) -> None: ...

# (login, account, password) tuple
if sys.version_info >= (3, 11):
    _NetrcTuple: TypeAlias = tuple[str, str, str]
else:
    _NetrcTuple: TypeAlias = tuple[str, str | None, str | None]

class netrc:
    hosts: dict[str, _NetrcTuple]
    macros: dict[str, list[str]]
    def __init__(self, file: StrOrBytesPath | None = None) -> None: ...
    def authenticators(self, host: str) -> _NetrcTuple | None: ...