tribler.tribler_config ====================== .. py:module:: tribler.tribler_config .. autoapi-nested-parse:: Note: after making changes to this file, run it to generate the `pyi` types! Attributes ---------- .. autoapisummary:: tribler.tribler_config.logger tribler.tribler_config.IPv8BootstrapperConfig tribler.tribler_config.IPv8OverlayConfig tribler.tribler_config.DEFAULT_CONFIG tribler.tribler_config.VERSION_SUBDIR Classes ------- .. autoapisummary:: tribler.tribler_config.IPv8InterfaceConfig tribler.tribler_config.IPv8KeysConfig tribler.tribler_config.IPv8LoggerConfig tribler.tribler_config.IPv8WalkerConfig tribler.tribler_config.IPv8Config tribler.tribler_config.ApiConfig tribler.tribler_config.ContentDiscoveryCommunityConfig tribler.tribler_config.DHTDiscoveryCommunityConfig tribler.tribler_config.DatabaseConfig tribler.tribler_config.VersioningConfig tribler.tribler_config.DownloadDefaultsConfig tribler.tribler_config.LibtorrentConfig tribler.tribler_config.RecommenderConfig tribler.tribler_config.RendezvousConfig tribler.tribler_config.RSSConfig tribler.tribler_config.TorrentCheckerConfig tribler.tribler_config.TunnelCommunityConfig tribler.tribler_config.WatchFolderConfig tribler.tribler_config.TriblerConfig tribler.tribler_config.TriblerConfigManager Functions --------- .. autoapisummary:: tribler.tribler_config._produce_set_overload Module Contents --------------- .. py:data:: logger .. py:class:: IPv8InterfaceConfig Bases: :py:obj:`TypedDict` An IPv8 network interface. .. py:attribute:: interface :type: str .. py:attribute:: ip :type: str .. py:attribute:: port :type: int .. py:attribute:: worker_threads :type: NotRequired[int] .. py:class:: IPv8KeysConfig Bases: :py:obj:`TypedDict` An IPv8 key configuration. .. py:attribute:: alias :type: str .. py:attribute:: generation :type: str .. py:attribute:: file :type: str .. py:class:: IPv8LoggerConfig Bases: :py:obj:`TypedDict` The IPv8 logger configuration. .. py:attribute:: level :type: str .. py:class:: IPv8WalkerConfig Bases: :py:obj:`TypedDict` An IPv8 walker configuration. .. py:attribute:: strategy :type: str .. py:attribute:: peers :type: int .. py:attribute:: init :type: dict .. py:data:: IPv8BootstrapperConfig An IPv8 bootstrapper configuration. .. py:data:: IPv8OverlayConfig An IPv8 overlay launch config. .. py:class:: IPv8Config Bases: :py:obj:`TypedDict` The main IPv8 configuration dictionary. .. py:attribute:: interfaces :type: list[IPv8InterfaceConfig] .. py:attribute:: keys :type: list[IPv8KeysConfig] D.keys() -> a set-like object providing a view on D's keys .. py:attribute:: logger :type: IPv8LoggerConfig .. py:attribute:: working_directory :type: str .. py:attribute:: walker_interval :type: float .. py:attribute:: overlays :type: list[IPv8OverlayConfig] .. py:class:: ApiConfig Bases: :py:obj:`TypedDict` Settings for the API key component. .. py:attribute:: key :type: str .. py:attribute:: http_enabled :type: bool .. py:attribute:: http_port :type: int .. py:attribute:: http_host :type: str .. py:attribute:: https_enabled :type: bool .. py:attribute:: https_host :type: str .. py:attribute:: https_port :type: int .. py:attribute:: https_certfile :type: str .. py:attribute:: http_port_running :type: int .. py:attribute:: https_port_running :type: int .. py:class:: ContentDiscoveryCommunityConfig Bases: :py:obj:`TypedDict` Settings for the content discovery component. .. py:attribute:: enabled :type: bool .. py:class:: DHTDiscoveryCommunityConfig Bases: :py:obj:`TypedDict` Settings for the DHT discovery component. .. py:attribute:: enabled :type: bool .. py:class:: DatabaseConfig Bases: :py:obj:`TypedDict` Settings for the database component. .. py:attribute:: enabled :type: bool .. py:class:: VersioningConfig Bases: :py:obj:`TypedDict` Settings for the versioning component. .. py:attribute:: enabled :type: bool .. py:attribute:: allow_pre :type: bool .. py:class:: DownloadDefaultsConfig Bases: :py:obj:`TypedDict` Settings for default downloads, used by libtorrent. .. py:attribute:: anonymity_enabled :type: bool .. py:attribute:: number_hops :type: int .. py:attribute:: safeseeding_enabled :type: bool .. py:attribute:: saveas :type: str .. py:attribute:: seeding_mode :type: str .. py:attribute:: seeding_ratio :type: float .. py:attribute:: seeding_time :type: float .. py:attribute:: channel_download :type: bool .. py:attribute:: add_download_to_channel :type: bool .. py:attribute:: trackers_file :type: str .. py:attribute:: torrent_folder :type: str .. py:attribute:: auto_managed :type: bool .. py:attribute:: completed_dir :type: str .. py:class:: LibtorrentConfig Bases: :py:obj:`TypedDict` Settings for the libtorrent component. .. py:attribute:: socks_listen_ports :type: list[int] .. py:attribute:: listen_interface :type: str .. py:attribute:: port :type: int .. py:attribute:: proxy_type :type: int .. py:attribute:: proxy_server :type: str .. py:attribute:: proxy_auth :type: str .. py:attribute:: max_connections_download :type: int .. py:attribute:: max_download_rate :type: int .. py:attribute:: max_upload_rate :type: int .. py:attribute:: use_advanced_rate_limits :type: bool .. py:attribute:: advanced_rate_limits :type: dict[str, str] .. py:attribute:: utp :type: bool .. py:attribute:: dht :type: bool .. py:attribute:: dht_readiness_timeout :type: int .. py:attribute:: upnp :type: bool .. py:attribute:: natpmp :type: bool .. py:attribute:: lsd :type: bool .. py:attribute:: announce_to_all_tiers :type: bool .. py:attribute:: announce_to_all_trackers :type: bool .. py:attribute:: max_concurrent_http_announces :type: int .. py:attribute:: check_after_complete :type: bool .. py:attribute:: download_defaults :type: DownloadDefaultsConfig .. py:attribute:: active_downloads :type: int .. py:attribute:: active_seeds :type: int .. py:attribute:: active_checking :type: int .. py:attribute:: active_dht_limit :type: int .. py:attribute:: active_tracker_limit :type: int .. py:attribute:: active_lsd_limit :type: int .. py:attribute:: active_limit :type: int .. py:attribute:: ask_download_settings :type: bool .. py:attribute:: clear_orphaned_parts :type: bool .. py:attribute:: allow_mmap :type: bool .. py:class:: RecommenderConfig Bases: :py:obj:`TypedDict` Settings for the user recommender component. .. py:attribute:: enabled :type: bool .. py:class:: RendezvousConfig Bases: :py:obj:`TypedDict` Settings for the rendezvous component. .. py:attribute:: enabled :type: bool .. py:class:: RSSConfig Bases: :py:obj:`TypedDict` Settings for the rss component. .. py:attribute:: enabled :type: bool .. py:attribute:: urls :type: list[str] .. py:class:: TorrentCheckerConfig Bases: :py:obj:`TypedDict` Settings for the torrent checker component. .. py:attribute:: enabled :type: bool .. py:class:: TunnelCommunityConfig Bases: :py:obj:`TypedDict` Settings for the tunnel community component. .. py:attribute:: enabled :type: bool .. py:attribute:: min_circuits :type: int .. py:attribute:: max_circuits :type: int .. py:class:: WatchFolderConfig Bases: :py:obj:`TypedDict` Settings for the watch folder component. .. py:attribute:: enabled :type: bool .. py:attribute:: directory :type: str .. py:attribute:: check_interval :type: float .. py:class:: TriblerConfig Bases: :py:obj:`TypedDict` The main Tribler settings and all of its components' sub-settings. .. py:attribute:: api :type: ApiConfig .. py:attribute:: headless :type: bool .. py:attribute:: start_minimized :type: bool .. py:attribute:: ipv8 :type: IPv8Config .. py:attribute:: statistics :type: bool .. py:attribute:: content_discovery_community :type: ContentDiscoveryCommunityConfig .. py:attribute:: database :type: DatabaseConfig .. py:attribute:: libtorrent :type: LibtorrentConfig .. py:attribute:: recommender :type: RecommenderConfig .. py:attribute:: rendezvous :type: RendezvousConfig .. py:attribute:: rss :type: RSSConfig .. py:attribute:: torrent_checker :type: TorrentCheckerConfig .. py:attribute:: tunnel_community :type: TunnelCommunityConfig .. py:attribute:: versioning :type: VersioningConfig .. py:attribute:: watch_folder :type: WatchFolderConfig .. py:attribute:: state_dir :type: str .. py:attribute:: memory_db :type: bool .. py:attribute:: tray_icon_color :type: str .. py:attribute:: ui :type: dict .. py:data:: DEFAULT_CONFIG .. py:data:: VERSION_SUBDIR .. py:class:: TriblerConfigManager(config_file: pathlib.Path = Path('configuration.json')) A class that interacts with a JSON configuration file. .. py:attribute:: config_file .. py:attribute:: configuration .. py:method:: write() -> None Write the configuration to disk. .. py:method:: get(option: str) -> dict | list | str | float | bool | None Get a config option based on the path-like descriptor. .. py:method:: get_version_state_dir() -> str Get the state dir for our current version. .. py:method:: set(option: str, value: dict | list | str | float | bool | None) -> None Set a config option value based on the path-like descriptor. .. py:function:: _produce_set_overload(key: str, value_type: str) -> str