pycroft

copyright
  1. 2011 by AG DSN.

What belongs in this package

This is the “backend” package, and as such mainly contains

  • things related to the pycroft business logic (i.e., pycroft.lib)

  • a definition of the database model (i.e., pycroft.model).

In particular, this means that at no point should there be any dependencies to flask or other frontend-specific libraries.

Subpackages

Submodules

pycroft.exc

exception PycroftException[source]

pycroft.property

pycroft.task

This module defines celery tasks to run tasks (as persisted in the database by means of pycroft.model.task) by using implementations as defined in pycroft.lib.task (see TaskImpl).

class DBTask[source]

Base class for tasks which use the database.

run(*args: Any, **kwargs: Any) None[source]

The body of the task executed by workers.

after_return(status: str, retval: Any, task_id: str, args: tuple, kwargs: dict, einfo: Any = None) None[source]

Handler called after the task returns.

Arguments:

status (str): Current task state. retval (Any): Task return value/exception. task_id (str): Unique id of the task. args (Tuple): Original arguments for the task. kwargs (Dict): Original keyword arguments for the task. einfo (~billiard.einfo.ExceptionInfo): Exception information.

Returns:

None: The return value of this handler is ignored.

connection = None
engine = None
write_task_message(task, message, log=False)[source]
repair_session()[source]