Codebase list pastedeploy / f01b08f
Imported Upstream version 1.3.2 SVN-Git Migration 8 years ago
18 changed file(s) with 284 addition(s) and 14 deletion(s). Raw diff Collapse all Expand all
00 Metadata-Version: 1.0
11 Name: PasteDeploy
2 Version: 1.3.1
2 Version: 1.3.2
33 Summary: Load, configure, and compose WSGI applications and servers
44 Home-page: http://pythonpaste.org/deploy/
55 Author: Ian Bicking
00 Metadata-Version: 1.0
11 Name: PasteDeploy
2 Version: 1.3.1
2 Version: 1.3.2
33 Summary: Load, configure, and compose WSGI applications and servers
44 Home-page: http://pythonpaste.org/deploy/
55 Author: Ian Bicking
00 MANIFEST.in
1 regen-docs
12 setup.cfg
23 setup.py
34 PasteDeploy.egg-info/PKG-INFO
89 PasteDeploy.egg-info/not-zip-safe
910 PasteDeploy.egg-info/requires.txt
1011 PasteDeploy.egg-info/top_level.txt
12 docs/conf.py
1113 docs/index.txt
1214 docs/license.txt
1315 docs/news.txt
16 docs/_static/paste.css
17 docs/_templates/layout.html
18 docs/modules/config.txt
19 docs/modules/converters.txt
20 docs/modules/loadwsgi.txt
1421 paste/__init__.py
1522 paste/deploy/__init__.py
1623 paste/deploy/config.py
4451 tests/sample_configs/test_config.ini
4552 tests/sample_configs/test_config_included.ini
4653 tests/sample_configs/test_filter.ini
47 tests/sample_configs/test_filter_with.ini
54 tests/sample_configs/test_filter_with.ini
0 a.invisible-link {
1 color: #fff;
2 text-decoration: none;
3 }
4
5 a.invisible-link:visited {
6 color: #fff;
7 text-decoration: none;
8 }
9
10 a.invisible:link {
11 color: #fff;
12 text-decoration: none;
13 }
14
0 {% extends "!layout.html" %}
1
2 {% block extrahead %}
3 {{ super() }}
4 <link rel="stylesheet" type="text/css"
5 href="{{ pathto('_static/paste.css') }}">
6 {% endblock %}
7
8 {% block sidebartoc %}
9 <h3><a href="http://pythonpaste.org/" class="invisible-link">Python Paste</a></h3>
10
11 <ul>
12 <li><a href="http://trac.pythonpaste.org">Issue tracker</a></li>
13 <li><a href="http://pythonpaste.org/">Paste core</a></li>
14 <li><a href="http://pythonpaste.org/deploy/">Paste Deploy</a></li>
15 <li><a href="http://pythonpaste.org/script/">Paste Script</a></li>
16 </ul>
17
18 {{ super() }}
19 {% endblock %}
0 # -*- coding: utf-8 -*-
1 #
2 # Paste documentation build configuration file, created by
3 # sphinx-quickstart on Tue Apr 22 22:08:49 2008.
4 #
5 # This file is execfile()d with the current directory set to its containing dir.
6 #
7 # The contents of this file are pickled, so don't put values in the namespace
8 # that aren't pickleable (module imports are okay, they're removed automatically).
9 #
10 # All configuration values have a default value; values that are commented out
11 # serve to show the default value.
12
13 import sys
14
15 # If your extensions are in another directory, add it here.
16 #sys.path.append('some/directory')
17
18 # General configuration
19 # ---------------------
20
21 # Add any Sphinx extension module names here, as strings. They can be extensions
22 # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
23 extensions = ['sphinx.ext.autodoc']
24
25 # Add any paths that contain templates here, relative to this directory.
26 templates_path = ['_templates']
27
28 # The suffix of source filenames.
29 source_suffix = '.txt'
30
31 # The master toctree document.
32 master_doc = 'index'
33
34 # General substitutions.
35 project = 'Paste Deploy'
36 copyright = '2008, Ian Bicking'
37
38 # The default replacements for |version| and |release|, also used in various
39 # other places throughout the built documents.
40 #
41 # The short X.Y version.
42 version = '1.3'
43 # The full version, including alpha/beta/rc tags.
44 release = '1.3.2'
45
46 # There are two options for replacing |today|: either, you set today to some
47 # non-false value, then it is used:
48 #today = ''
49 # Else, today_fmt is used as the format for a strftime call.
50 today_fmt = '%B %d, %Y'
51
52 # List of documents that shouldn't be included in the build.
53 #unused_docs = ['include/contact.txt', 'include/reference_header.txt']
54
55 # If true, '()' will be appended to :func: etc. cross-reference text.
56 #add_function_parentheses = True
57
58 # If true, the current module name will be prepended to all description
59 # unit titles (such as .. function::).
60 #add_module_names = True
61
62 # If true, sectionauthor and moduleauthor directives will be shown in the
63 # output. They are ignored by default.
64 #show_authors = False
65
66 # The name of the Pygments (syntax highlighting) style to use.
67 pygments_style = 'sphinx'
68
69
70 # Options for HTML output
71 # -----------------------
72
73 # The style sheet to use for HTML and HTML Help pages. A file of that name
74 # must exist either in Sphinx' static/ path, or in one of the custom paths
75 # given in html_static_path.
76 html_style = 'default.css'
77
78 # Add any paths that contain custom static files (such as style sheets) here,
79 # relative to this directory. They are copied after the builtin static files,
80 # so a file named "default.css" will overwrite the builtin "default.css".
81 html_static_path = ['_static']
82
83 # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
84 # using the given strftime format.
85 html_last_updated_fmt = '%b %d, %Y'
86
87 # If true, SmartyPants will be used to convert quotes and dashes to
88 # typographically correct entities.
89 #html_use_smartypants = True
90
91 # Content template for the index page.
92 #html_index = ''
93
94 # Custom sidebar templates, maps document names to template names.
95 #html_sidebars = {}
96
97 # Additional templates that should be rendered to pages, maps page names to
98 # template names.
99 #html_additional_pages = {}
100
101 # If false, no module index is generated.
102 #html_use_modindex = True
103
104 # If true, the reST sources are included in the HTML build as _sources/<name>.
105 #html_copy_source = True
106
107 # Output file base name for HTML help builder.
108 htmlhelp_basename = 'PasteDeploydoc'
109
110
111 # Options for LaTeX output
112 # ------------------------
113
114 # The paper size ('letter' or 'a4').
115 #latex_paper_size = 'letter'
116
117 # The font size ('10pt', '11pt' or '12pt').
118 #latex_font_size = '10pt'
119
120 # Grouping the document tree into LaTeX files. List of tuples
121 # (source start file, target name, title, author, document class [howto/manual]).
122 #latex_documents = []
123
124 # Additional stuff for the LaTeX preamble.
125 #latex_preamble = ''
126
127 # Documents to append as an appendix to all manuals.
128 #latex_appendices = []
129
130 # If false, no module index is generated.
131 #latex_use_modindex = True
11 ================
22
33 :author: Ian Bicking <ianb@colorstudy.com>
4 :revision: $Rev: 5845 $
5 :date: $LastChangedDate: 2006-10-22 15:33:08 -0500 (Sun, 22 Oct 2006) $
64
75 .. contents::
6
7 Documents:
8
9 .. toctree::
10 :maxdepth: 1
11
12 news
13 modules/loadwsgi
14 modules/config
15 modules/converters
16 license
817
918 .. comment:
1019 The names used in sections should be more concrete, and it should
0 :mod:`paste.deploy.config` -- Configuration and Environment middleware
1 ======================================================================
2
3 .. automodule:: paste.deploy.config
4
5 Module Contents
6 ---------------
7
8 .. autoclass:: DispatchingConfig
9 .. autoclass:: ConfigMiddleware
10 .. autoclass:: PrefixMiddleware
11
12 .. comment: FIXME: do something about CONFIG (manual docs?)
0 :mod:`paste.deploy.converters` -- Conversion helpers for String Configuration
1 =============================================================================
2
3 .. automodule:: paste.deploy.converters
4
5 Module Contents
6 ---------------
7
8 .. autofunction:: asbool
9 .. autofunction:: asint
10 .. autofunction:: aslist
0 :mod:`paste.deploy.loadwsgi` -- Load WSGI applications from config files
1 ========================================================================
2
3 .. automodule:: paste.deploy.loadwsgi
4
5 Module Contents
6 ---------------
7
8 .. autofunction:: loadapp
9 .. autofunction:: loadserver
10 .. autofunction:: loadfilter
11 .. autofunction;: appconfig
12
00 Paste Deployment News
11 =====================
2
3 1.3.2
4 -----
5
6 * Added ``paste.deploy.converters.asint()``.
7 * fixed use sections overwriting the config's __file__ value with the
8 use'd filename.
9 * ``paste.deploy.loadwsgi`` now supports variable expansion in the
10 DEFAULT section of config files (unlike plain ConfigParser).
211
312 1.3.1
413 -----
77 from pkgutil import extend_path
88 __path__ = extend_path(__path__, __name__)
99
10 import modulefinder
11 for p in __path__:
12 modulefinder.AddPackagePath(__name__, p)
10 try:
11 import modulefinder
12 except ImportError:
13 pass
14 else:
15 for p in __path__:
16 modulefinder.AddPackagePath(__name__, p)
1317
214214 To filter your application through a PrefixMiddleware instance, add the
215215 following to the '[app:main]' section of your .ini file:
216216
217 .. code-block:: PasteIni
217 .. code-block:: ini
218218
219219 filter-with = proxy-prefix
220220
255255 if not url: url = '/'
256256 environ['PATH_INFO'] = url
257257 environ['SCRIPT_NAME'] = self.prefix
258 if (self.translate_forwarded_server and
259 'HTTP_X_FORWARDED_SERVER' in environ):
260 environ['HTTP_HOST'] = environ.pop('HTTP_X_FORWARDED_SERVER')
258 if self.translate_forwarded_server:
259 if 'HTTP_X_FORWARDED_SERVER' in environ:
260 environ['SERVER_NAME'] = environ['HTTP_HOST'] = environ.pop('HTTP_X_FORWARDED_SERVER')
261 if 'HTTP_X_FORWARDED_HOST' in environ:
262 environ['HTTP_HOST'] = environ.pop('HTTP_X_FORWARDED_HOST')
261263 if self.force_port is not None:
262264 host = environ.get('HTTP_HOST', '').split(':', 1)[0]
263265 if self.force_port:
1111 "String is not true/false: %r" % obj)
1212 return bool(obj)
1313
14 def asint(obj):
15 try:
16 return int(obj)
17 except (TypeError, ValueError), e:
18 raise ValueError(
19 "Bad integer value: %r" % obj)
20
1421 def aslist(obj, sep=None, strip=True):
1522 if isinstance(obj, (str, unicode)):
1623 lst = obj.split(sep)
4444 def __init__(self, filename, *args, **kw):
4545 ConfigParser.__init__(self, *args, **kw)
4646 self.filename = filename
47
48 def defaults(self):
49 """Return the defaults, with their values interpolated (with the
50 defaults dict itself)
51
52 Mainly to support defaults using values such as %(here)s
53 """
54 defaults = ConfigParser.defaults(self).copy()
55 for key, val in defaults.iteritems():
56 defaults[key] = self._interpolate('DEFAULT', key, val, defaults)
57 return defaults
4758
4859 def _interpolate(self, section, option, rawval, vars):
4960 try:
323334 # Stupid ConfigParser ignores files that aren't found, so
324335 # we have to add an extra check:
325336 if not os.path.exists(filename):
337 if filename.strip() != filename:
338 raise OSError(
339 "File %r not found; trailing whitespace: "
340 "did you try to use a # on the same line as a filename? "
341 "(comments must be on their own line)" % filename)
326342 raise OSError(
327343 "File %r not found" % filename)
328344 self.parser.read(filename)
414430 object_type, name=use, global_conf=global_conf)
415431 context.global_conf.update(global_additions)
416432 context.local_conf.update(local_conf)
433 if '__file__' in global_conf:
434 # use sections shouldn't overwrite the original __file__
435 context.global_conf['__file__'] = global_conf['__file__']
417436 # @@: Should loader be overwritten?
418437 context.loader = self
419438 return context
0 #!/bin/sh
1
2 mkdir -p docs/_static docs/_build
3 sphinx-build -E -b html docs/ docs/_build || exit 1
4 if [ "$1" = "publish" ] ; then
5 cd docs/
6 echo "Uploading files..."
7 scp -r _build/* ianb@webwareforpython.org:/home/paste/htdocs/deploy/
8 fi
00 from setuptools import setup, find_packages
11
2 version = '1.3.1'
2 version = '1.3.2'
33
44 setup(
55 name="PasteDeploy",
6262 'def3': 'c',
6363 'glob': 'override',
6464 'here': config_path,
65 '__file__': os.path.join(config_path, 'test_config_included.ini')}
65 '__file__': os.path.join(config_path, 'test_config.ini')}
6666
6767 def test_config_get():
6868 app = loadapp(ini_file, relative_to=here, name='test_get')