run_tribler =========== .. py:module:: run_tribler Attributes ---------- .. autoapisummary:: run_tribler.logger run_tribler.__restart Classes ------- .. autoapisummary:: run_tribler.Arguments Functions --------- .. autoapisummary:: run_tribler.show_error run_tribler.parse_args run_tribler.get_root_state_directory run_tribler.start_download run_tribler.init_config run_tribler.load_torrent_uri run_tribler.mac_event_loop run_tribler.open_webbrowser_tab run_tribler.recolor_tray_icon run_tribler.spawn_tray_icon run_tribler.main Module Contents --------------- .. py:function:: show_error(exc: Exception, shutdown: Literal[True] = True) -> NoReturn show_error(exc: Exception, shutdown: Literal[False] = True) -> None Create a native pop-up without any third party dependency. :param exc: the error to show to the user :param shutdown: whether to shut down after showing the error .. py:data:: logger .. py:class:: Arguments Bases: :py:obj:`TypedDict` The possible command-line arguments to the core process. .. py:attribute:: torrent :type: str .. py:attribute:: log_level :type: str .. py:attribute:: server :type: bool .. py:function:: parse_args() -> Arguments Parse the command-line arguments. .. py:function:: get_root_state_directory(requested_path: os.PathLike | None) -> pathlib.Path Get the default application state directory. .. py:function:: start_download(config: tribler.tribler_config.TriblerConfigManager, server_url: str, torrent_uri: str) -> None :async: Start a download by calling the REST API. .. py:function:: init_config(parsed_args: Arguments) -> tribler.tribler_config.TriblerConfigManager Add environment variables to the configuration. .. py:function:: load_torrent_uri(parsed_args: Arguments) -> str | None Loads the torrent URI. .. py:function:: mac_event_loop() -> None :async: Consume Mac events on the asyncio main thread. WARNING: ``sendEvent_`` can block on some events. In particular, while the tray menu is open. .. py:function:: open_webbrowser_tab(url: str) -> None Open a webbrowser tab with the given URL. .. py:function:: recolor_tray_icon(pil_icon: PIL.Image, rgb_code: str) -> PIL.Image Use the given RGB code to recolor the image. .. py:function:: spawn_tray_icon(session: tribler.core.session.Session, config: tribler.tribler_config.TriblerConfigManager) -> pystray.Icon Create the tray icon. .. py:function:: main() -> bool :async: The main script entry point. :returns: Whether we wish to restart the process. .. py:data:: __restart :value: True