tvrenamer.cache package

Submodules

tvrenamer.cache.api module

Private database API implemented for database operations.

class tvrenamer.cache.api.DatabaseAPI(conf)

Bases: object

Public APIs to perform on the database.

Initialize new instance.

Parameters:conf (oslo_config.cfg.ConfigOpts) – an instance of configuration file
clear()

Clear database.

create(instance)

Create the instance to the database

Parameters:instance – an instance of modeled data object
Returns:record id of created record
Return type:int
save(instance)

Save (create or update) the instance to the database

Parameters:instance – an instance of modeled data object
update(instance, condition)

Update the instance to the database

Parameters:
  • instance – an instance of modeled data object
  • condition – condition evaluated to determine record(s) to update
Returns:

record id updated or None

Return type:

int

Module contents

Provides access to cache API for saving data.

tvrenamer.cache.dbapi(conf=<oslo_config.cfg.ConfigOpts object>)

Retrieves an instance of the configured database API.

Parameters:conf (oslo_config.cfg.ConfigOpts) – an instance of the configuration file
Returns:database API instance
Return type:DatabaseAPI