ServerContext.py :  » Web-Frameworks » Aquarium » aquarium-2.3 » glass » Python Open Source

Home
Python Open Source
1.3.1.2 Python
2.Ajax
3.Aspect Oriented
4.Blog
5.Build
6.Business Application
7.Chart Report
8.Content Management Systems
9.Cryptographic
10.Database
11.Development
12.Editor
13.Email
14.ERP
15.Game 2D 3D
16.GIS
17.GUI
18.IDE
19.Installer
20.IRC
21.Issue Tracker
22.Language Interface
23.Log
24.Math
25.Media Sound Audio
26.Mobile
27.Network
28.Parser
29.PDF
30.Project Management
31.RSS
32.Search
33.Security
34.Template Engines
35.Test
36.UML
37.USB Serial
38.Web Frameworks
39.Web Server
40.Web Services
41.Web Unit
42.Wiki
43.Windows
44.XML
Python Open Source » Web Frameworks » Aquarium 
Aquarium » aquarium 2.3 » glass » ServerContext.py
"""This is a "configuration" class for server contexts."""

__docformat__ = "restructuredtext"

import os

from aquarium.util.ContainerClass import ContainerClass


class ServerContext(ContainerClass):

    """This is a "configuration" class for server contexts.

    It's job is just to hold data.  If you subclass this class, it will provide
    defaults for everything.

    The following attributes are used.  Note, each has a class default.

    doc_root
      This is the document root.  If there is an "htdocs" directory in the
      current directory, that is used.  Otherwise, the default is
      ``os.curdir``.  You may use a zip file for your document root.

    mounts
      This is a list of tuples of the form ``[(url_path, path_translated)]``,
      for instance, ``[("/log", "/var/log")]``.  More than one tuple may use
      the same ``url_path`` or ``path_translated``.  Basically, I'll go down
      the list and whoever has the file I'm looking for first wins.  You can
      even use "/" as your ``url_path``.  Conceptually, the first item in
      ``mounts`` is *implicitly* ``("/", doc_root)``.  You may use a zip file
      for ``path_translated``.  If ``url_path`` doesn't end in "/", I'll add
      one implicitly; otherwise things get too confusing.  The default value
      for ``mounts`` is ``[]``.

    server_name
      This is the server name used for CGI's ``SERVER_NAME``.  The default is
      whatever is received by the server (None will be used for the time
      being).

    request_queue_size
      How big should the queue be for waiting requests?  The default is 20.

    aquarium_entry_point
      This is the name of the entry point into Aquarium.  By default, it's
      ``aquarium.util.Aquarium``.  This is the hook to use if you need to
      subclass that module.

    """

    if os.path.isdir("htdocs"):
        doc_root = "htdocs"
    else:
        doc_root = os.curdir
    mounts = []
    server_name = None
    request_queue_size = 20
    aquarium_entry_point = "aquarium.util.Aquarium"
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.