duck.contrib.reloader.ducksightยถ

Ducksight Reloader

Watches for file changes in Duck framework projects and restarts the webserver in DEBUG mode whenever relevant .py files change.

Module Contentsยถ

Classesยถ

DuckSightReloader

Monitors the project directory for Python file changes and triggers reloads.

Handler

Handles filesystem events and triggers debounced full server reloads.

APIยถ

class duck.contrib.reloader.ducksight.DuckSightReloader(watch_dir: str)ยถ

Monitors the project directory for Python file changes and triggers reloads.

Initialization

run()ยถ

Start the observer loop; ensures single reloader process is active.

โ€ฆ admonition:: Notes

This method is blocking.

stop()ยถ

Stops the reloader.

class duck.contrib.reloader.ducksight.Handler(debounce_interval=0.6)ยถ

Bases: watchdog.events.FileSystemEventHandler

Handles filesystem events and triggers debounced full server reloads.

Initialization

_trigger_restart()ยถ

Trigger the real restart.

on_any_event(event)ยถ

Called on any filesystem event; filters .py files and schedules reload.

restart_webserver(changed_file: str)ยถ

Perform the actual server reload.

Parameters:

changed_file โ€“ This is the path to the file which triggered this reload.