Format: application/octet-stream
⬇ Download File (3.2 KB)
   1  import sys
   2  from typing import Callable, List, Optional, Sequence, Text, Union
   3  
   4  class Error(Exception): ...
   5  
   6  if sys.version_info >= (3, 7):
   7      def register(
   8          name: Text, klass: Optional[Callable[[], BaseBrowser]], instance: Optional[BaseBrowser] = ..., *, preferred: bool = ...
   9      ) -> None: ...
  10  
  11  else:
  12      def register(
  13          name: Text, klass: Optional[Callable[[], BaseBrowser]], instance: Optional[BaseBrowser] = ..., update_tryorder: int = ...
  14      ) -> None: ...
  15  
  16  def get(using: Optional[Text] = ...) -> BaseBrowser: ...
  17  def open(url: Text, new: int = ..., autoraise: bool = ...) -> bool: ...
  18  def open_new(url: Text) -> bool: ...
  19  def open_new_tab(url: Text) -> bool: ...
  20  
  21  class BaseBrowser:
  22      args: List[str]
  23      name: str
  24      basename: str
  25      def __init__(self, name: Text = ...) -> None: ...
  26      def open(self, url: Text, new: int = ..., autoraise: bool = ...) -> bool: ...
  27      def open_new(self, url: Text) -> bool: ...
  28      def open_new_tab(self, url: Text) -> bool: ...
  29  
  30  class GenericBrowser(BaseBrowser):
  31      args: List[str]
  32      name: str
  33      basename: str
  34      def __init__(self, name: Union[Text, Sequence[Text]]) -> None: ...
  35      def open(self, url: Text, new: int = ..., autoraise: bool = ...) -> bool: ...
  36  
  37  class BackgroundBrowser(GenericBrowser):
  38      def open(self, url: Text, new: int = ..., autoraise: bool = ...) -> bool: ...
  39  
  40  class UnixBrowser(BaseBrowser):
  41      raise_opts: List[str]
  42      background: bool
  43      redirect_stdout: bool
  44      remote_args: List[str]
  45      remote_action: str
  46      remote_action_newwin: str
  47      remote_action_newtab: str
  48      def open(self, url: Text, new: int = ..., autoraise: bool = ...) -> bool: ...
  49  
  50  class Mozilla(UnixBrowser):
  51      raise_opts: List[str]
  52      remote_args: List[str]
  53      remote_action: str
  54      remote_action_newwin: str
  55      remote_action_newtab: str
  56      background: bool
  57  
  58  class Galeon(UnixBrowser):
  59      raise_opts: List[str]
  60      remote_args: List[str]
  61      remote_action: str
  62      remote_action_newwin: str
  63      background: bool
  64  
  65  class Chrome(UnixBrowser):
  66      remote_args: List[str]
  67      remote_action: str
  68      remote_action_newwin: str
  69      remote_action_newtab: str
  70      background: bool
  71  
  72  class Opera(UnixBrowser):
  73      raise_opts: List[str]
  74      remote_args: List[str]
  75      remote_action: str
  76      remote_action_newwin: str
  77      remote_action_newtab: str
  78      background: bool
  79  
  80  class Elinks(UnixBrowser):
  81      remote_args: List[str]
  82      remote_action: str
  83      remote_action_newwin: str
  84      remote_action_newtab: str
  85      background: bool
  86      redirect_stdout: bool
  87  
  88  class Konqueror(BaseBrowser):
  89      def open(self, url: Text, new: int = ..., autoraise: bool = ...) -> bool: ...
  90  
  91  class Grail(BaseBrowser):
  92      def open(self, url: Text, new: int = ..., autoraise: bool = ...) -> bool: ...
  93  
  94  if sys.platform == "win32":
  95      class WindowsDefault(BaseBrowser):
  96          def open(self, url: Text, new: int = ..., autoraise: bool = ...) -> bool: ...
  97  
  98  if sys.platform == "darwin":
  99      class MacOSX(BaseBrowser):
 100          name: str
 101          def __init__(self, name: Text) -> None: ...
 102          def open(self, url: Text, new: int = ..., autoraise: bool = ...) -> bool: ...
 103      class MacOSXOSAScript(BaseBrowser):
 104          def __init__(self, name: Text) -> None: ...
 105          def open(self, url: Text, new: int = ..., autoraise: bool = ...) -> bool: ...
 106