rattail.upgrades

Upgrade handlers

class rattail.upgrades.UpgradeHandler(*args, **kwargs)[source]

Base class and default implementation for upgrade handlers.

delete_files(upgrade)[source]

Delete all data files for the given upgrade.

do_execute(upgrade, user, **kwargs)[source]

Perform all steps needed to fully execute the given upgrade.

Callers should use this method; you can override execute() to customize execution logic.

executable(upgrade)[source]

This method should return a boolean indicating whether or not execution should be allowed for the upgrade, given its current condition. The default simply returns True unless the upgrade has already been executed.

execute(upgrade, user, progress=None, **kwargs)[source]

Execute the given upgrade, as the given user.

get_all_systems(**kwargs)[source]

Returns a list of all “systems” available for upgrade.

get_system(key, require=False, **kwargs)[source]

Returns the “system” record for the given key.

rattail.upgrades.get_upgrade_handler(config, default=None)[source]

Returns an upgrade handler object.