l.b.s.c.b.WorkingBase : class documentation

Part of lp.bugs.scripts.checkwatches.base View In Hierarchy

Known subclasses: lp.bugs.scripts.checkwatches.__init__.CheckwatchesMaster, lp.bugs.scripts.checkwatches.bugwatchupdater.BugWatchUpdater, lp.bugs.scripts.checkwatches.remotebugupdater.RemoteBugUpdater

A base class for writing a long-running process.
Method init Undocumented
Method initFromParent Undocumented
Method interaction Context manager for interaction as the given user.
Method transaction Context manager to ring-fence database activity.
Method statement_logging Context manager to start and stop SQL statement logging.
Method warning Record a warning.
Method error Record an error.
Method _statement_logging_start Start logging SQL statements and other database activity.
Method _statement_logging_stop Stop logging SQL statements.
Method _statement_logging_reset Reset the SQL statement log, if enabled.
def init(self, login, transaction_manager, logger):
Undocumented
def initFromParent(self, parent):
Undocumented
@property
@contextmanager
def interaction(self):
Context manager for interaction as the given user.

If an interaction is already in progress this is a no-op, otherwise it sets up an interaction on entry and ends it on exit.

@property
@contextmanager
def transaction(self):
Context manager to ring-fence database activity.

Ensures that no transaction is in progress on entry, and commits on a successful exit. Exceptions are propagated once the transaction has been aborted.

This intentionally cannot be nested. Keep it simple.

def _statement_logging_start(self):
Start logging SQL statements and other database activity.
def _statement_logging_stop(self):
Stop logging SQL statements.
def _statement_logging_reset(self):
Reset the SQL statement log, if enabled.
@property
@contextmanager
def statement_logging(self):
Context manager to start and stop SQL statement logging.

It does this by (mis)using the webapp statement logging machinery.

def warning(self, message, properties=None, info=None):
Record a warning.
def error(self, message, properties=None, info=None):
Record an error.
API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.