Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

first cut

  • Loading branch information...
commit aee4d7bd925e6b319000e25b0f7e62f2a614915a 1 parent ac45409
@mcdonc mcdonc authored
Showing with 1,336 additions and 0 deletions.
  1. +3 −0  .gitignore
  2. +4 −0 CHANGES.txt
  3. +3 −0  COPYRIGHT.txt
  4. +41 −0 LICENSE.txt
  5. 0  README
  6. +4 −0 README.txt
  7. +1 −0  docs/.#api.rst
  8. +7 −0 docs/.build/.svn/dir-prop-base
  9. +28 −0 docs/.build/.svn/entries
  10. +96 −0 docs/.static/.svn/entries
  11. +5 −0 docs/.static/.svn/prop-base/logo_hi.gif.svn-base
  12. BIN  docs/.static/.svn/text-base/logo_hi.gif.svn-base
  13. +25 −0 docs/.static/.svn/text-base/repoze.css.svn-base
  14. BIN  docs/.static/logo_hi.gif
  15. +25 −0 docs/.static/repoze.css
  16. +173 −0 docs/.svn/entries
  17. +70 −0 docs/.svn/text-base/Makefile.svn-base
  18. +14 −0 docs/.svn/text-base/api.rst.svn-base
  19. +185 −0 docs/.svn/text-base/conf.py.svn-base
  20. +24 −0 docs/.svn/text-base/index.rst.svn-base
  21. +28 −0 docs/.templates/.svn/entries
  22. +70 −0 docs/Makefile
  23. +9 −0 docs/api.rst
  24. +196 −0 docs/conf.py
  25. +18 −0 docs/glossary.rst
  26. +74 −0 docs/index.rst
  27. +62 −0 pyramid_beaker/.svn/entries
  28. +9 −0 pyramid_beaker/.svn/prop-base/__init__.py.svn-base
  29. +1 −0  pyramid_beaker/.svn/text-base/__init__.py.svn-base
  30. +60 −0 pyramid_beaker/__init__.py
  31. +44 −0 pyramid_beaker/tests.py
  32. +10 −0 setup.cfg
  33. +47 −0 setup.py
View
3  .gitignore
@@ -0,0 +1,3 @@
+.coverage
+*.egg-info
+
View
4 CHANGES.txt
@@ -0,0 +1,4 @@
+0.0 (unreleased)
+----------------
+
+- Initial release.
View
3  COPYRIGHT.txt
@@ -0,0 +1,3 @@
+Copyright (c) 2010 Agendaless Consulting and Contributors.
+(http://www.agendaless.com), All Rights Reserved
+
View
41 LICENSE.txt
@@ -0,0 +1,41 @@
+License
+
+ A copyright notice accompanies this license document that identifies
+ the copyright holders.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+
+ 1. Redistributions in source code must retain the accompanying
+ copyright notice, this list of conditions, and the following
+ disclaimer.
+
+ 2. Redistributions in binary form must reproduce the accompanying
+ copyright notice, this list of conditions, and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+
+ 3. Names of the copyright holders must not be used to endorse or
+ promote products derived from this software without prior
+ written permission from the copyright holders.
+
+ 4. If any files are modified, you must cause the modified files to
+ carry prominent notices stating that you changed the files and
+ the date of any change.
+
+ Disclaimer
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND
+ ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+ PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+ THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.
+
View
0  README
No changes.
View
4 README.txt
@@ -0,0 +1,4 @@
+pyramid_beaker
+==============
+
+Please see docs/index.rst for the documentation.
View
1  docs/.#api.rst
View
7 docs/.build/.svn/dir-prop-base
@@ -0,0 +1,7 @@
+K 10
+svn:ignore
+V 14
+doctrees
+html
+
+END
View
28 docs/.build/.svn/entries
@@ -0,0 +1,28 @@
+10
+
+dir
+9917
+svn+ssh://repoze@svn.repoze.org/svn/template/trunk/docs/.build
+svn+ssh://repoze@svn.repoze.org/svn
+
+
+
+2008-10-04T17:50:35.715428Z
+2037
+Tres Seaver <tseaver@palladion.com>
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+8f1d8bf8-68d2-4fbe-a113-2afb08c80ed9
+
View
96 docs/.static/.svn/entries
@@ -0,0 +1,96 @@
+10
+
+dir
+9917
+svn+ssh://repoze@svn.repoze.org/svn/template/trunk/docs/.static
+svn+ssh://repoze@svn.repoze.org/svn
+
+
+
+2009-07-27T22:53:49.881952Z
+6059
+Chris McDonough <chrism@agendaless.com>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+8f1d8bf8-68d2-4fbe-a113-2afb08c80ed9
+
+logo_hi.gif
+file
+
+
+
+
+2010-04-29T03:48:08.000000Z
+7ab4a90ed1ee76b9869e30e295314447
+2009-07-27T22:53:49.881952Z
+6059
+Chris McDonough <chrism@agendaless.com>
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+3924
+
+repoze.css
+file
+9973
+
+
+
+2010-08-18T02:38:10.403979Z
+6bf1b3ead4be5d2cc8e9a94a72cb365a
+2010-08-18T02:41:26.045945Z
+9973
+Chris McDonough <chrism@agendaless.com>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+378
+
View
5 docs/.static/.svn/prop-base/logo_hi.gif.svn-base
@@ -0,0 +1,5 @@
+K 13
+svn:mime-type
+V 24
+application/octet-stream
+END
View
BIN  docs/.static/.svn/text-base/logo_hi.gif.svn-base
Binary file not shown
View
25 docs/.static/.svn/text-base/repoze.css.svn-base
@@ -0,0 +1,25 @@
+@import url('default.css');
+body {
+ background-color: #006339;
+}
+
+div.document {
+ background-color: #dad3bd;
+}
+
+div.sphinxsidebar h3, h4, h5, a {
+ color: #127c56 !important;
+}
+
+div.related {
+ color: #dad3bd !important;
+ background-color: #00744a;
+}
+
+div.related a {
+ color: #dad3bd !important;
+}
+
+div.body p, div.body dd, div.body li {
+ text-align: left;
+}
View
BIN  docs/.static/logo_hi.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
25 docs/.static/repoze.css
@@ -0,0 +1,25 @@
+@import url('default.css');
+body {
+ background-color: #006339;
+}
+
+div.document {
+ background-color: #dad3bd;
+}
+
+div.sphinxsidebar h3, h4, h5, a {
+ color: #127c56 !important;
+}
+
+div.related {
+ color: #dad3bd !important;
+ background-color: #00744a;
+}
+
+div.related a {
+ color: #dad3bd !important;
+}
+
+div.body p, div.body dd, div.body li {
+ text-align: left;
+}
View
173 docs/.svn/entries
@@ -0,0 +1,173 @@
+10
+
+dir
+9917
+svn+ssh://repoze@svn.repoze.org/svn/template/trunk/docs
+svn+ssh://repoze@svn.repoze.org/svn
+
+
+
+2009-10-20T02:12:37.441936Z
+6828
+Chris McDonough <chrism@agendaless.com>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+8f1d8bf8-68d2-4fbe-a113-2afb08c80ed9
+
+api.rst
+file
+
+
+
+
+2010-04-29T03:48:08.000000Z
+529cb735b017c86e47b9ce8d1d6f3a36
+2008-10-04T18:30:26.672038Z
+2040
+Tres Seaver <tseaver@palladion.com>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+365
+
+.static
+dir
+
+.templates
+dir
+
+conf.py
+file
+
+
+
+
+2010-04-29T03:48:08.000000Z
+a22fd5980110592da1eddf50b6d71cce
+2009-10-20T02:12:37.441936Z
+6828
+Chris McDonough <chrism@agendaless.com>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+5736
+
+.build
+dir
+
+Makefile
+file
+
+
+
+
+2010-04-29T03:48:08.000000Z
+5e3d27026b2659a71d1c6506df17c40e
+2008-10-04T17:50:35.715428Z
+2037
+Tres Seaver <tseaver@palladion.com>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+2272
+
+index.rst
+file
+
+
+
+
+2010-04-29T03:48:08.000000Z
+746958390e5cec904855a7d780e12cbe
+2008-10-04T18:30:26.672038Z
+2040
+Tres Seaver <tseaver@palladion.com>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+294
+
View
70 docs/.svn/text-base/Makefile.svn-base
@@ -0,0 +1,70 @@
+# Makefile for Sphinx documentation
+#
+
+# You can set these variables from the command line.
+SPHINXOPTS =
+SPHINXBUILD = sphinx-build
+PAPER =
+
+# Internal variables.
+PAPEROPT_a4 = -D latex_paper_size=a4
+PAPEROPT_letter = -D latex_paper_size=letter
+ALLSPHINXOPTS = -d .build/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
+
+.PHONY: help clean html web pickle htmlhelp latex changes linkcheck
+
+help:
+ @echo "Please use \`make <target>' where <target> is one of"
+ @echo " html to make standalone HTML files"
+ @echo " pickle to make pickle files (usable by e.g. sphinx-web)"
+ @echo " htmlhelp to make HTML files and a HTML help project"
+ @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
+ @echo " changes to make an overview over all changed/added/deprecated items"
+ @echo " linkcheck to check all external links for integrity"
+
+clean:
+ -rm -rf .build/*
+
+html:
+ mkdir -p .build/html .build/doctrees
+ $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) .build/html
+ @echo
+ @echo "Build finished. The HTML pages are in .build/html."
+
+pickle:
+ mkdir -p .build/pickle .build/doctrees
+ $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) .build/pickle
+ @echo
+ @echo "Build finished; now you can process the pickle files or run"
+ @echo " sphinx-web .build/pickle"
+ @echo "to start the sphinx-web server."
+
+web: pickle
+
+htmlhelp:
+ mkdir -p .build/htmlhelp .build/doctrees
+ $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) .build/htmlhelp
+ @echo
+ @echo "Build finished; now you can run HTML Help Workshop with the" \
+ ".hhp project file in .build/htmlhelp."
+
+latex:
+ mkdir -p .build/latex .build/doctrees
+ $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) .build/latex
+ @echo
+ @echo "Build finished; the LaTeX files are in .build/latex."
+ @echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \
+ "run these through (pdf)latex."
+
+changes:
+ mkdir -p .build/changes .build/doctrees
+ $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) .build/changes
+ @echo
+ @echo "The overview file is in .build/changes."
+
+linkcheck:
+ mkdir -p .build/linkcheck .build/doctrees
+ $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) .build/linkcheck
+ @echo
+ @echo "Link check complete; look for any errors in the above output " \
+ "or in .build/linkcheck/output.txt."
View
14 docs/.svn/text-base/api.rst.svn-base
@@ -0,0 +1,14 @@
+API Documentation for repoze.atemplate
+======================================
+
+Interfaces
+----------
+
+Document interfaces here. You may want to use the ``.. autointerface::``
+directive provided by :mod:`repoze.sphinx.autointerface`, in which case
+you will need to add it to the extensions in `conf.py`.
+
+Exceptions
+----------
+
+Document any custom exceptions here.
View
185 docs/.svn/text-base/conf.py.svn-base
@@ -0,0 +1,185 @@
+# -*- coding: utf-8 -*-
+#
+# repoze.atemplate documentation build configuration file
+#
+# This file is execfile()d with the current directory set to its containing
+# dir.
+#
+# The contents of this file are pickled, so don't put values in the
+# namespace that aren't pickleable (module imports are okay, they're
+# removed automatically).
+#
+# All configuration values have a default value; values that are commented
+# out serve to show the default value.
+
+import sys, os
+
+# If your extensions are in another directory, add it here. If the
+# directory is relative to the documentation root, use os.path.abspath to
+# make it absolute, like shown here.
+#sys.path.append(os.path.abspath('some/directory'))
+
+# General configuration
+# ---------------------
+
+# Add any Sphinx extension module names here, as strings. They can be
+# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
+extensions = ['sphinx.ext.autodoc']
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['.templates']
+
+# The suffix of source filenames.
+source_suffix = '.rst'
+
+# The master toctree document.
+master_doc = 'index'
+
+# General substitutions.
+project = 'repoze.atemplate'
+copyright = '2009, Repoze Developers <repoze-dev@lists.repoze.org>'
+
+# The default replacements for |version| and |release|, also used in various
+# other places throughout the built documents.
+#
+# The short X.Y version.
+version = '0.0'
+# The full version, including alpha/beta/rc tags.
+release = '0.0'
+
+# There are two options for replacing |today|: either, you set today to
+# some non-false value, then it is used:
+#today = ''
+# Else, today_fmt is used as the format for a strftime call.
+today_fmt = '%B %d, %Y'
+
+# List of documents that shouldn't be included in the build.
+#unused_docs = []
+
+# List of directories, relative to source directories, that shouldn't be
+# searched for source files.
+#exclude_dirs = []
+
+# The reST default role (used for this markup: `text`) to use for all
+# documents.
+#default_role = None
+
+# If true, '()' will be appended to :func: etc. cross-reference text.
+#add_function_parentheses = True
+
+# If true, the current module name will be prepended to all description
+# unit titles (such as .. function::).
+#add_module_names = True
+
+# If true, sectionauthor and moduleauthor directives will be shown in the
+# output. They are ignored by default.
+#show_authors = False
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'sphinx'
+
+
+# Options for HTML output
+# -----------------------
+
+# The style sheet to use for HTML and HTML Help pages. A file of that name
+# must exist either in Sphinx' static/ path, or in one of the custom paths
+# given in html_static_path.
+html_style = 'repoze.css'
+
+# The name for this set of Sphinx documents. If None, it defaults to
+# "<project> v<release> documentation".
+#html_title = None
+
+# A shorter title for the navigation bar. Default is the same as
+# html_title.
+#html_short_title = None
+
+# The name of an image file (within the static path) to place at the top of
+# the sidebar.
+html_logo = '.static/logo_hi.gif'
+
+# The name of an image file (within the static path) to use as favicon of
+# the docs. This file should be a Windows icon file (.ico) being 16x16 or
+# 32x32 pixels large.
+#html_favicon = None
+
+# Add any paths that contain custom static files (such as style sheets)
+# here, relative to this directory. They are copied after the builtin
+# static files, so a file named "default.css" will overwrite the builtin
+# "default.css".
+html_static_path = ['.static']
+
+# If not '', a 'Last updated on:' timestamp is inserted at every page
+# bottom, using the given strftime format.
+html_last_updated_fmt = '%b %d, %Y'
+
+# If true, SmartyPants will be used to convert quotes and dashes to
+# typographically correct entities.
+#html_use_smartypants = True
+
+# Custom sidebar templates, maps document names to template names.
+#html_sidebars = {}
+
+# Additional templates that should be rendered to pages, maps page names to
+# template names.
+#html_additional_pages = {}
+
+# If false, no module index is generated.
+#html_use_modindex = True
+
+# If false, no index is generated.
+#html_use_index = True
+
+# If true, the index is split into individual pages for each letter.
+#html_split_index = False
+
+# If true, the reST sources are included in the HTML build as
+# _sources/<name>.
+#html_copy_source = True
+
+# If true, an OpenSearch description file will be output, and all pages
+# will contain a <link> tag referring to it. The value of this option must
+# be the base URL from which the finished HTML is served.
+#html_use_opensearch = ''
+
+# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").
+#html_file_suffix = ''
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = 'atemplatedoc'
+
+
+# Options for LaTeX output
+# ------------------------
+
+# The paper size ('letter' or 'a4').
+#latex_paper_size = 'letter'
+
+# The font size ('10pt', '11pt' or '12pt').
+#latex_font_size = '10pt'
+
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title,
+# author, document class [howto/manual]).
+latex_documents = [
+ ('index', 'atemplate.tex', 'repoze.atemplate Documentation',
+ 'Repoze Developers', 'manual'),
+]
+
+# The name of an image file (relative to this directory) to place at the
+# top of the title page.
+latex_logo = '.static/logo_hi.gif'
+
+# For "manual" documents, if this is true, then toplevel headings are
+# parts, not chapters.
+#latex_use_parts = False
+
+# Additional stuff for the LaTeX preamble.
+#latex_preamble = ''
+
+# Documents to append as an appendix to all manuals.
+#latex_appendices = []
+
+# If false, no module index is generated.
+#latex_use_modindex = True
View
24 docs/.svn/text-base/index.rst.svn-base
@@ -0,0 +1,24 @@
+Documentation for repoze.atemplate
+==================================
+
+Put the overview of the purpose of the package here.
+
+
+.. toctree::
+ :maxdepth: 2
+
+ api.rst
+
+
+Topic A
+-------
+
+Explain topic.
+
+
+Indices and tables
+------------------
+
+* :ref:`genindex`
+* :ref:`modindex`
+* :ref:`search`
View
28 docs/.templates/.svn/entries
@@ -0,0 +1,28 @@
+10
+
+dir
+9917
+svn+ssh://repoze@svn.repoze.org/svn/template/trunk/docs/.templates
+svn+ssh://repoze@svn.repoze.org/svn
+
+
+
+2008-10-04T17:50:35.715428Z
+2037
+Tres Seaver <tseaver@palladion.com>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+8f1d8bf8-68d2-4fbe-a113-2afb08c80ed9
+
View
70 docs/Makefile
@@ -0,0 +1,70 @@
+# Makefile for Sphinx documentation
+#
+
+# You can set these variables from the command line.
+SPHINXOPTS =
+SPHINXBUILD = sphinx-build
+PAPER =
+
+# Internal variables.
+PAPEROPT_a4 = -D latex_paper_size=a4
+PAPEROPT_letter = -D latex_paper_size=letter
+ALLSPHINXOPTS = -d .build/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
+
+.PHONY: help clean html web pickle htmlhelp latex changes linkcheck
+
+help:
+ @echo "Please use \`make <target>' where <target> is one of"
+ @echo " html to make standalone HTML files"
+ @echo " pickle to make pickle files (usable by e.g. sphinx-web)"
+ @echo " htmlhelp to make HTML files and a HTML help project"
+ @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
+ @echo " changes to make an overview over all changed/added/deprecated items"
+ @echo " linkcheck to check all external links for integrity"
+
+clean:
+ -rm -rf .build/*
+
+html:
+ mkdir -p .build/html .build/doctrees
+ $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) .build/html
+ @echo
+ @echo "Build finished. The HTML pages are in .build/html."
+
+pickle:
+ mkdir -p .build/pickle .build/doctrees
+ $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) .build/pickle
+ @echo
+ @echo "Build finished; now you can process the pickle files or run"
+ @echo " sphinx-web .build/pickle"
+ @echo "to start the sphinx-web server."
+
+web: pickle
+
+htmlhelp:
+ mkdir -p .build/htmlhelp .build/doctrees
+ $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) .build/htmlhelp
+ @echo
+ @echo "Build finished; now you can run HTML Help Workshop with the" \
+ ".hhp project file in .build/htmlhelp."
+
+latex:
+ mkdir -p .build/latex .build/doctrees
+ $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) .build/latex
+ @echo
+ @echo "Build finished; the LaTeX files are in .build/latex."
+ @echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \
+ "run these through (pdf)latex."
+
+changes:
+ mkdir -p .build/changes .build/doctrees
+ $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) .build/changes
+ @echo
+ @echo "The overview file is in .build/changes."
+
+linkcheck:
+ mkdir -p .build/linkcheck .build/doctrees
+ $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) .build/linkcheck
+ @echo
+ @echo "Link check complete; look for any errors in the above output " \
+ "or in .build/linkcheck/output.txt."
View
9 docs/api.rst
@@ -0,0 +1,9 @@
+API Documentation
+-----------------
+
+.. automodule:: pyramid_beaker
+
+.. autofunction:: session_factory_from_settings
+
+.. autofunction:: BeakerSessionFactoryConfig
+
View
196 docs/conf.py
@@ -0,0 +1,196 @@
+# -*- coding: utf-8 -*-
+#
+# pyramid_beaker documentation build configuration file
+#
+# This file is execfile()d with the current directory set to its containing
+# dir.
+#
+# The contents of this file are pickled, so don't put values in the
+# namespace that aren't pickleable (module imports are okay, they're
+# removed automatically).
+#
+# All configuration values have a default value; values that are commented
+# out serve to show the default value.
+
+# If your extensions are in another directory, add it here. If the
+# directory is relative to the documentation root, use os.path.abspath to
+# make it absolute, like shown here.
+#sys.path.append(os.path.abspath('some/directory'))
+
+import sys, os
+
+parent = os.path.dirname(os.path.dirname(__file__))
+sys.path.append(os.path.abspath(parent))
+wd = os.getcwd()
+os.chdir(parent)
+os.system('%s setup.py test -q' % sys.executable)
+os.chdir(wd)
+
+for item in os.listdir(parent):
+ if item.endswith('.egg'):
+ sys.path.append(os.path.join(parent, item))
+
+# General configuration
+# ---------------------
+
+# Add any Sphinx extension module names here, as strings. They can be
+# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
+extensions = ['sphinx.ext.autodoc']
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['.templates']
+
+# The suffix of source filenames.
+source_suffix = '.rst'
+
+# The master toctree document.
+master_doc = 'index'
+
+# General substitutions.
+project = 'pyramid_beaker'
+copyright = '2010, Agendaless Consulting <chrism@plope.com>'
+
+# The default replacements for |version| and |release|, also used in various
+# other places throughout the built documents.
+#
+# The short X.Y version.
+version = '0.0'
+# The full version, including alpha/beta/rc tags.
+release = '0.0'
+
+# There are two options for replacing |today|: either, you set today to
+# some non-false value, then it is used:
+#today = ''
+# Else, today_fmt is used as the format for a strftime call.
+today_fmt = '%B %d, %Y'
+
+# List of documents that shouldn't be included in the build.
+#unused_docs = []
+
+# List of directories, relative to source directories, that shouldn't be
+# searched for source files.
+#exclude_dirs = []
+
+# The reST default role (used for this markup: `text`) to use for all
+# documents.
+#default_role = None
+
+# If true, '()' will be appended to :func: etc. cross-reference text.
+#add_function_parentheses = True
+
+# If true, the current module name will be prepended to all description
+# unit titles (such as .. function::).
+#add_module_names = True
+
+# If true, sectionauthor and moduleauthor directives will be shown in the
+# output. They are ignored by default.
+#show_authors = False
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'sphinx'
+
+
+# Options for HTML output
+# -----------------------
+
+# The style sheet to use for HTML and HTML Help pages. A file of that name
+# must exist either in Sphinx' static/ path, or in one of the custom paths
+# given in html_static_path.
+html_style = 'repoze.css'
+
+# The name for this set of Sphinx documents. If None, it defaults to
+# "<project> v<release> documentation".
+#html_title = None
+
+# A shorter title for the navigation bar. Default is the same as
+# html_title.
+#html_short_title = None
+
+# The name of an image file (within the static path) to place at the top of
+# the sidebar.
+html_logo = '.static/logo_hi.gif'
+
+# The name of an image file (within the static path) to use as favicon of
+# the docs. This file should be a Windows icon file (.ico) being 16x16 or
+# 32x32 pixels large.
+#html_favicon = None
+
+# Add any paths that contain custom static files (such as style sheets)
+# here, relative to this directory. They are copied after the builtin
+# static files, so a file named "default.css" will overwrite the builtin
+# "default.css".
+html_static_path = ['.static']
+
+# If not '', a 'Last updated on:' timestamp is inserted at every page
+# bottom, using the given strftime format.
+html_last_updated_fmt = '%b %d, %Y'
+
+# If true, SmartyPants will be used to convert quotes and dashes to
+# typographically correct entities.
+#html_use_smartypants = True
+
+# Custom sidebar templates, maps document names to template names.
+#html_sidebars = {}
+
+# Additional templates that should be rendered to pages, maps page names to
+# template names.
+#html_additional_pages = {}
+
+# If false, no module index is generated.
+#html_use_modindex = True
+
+# If false, no index is generated.
+#html_use_index = True
+
+# If true, the index is split into individual pages for each letter.
+#html_split_index = False
+
+# If true, the reST sources are included in the HTML build as
+# _sources/<name>.
+#html_copy_source = True
+
+# If true, an OpenSearch description file will be output, and all pages
+# will contain a <link> tag referring to it. The value of this option must
+# be the base URL from which the finished HTML is served.
+#html_use_opensearch = ''
+
+# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").
+#html_file_suffix = ''
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = 'atemplatedoc'
+
+
+# Options for LaTeX output
+# ------------------------
+
+# The paper size ('letter' or 'a4').
+#latex_paper_size = 'letter'
+
+# The font size ('10pt', '11pt' or '12pt').
+#latex_font_size = '10pt'
+
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title,
+# author, document class [howto/manual]).
+latex_documents = [
+ ('index', 'pyramid_beaker.tex', 'pyramid_beaker Documentation',
+ 'Repoze Developers', 'manual'),
+]
+
+# The name of an image file (relative to this directory) to place at the
+# top of the title page.
+latex_logo = '.static/logo_hi.gif'
+
+# For "manual" documents, if this is true, then toplevel headings are
+# parts, not chapters.
+#latex_use_parts = False
+
+# Additional stuff for the LaTeX preamble.
+#latex_preamble = ''
+
+# Documents to append as an appendix to all manuals.
+#latex_appendices = []
+
+# If false, no module index is generated.
+#latex_use_modindex = True
View
18 docs/glossary.rst
@@ -0,0 +1,18 @@
+.. _glossary:
+
+Glossary
+========
+
+.. glossary::
+ :sorted:
+ session factory
+ A callable, which, when called with a single argument named
+ ``request`` (a :term:`request` object), returns a
+ :term:`session` object.
+
+ Beaker
+ A `sessioning and caching package <http://beaker.groovie.org/>`_
+ by Ben Bangert.
+
+ Pyramid
+ A `web framework <http://pylonshq.com/pyramid>`_.
View
74 docs/index.rst
@@ -0,0 +1,74 @@
+pyramid_beaker
+==============
+
+A :term:`Beaker` session factory backend for :term:`Pyramid`.
+
+Usage
+-----
+
+In the configuration portion of your :term:`Pyramid` app, use the
+:func:`pyramid_beaker.BeakerSessionFactoryConfig` function or the
+:func:`pyramid_beaker.session_factory_from_settings` function to
+create a Pyramid :term:`session factory`. Subsequently register that
+session factory with Pyramid. At that point, accessing
+``request.session`` will provide a Pyramid session using Beaker as a
+backend.
+
+:func:`pyramid_beaker.session_factory_from_settings` obtains session
+settings from the ``**settings`` dictionary passed to the
+Configurator. It assumes that you've placed session configuration
+parameters prefixed with ``session.`` in your Pyramid application's
+``.ini`` file. For example:
+
+.. code-block:: ini
+
+ [app:myapp]
+ .. other settings ..
+ session.type = file
+ session.data_dir = %(here)s/data/sessions/data
+ session.lock_dir = %(here)s/data/sessions/lock
+ session.key = mykey
+ session.secret = mysecret
+
+If your ``.ini`` file has such settings, you can use
+:func:`pyramid_beaker.session_factory_from_settings` in your
+application's configuration. For example, let's assume this code is
+in the ``__init__.py`` of your Pyramid application that uses an
+``.ini`` file with the ``session.`` settings above to obtain its
+``**settings`` dictionary.
+
+.. code-block:: python
+
+ from pyramid_beaker import session_factory_from_settings
+ from pyramid.configuration import configurator
+
+ def app(global_config, **settings):
+ """ This function returns a WSGI application.
+
+ It is usually called by the PasteDeploy framework during
+ ``paster serve``.
+ """
+ zcml_file = settings.get('configure_zcml', 'configure.zcml')
+ session_factory = session_factory_from_settings(settings)
+ config = Configurator(root_factory=get_root, settings=settings)
+ config.begin()
+ config.set_session_factory(session_factory)
+ # ... other configuration stuff...
+ config.end()
+ return config.make_wsgi_app()
+
+API
+---
+
+.. toctree::
+ :maxdepth: 2
+
+ api.rst
+
+Indices and tables
+------------------
+
+* :ref:`glossary`
+* :ref:`genindex`
+* :ref:`modindex`
+* :ref:`search`
View
62 pyramid_beaker/.svn/entries
@@ -0,0 +1,62 @@
+10
+
+dir
+9917
+svn+ssh://repoze@svn.repoze.org/svn/template/trunk/repoze
+svn+ssh://repoze@svn.repoze.org/svn
+
+
+
+2009-10-18T22:02:58.566202Z
+6805
+Chris McDonough <chrism@agendaless.com>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+8f1d8bf8-68d2-4fbe-a113-2afb08c80ed9
+
+__init__.py
+file
+
+
+
+
+2010-04-29T03:48:08.000000Z
+050042c7144e01b0a29eb3d46929e962
+2008-07-04T04:37:00.618606Z
+1225
+Chris McDonough <chrism@agendaless.com>
+has-props
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+56
+
View
9 pyramid_beaker/.svn/prop-base/__init__.py.svn-base
@@ -0,0 +1,9 @@
+K 13
+svn:eol-style
+V 6
+native
+K 12
+svn:keywords
+V 23
+Author Date Id Revision
+END
View
1  pyramid_beaker/.svn/text-base/__init__.py.svn-base
@@ -0,0 +1 @@
+__import__('pkg_resources').declare_namespace(__name__)
View
60 pyramid_beaker/__init__.py
@@ -0,0 +1,60 @@
+from beaker.session import SessionObject
+from beaker.util import coerce_session_params
+
+## session.type = file
+## session.data_dir = %(here)s/data/sessions/data
+## session.lock_dir = %(here)s/data/sessions/lock
+## session.key = {{project}}
+## session.secret = your_app_secret_string
+
+def BeakerSessionFactoryConfig(**options):
+ """ Return a Pyramid session factory using Beaker session settings
+ supplied directly as ``**options``"""
+ if not 'auto' in options:
+ # XXX beaker badly wants people to call save; i don't know
+ # why it needs it if they call methods that do mutation
+ options['auto'] = True
+
+ class PyramidBeakerSessionObject(SessionObject):
+ _options = options
+ def __init__(self, request):
+ SessionObject.__init__(self, request.environ, **self._options)
+ def session_callback(request, response):
+ exception = getattr(request, 'exception', None)
+ if exception is None:
+ if self.accessed():
+ self.persist()
+ if self.__dict__['_headers']['set_cookie']:
+ cook = self.__dict__['_headers']['cookie_out']
+ if cook:
+ response.headerlist.append(('Set-Cookie', cook))
+ request.add_response_callback(session_callback)
+
+ @property
+ def new(self):
+ return self.last_accessed is None
+
+ changed = SessionObject.save
+
+ # XXX modified
+
+ return PyramidBeakerSessionObject
+
+
+def session_factory_from_settings(settings):
+ """ Return a Pyramid session factory using Beaker session settings
+ supplied from a Paste configuration file"""
+ prefixes = ('session.', 'beaker.session.')
+ options = {}
+
+ # Pull out any config args meant for beaker session. if there are any
+ for k, v in settings.items():
+ for prefix in prefixes:
+ if k.startswith(prefix):
+ option_name = k[len(prefix):]
+ options[option_name] = v
+
+ options = coerce_session_params(options)
+ return BeakerSessionFactoryConfig(**options)
+
+
View
44 pyramid_beaker/tests.py
@@ -0,0 +1,44 @@
+import unittest
+
+class TestPyramidBeakerSessionObject(unittest.TestCase):
+ def _makeOne(self, request, **options):
+ from pyramid_beaker import BeakerSessionFactoryConfig
+ return BeakerSessionFactoryConfig(**options)(request)
+
+ def test_callback(self):
+ request = DummyRequest()
+ session = self._makeOne(request)
+ session['fred'] = 42
+ session.save()
+ self.assertEqual(session.accessed(), True)
+ self.failUnless(len(request.callbacks) > 0)
+ response= DummyResponse()
+ request.callbacks[0](request, response)
+ self.failUnless(response.headerlist)
+
+ def test_new(self):
+ request = DummyRequest()
+ session = self._makeOne(request)
+ self.failUnless(session.new)
+
+class Test_session_factory_from_settings(unittest.TestCase):
+ def _callFUT(self, settings):
+ from pyramid_beaker import session_factory_from_settings
+ return session_factory_from_settings(settings)
+
+ def test_it(self):
+ settings = {'session.auto':'true', 'session.key':'foo'}
+ factory = self._callFUT(settings)
+ self.assertEqual(factory._options, {'auto':True, 'key':'foo'})
+
+class DummyRequest:
+ def __init__(self):
+ self.callbacks = []
+ self.environ = {}
+
+ def add_response_callback(self, callback):
+ self.callbacks.append(callback)
+
+class DummyResponse:
+ def __init__(self):
+ self.headerlist = []
View
10 setup.cfg
@@ -0,0 +1,10 @@
+[easy_install]
+zip_ok = false
+
+[nosetests]
+match=^test
+where=pyramid_beaker
+nocapture=1
+cover-package=pyramid_beaker
+cover-erase=1
+
View
47 setup.py
@@ -0,0 +1,47 @@
+##############################################################################
+#
+# Copyright (c) 2010 Agendaless Consulting and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the BSD-like license at
+# http://www.repoze.org/LICENSE.txt. A copy of the license should accompany
+# this distribution. THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL
+# EXPRESS OR IMPLIED WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO,
+# THE IMPLIED WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND
+# FITNESS FOR A PARTICULAR PURPOSE
+#
+##############################################################################
+
+import os
+
+from setuptools import setup
+from setuptools import find_packages
+
+here = os.path.abspath(os.path.dirname(__file__))
+README = open(os.path.join(here, 'README.txt')).read()
+CHANGES = open(os.path.join(here, 'CHANGES.txt')).read()
+
+requires = ['pyramid', 'beaker']
+
+setup(name='pyramid_beaker',
+ version='0.0',
+ description='Beaker session factory backend for Pyramid',
+ long_description=README + '\n\n' + CHANGES,
+ classifiers=[
+ "Intended Audience :: Developers",
+ "Framework :: Pylons",
+ "Programming Language :: Python",
+ ],
+ keywords='web wsgi pylons pyramid',
+ author="Agendaless Consulting",
+ author_email="repoze-dev@lists.repoze.org",
+ url="http://www.repoze.org",
+ license="BSD-derived (http://www.repoze.org/LICENSE.txt)",
+ packages=find_packages(),
+ include_package_data=True,
+ zip_safe=False,
+ tests_require = requires,
+ install_requires = requires,
+ test_suite="pyramid_beaker",
+ )
+
Please sign in to comment.
Something went wrong with that request. Please try again.