hot_reload ¶
Hot reload system for Tux Discord bot.
Modules:
-
cog–Hot reload cog for file watching and automatic reloading.
-
config–Configuration and exceptions for hot reload system.
-
dependencies–Dependency tracking for hot reload system.
-
file_utils–File utilities for hot reload system.
-
service–Main hot reload service implementation.
-
watcher–File system watcher for hot reload system.
Classes:
-
HotReload–Enhanced hot reload system with dependency tracking and performance monitoring.
Functions:
-
setup–Cog setup for hot reload.
Classes¶
HotReload ¶
HotReload(bot: Tux, config: HotReloadConfig | None = None)
Bases: Cog
Enhanced hot reload system with dependency tracking and performance monitoring.
Initialize the hot reload service.
Parameters:
-
bot(Tux) –The bot instance.
-
config(HotReloadConfig | None, default:None) –Hot reload configuration, by default None.
Methods:
-
cog_load–Initialize the hot reload system when cog is loaded.
-
cog_unload–Clean up when cog is unloaded.
-
start_watching–Start file system watching.
-
stop_watching–Stop file system watching.
-
hotreload_group–Hot reload management commands.
-
status–Show hot reload system status.
-
enable–Enable hot reload system.
-
disable–Disable hot reload system.
-
manual_reload–Manually reload an extension.
Attributes:
-
is_enabled(bool) –Check if hot reload is enabled.
-
reload_stats(dict[str, Any]) –Get reload statistics.
Attributes¶
Functions¶
_reload_extension_async async ¶
_reload_extension_async(extension: str) -> None
Asynchronously reload an extension.
_reload_extension_with_monitoring async ¶
_reload_extension_with_monitoring(extension: str) -> None
Reload extension with performance monitoring.
_perform_reload async ¶
Perform the actual extension reload.
Returns:
-
bool–True if reload was successful, False otherwise.
Raises:
-
ModuleReloadError–If reload fails and continue_on_error is False.
hotreload_group async ¶
Hot reload management commands.