Debian Codegraph @

jedi/third_party/typeshed/stdlib/webbrowser.pyi

raw symbols SCIP
1 import sys
2 from abc import abstractmethod
3 from collections.abc import Callable, Sequence
4 from typing import Literal
5 from typing_extensions import deprecated
6
7 __all__ = ["Error", "open", "open_new", "open_new_tab", "get", "register"]
8
9 class Error(Exception): ...
10
11 def register(
12 name: str, klass: Callable[[], BaseBrowser] | None, instance: BaseBrowser | None = None, *, preferred: bool = False
13 ) -> None: ...
14 def get(using: str | None = None) -> BaseBrowser: ...
15 def open(url: str, new: int = 0, autoraise: bool = True) -> bool: ...
16 def open_new(url: str) -> bool: ...
17 def open_new_tab(url: str) -> bool: ...
18
19 class BaseBrowser:
20 args: list[str]
21 name: str
22 basename: str
23 def __init__(self, name: str = "") -> None: ...
24 @abstractmethod
25 def open(self, url: str, new: int = 0, autoraise: bool = True) -> bool: ...
26 def open_new(self, url: str) -> bool: ...
27 def open_new_tab(self, url: str) -> bool: ...
28
29 class GenericBrowser(BaseBrowser):
30 def __init__(self, name: str | Sequence[str]) -> None: ...
31 def open(self, url: str, new: int = 0, autoraise: bool = True) -> bool: ...
32
33 class BackgroundBrowser(GenericBrowser): ...
34
35 class UnixBrowser(BaseBrowser):
36 def open(self, url: str, new: Literal[0, 1, 2] = 0, autoraise: bool = True) -> bool: ... # type: ignore[override]
37 raise_opts: list[str] | None
38 background: bool
39 redirect_stdout: bool
40 remote_args: list[str]
41 remote_action: str
42 remote_action_newwin: str
43 remote_action_newtab: str
44
45 class Mozilla(UnixBrowser): ...
46
47 if sys.version_info < (3, 12):
48 class Galeon(UnixBrowser):
49 raise_opts: list[str]
50
51 class Grail(BaseBrowser):
52 def open(self, url: str, new: int = 0, autoraise: bool = True) -> bool: ...
53
54 class Chrome(UnixBrowser): ...
55 class Opera(UnixBrowser): ...
56 class Elinks(UnixBrowser): ...
57
58 class Konqueror(BaseBrowser):
59 def open(self, url: str, new: int = 0, autoraise: bool = True) -> bool: ...
60
61 if sys.platform == "win32":
62 class WindowsDefault(BaseBrowser):
63 def open(self, url: str, new: int = 0, autoraise: bool = True) -> bool: ...
64
65 if sys.platform == "darwin":
66 if sys.version_info < (3, 13):
67 if sys.version_info >= (3, 11):
68 @deprecated("Deprecated since Python 3.11; removed in Python 3.13.")
69 class MacOSX(BaseBrowser):
70 def __init__(self, name: str) -> None: ...
71 def open(self, url: str, new: int = 0, autoraise: bool = True) -> bool: ...
72
73 else:
74 class MacOSX(BaseBrowser):
75 def __init__(self, name: str) -> None: ...
76 def open(self, url: str, new: int = 0, autoraise: bool = True) -> bool: ...
77
78 class MacOSXOSAScript(BaseBrowser): # In runtime this class does not have `name` and `basename`
79 if sys.version_info >= (3, 11):
80 def __init__(self, name: str = "default") -> None: ...
81 else:
82 def __init__(self, name: str) -> None: ...
83
84 def open(self, url: str, new: int = 0, autoraise: bool = True) -> bool: ...