From eefd362257df77b5da08c759b0f4432b5aeee006 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Sat, 4 Apr 2009 22:19:09 +0000 Subject: [PATCH] Update to PEP 3143 as sent in by the PEP author. --- pep-3143.txt | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/pep-3143.txt b/pep-3143.txt index 68288e33a..47a396a03 100644 --- a/pep-3143.txt +++ b/pep-3143.txt @@ -54,7 +54,7 @@ Simple example of direct `DaemonContext` usage:: from spam import do_main_program - with daemon.DaemonContext() as daemon_context: + with daemon.DaemonContext(): do_main_program() More complex example usage:: @@ -312,27 +312,27 @@ The following methods are defined. * If the `pidfile` attribute is not ``None``, enter its context manager. + * Register the `close` method to be called during Python's exit + processing. + When the function returns, the running program is a daemon process. `close()` :Return: ``None`` - Close the daemon context. This does nothing by default, but may be - overridden by a derived class. + Close the daemon context. This performs the following step: + + * If the `pidfile` attribute is not ``None``, exit its context + manager. `terminate(signal_number, stack_frame)` :Return: ``None`` Signal handler for the ``signal.SIGTERM`` signal. Performs the - following steps: + following step: - * If the `pidfile` attribute is not ``None``, exit its context - manager. - - * Call the `close()` method. - - * Raise a ``SystemExit`` exception. + * Raise a ``SystemExit`` exception explaining the signal. The class also implements the context manager protocol via ``__enter__`` and ``__exit__`` methods. @@ -577,8 +577,8 @@ rights and freedoms that would otherwise be restricted by copyright. Local variables: mode: rst coding: utf-8 - time-stamp-start: "^:Last-Modified:[ ]+" - time-stamp-end: "$" + time-stamp-start: "^Last-Modified:[ ]+\$Date: " + time-stamp-end: " \$$" time-stamp-line-limit: 20 time-stamp-format: "%:y-%02m-%02d %02H:%02M" End: