Skip to content

Commit 14bf78e

Browse files
committed
Minor clean-up in the documentation
1 parent d9bde12 commit 14bf78e

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

docs/appdev.rst

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ Here's what the files and directories are for:
8080
``Configs``:
8181
Configuration files for the application. These files are copied from the ``Configs`` subdirectory in the ``webware`` package, but are specific to this application.
8282
``Context``:
83-
The directory for your default context. This is where you put your servlets. You can change its name and location with the ```-c`` and ``-d`` options. You can also change this subsequently in the ``Application.config`` file in the ``Configs`` directory, where you can also configure more than one context. You may also want to remove the other standard contexts that come with Webware from the config file.
83+
The directory for your default context. This is where you put your servlets. You can change its name and location with the ``-c`` and ``-d`` options. You can also change this subsequently in the ``Application.config`` file in the ``Configs`` directory, where you can also configure more than one context. You may also want to remove the other standard contexts that come with Webware from the config file.
8484
``error404.html``:
8585
The static HTML page to be displayed when a page is not found. You can remove this to display a standard error message, modify the page according to your preferences, or use a custom error servlet instead by setting ``ErrorPage`` in the ``Application.config`` file appropriately.
8686
``ErrorMsgs``:
@@ -312,14 +312,11 @@ print
312312

313313
The most common technique is the infamous ``print`` statement which has been replaced with a ``print()`` function in Python 3. The results of ``print()`` calls go to the console where the WSGI server was started (not to the HTML page as would happen with CGI). If you specify ``AppLogFilename`` in ``Application.config``, this will cause the standard output and error to be redirected to this file.
314314

315-
For convenient debugging, we recommend you use a clause like this in your ``Application.config`` file::
315+
For convenient debugging, the default ``Application.config`` file already uses the following conditional setting::
316316

317-
if Development:
318-
AppLogFilename = None
319-
else:
320-
AppLogFilename = 'Logs/Application.log'
317+
AppLogFilename = None if Development else 'Logs/Application.log'
321318

322-
This will prevent standard output and error from being redirected to the log file in development mode, which makes it easier to find debugging output, and also makes it possible to use ```pdb``` (see below).
319+
This will prevent standard output and error from being redirected to the log file in development mode, which makes it easier to find debugging output, and also makes it possible to use ``pdb`` (see below).
323320

324321
Prefixing the debugging output with a special tag (such as ``>>``) is useful because it stands out on the console and you can search for the tag in source code to remove the print statements after they are no longer useful. For example::
325322

@@ -356,11 +353,11 @@ Assertions are used to ensure that the internal conditions of the application ar
356353

357354
Debugging using PDB
358355
~~~~~~~~~~~~~~~~~~~
359-
To use python's built-in debugger ```pdb```, see the tip above about setting ```AppLogFilename``` for convenient debugging.
356+
To use Python's built-in debugger ``pdb``, see the tip above about setting ``AppLogFilename`` for convenient debugging.
360357

361358
To have Webware automatically put you into pdb when an exception occurs, set this in your ``Application.config`` file::
362359

363-
EnterDebuggerOnException = Development
360+
EnterDebuggerOnException = Development
364361

365362
A quick and easy way to debug a particular section of code is to add these lines at that point in the code::
366363

docs/config.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Sessions
7979
``SessionModule``:
8080
Can be used to replace the standard Webware Session module with something else. Default: ``Session``
8181
``SessionStore``:
82-
This setting determines which of five possible session stores is used by the Application: ``Dynamic``, ``File``, ``Memcached``, ``Memory``, ``Redis`` or ```Shelve``. The ``File`` store always gets sessions from disk and puts them back when finished. ``Memory`` always keeps all sessions in memory, but will periodically back them up to disk. ``Dynamic`` is a good cross between the two, which pushes excessive or inactive sessions out to disk. ``Shelve`` stores the sessions in a database file using the Python ``shelve`` module, ``Memcached`` stores them on a Memcached system using the ``python-memcached`` interface, and ``Redis`` stores them on a Redis system using the ``redis-py`` client. You can use a custom session store module as well. Default: ``Dynamic``.
82+
This setting determines which of five possible session stores is used by the Application: ``Dynamic``, ``File``, ``Memcached``, ``Memory``, ``Redis`` or ``Shelve``. The ``File`` store always gets sessions from disk and puts them back when finished. ``Memory`` always keeps all sessions in memory, but will periodically back them up to disk. ``Dynamic`` is a good cross between the two, which pushes excessive or inactive sessions out to disk. ``Shelve`` stores the sessions in a database file using the Python ``shelve`` module, ``Memcached`` stores them on a Memcached system using the ``python-memcached`` interface, and ``Redis`` stores them on a Redis system using the ``redis-py`` client. You can use a custom session store module as well. Default: ``Dynamic``.
8383
``SessionStoreDir``:
8484
If ``SessionStore`` is set to ``File``, ``Dynamic`` or ``Shelve``, then this setting determines the directory where the files for the individual sessions or the shelve database will be stored. The path is interpreted as relative to the working directory (or Webware path, if you're not using a working directory), or you can specify an absolute path. Default: ``Sessions``.
8585
``SessionTimeout``:
@@ -213,7 +213,7 @@ Logging
213213
``ActivityLogColumns``:
214214
Specifies the columns that will be stored in the activity log. Each column can refer to an object from the set [application, transaction, request, response, servlet, session] and then refer to its attributes using "dot notation". The attributes can be methods or instance attributes and can be qualified arbitrarily deep. Default: ``['request.remoteAddress', 'request.method', 'request.uri', 'response.size', 'servlet.name', 'request.timeStamp', 'transaction.duration', 'transaction.errorOccurred']``.
215215
``AppLogFilename``:
216-
The Application redirects standard output and error to this file, if this is set in production mode. Default: ```'Logs/Application.log'``.
216+
The Application redirects standard output and error to this file, if this is set in production mode. Default: ``'Logs/Application.log'``.
217217
``Verbose``:
218218
If True, then additional messages are printed while the Application runs, most notably information about each request such as size and response time. Default: ``True``.
219219
``SilentURIs``:

0 commit comments

Comments
 (0)