wuttjamaican.cleanup

Cleanup handler

class wuttjamaican.cleanup.Cleaner(config)[source]

Base class for cleaners.

Each cleaner should typically perform cleanup for “one portion” of the overall system. The cleanup handler typically orchestrates the overall cleanup.

cleanup(dry_run=False)[source]

Perform actual cleanup steps as needed.

Parameters:

dry_run – If true, the cleaner should not actually delete anything, but still log what actions it would have taken if not for dry run. Default is false in which case actions really will be taken.

classmethod get_spec()[source]
Returns:

The class spec string for the cleaner.

class wuttjamaican.cleanup.CleanupHandler(config)[source]

Base class and default implementation for the cleanup handler.

You typically would not instantiate this directly; rather call get_cleanup_handler() on the app handler.

The cleanup is typically scheduled to run overnight (via wutta cleanup), but could be ran more often (or not at all) as needed.

cleanup_everything(dry_run=False)[source]

Invoke cleanup logic for all registered cleaners.

This calls get_all_cleaners() and then calls cleanup() on each cleaner object.

get_all_cleaners()[source]

Retrieve a dictionary containing all registered cleaner objects.

Keys will be the entry point names; values will be Cleaner instances.

Return type:

dict

get_cleaner(key)[source]

Retrieve a specific cleaner object.

Parameters:

key – Unique key (entry point name) for the cleaner.

Return type:

Cleaner instance