Преглед на файлове

[desktop] Remove Paste 1.7.2

Erick Tryzelaar преди 10 години
родител
ревизия
ae87706213
променени са 100 файла, в които са добавени 0 реда и са изтрити 9655 реда
  1. 0 119
      desktop/core/ext-py/Paste-1.7.2/PKG-INFO
  2. 0 110
      desktop/core/ext-py/Paste-1.7.2/docs/DeveloperGuidelines.txt
  3. 0 102
      desktop/core/ext-py/Paste-1.7.2/docs/StyleGuide.txt
  4. 0 15
      desktop/core/ext-py/Paste-1.7.2/docs/_static/paste.css
  5. 0 20
      desktop/core/ext-py/Paste-1.7.2/docs/_templates/layout.html
  6. 0 15
      desktop/core/ext-py/Paste-1.7.2/docs/community/index.txt
  7. 0 35
      desktop/core/ext-py/Paste-1.7.2/docs/community/mailing-list.txt
  8. 0 13
      desktop/core/ext-py/Paste-1.7.2/docs/community/repository.txt
  9. 0 132
      desktop/core/ext-py/Paste-1.7.2/docs/conf.py
  10. 0 394
      desktop/core/ext-py/Paste-1.7.2/docs/default.css
  11. 0 148
      desktop/core/ext-py/Paste-1.7.2/docs/developer-features.txt
  12. 0 484
      desktop/core/ext-py/Paste-1.7.2/docs/do-it-yourself-framework.txt
  13. 0 36
      desktop/core/ext-py/Paste-1.7.2/docs/download/index.txt
  14. 0 109
      desktop/core/ext-py/Paste-1.7.2/docs/future.txt
  15. 0 5
      desktop/core/ext-py/Paste-1.7.2/docs/include/contact.txt
  16. 0 5
      desktop/core/ext-py/Paste-1.7.2/docs/include/reference_header.txt
  17. 0 69
      desktop/core/ext-py/Paste-1.7.2/docs/index.txt
  18. 0 20
      desktop/core/ext-py/Paste-1.7.2/docs/license.txt
  19. 0 14
      desktop/core/ext-py/Paste-1.7.2/docs/modules/auth.auth_tkt.txt
  20. 0 11
      desktop/core/ext-py/Paste-1.7.2/docs/modules/auth.basic.txt
  21. 0 11
      desktop/core/ext-py/Paste-1.7.2/docs/modules/auth.cas.txt
  22. 0 12
      desktop/core/ext-py/Paste-1.7.2/docs/modules/auth.cookie.txt
  23. 0 12
      desktop/core/ext-py/Paste-1.7.2/docs/modules/auth.digest.txt
  24. 0 10
      desktop/core/ext-py/Paste-1.7.2/docs/modules/auth.form.txt
  25. 0 10
      desktop/core/ext-py/Paste-1.7.2/docs/modules/auth.grantip.txt
  26. 0 11
      desktop/core/ext-py/Paste-1.7.2/docs/modules/auth.multi.txt
  27. 0 12
      desktop/core/ext-py/Paste-1.7.2/docs/modules/auth.open_id.txt
  28. 0 10
      desktop/core/ext-py/Paste-1.7.2/docs/modules/cascade.txt
  29. 0 11
      desktop/core/ext-py/Paste-1.7.2/docs/modules/cgiapp.txt
  30. 0 10
      desktop/core/ext-py/Paste-1.7.2/docs/modules/cgitb_catcher.txt
  31. 0 13
      desktop/core/ext-py/Paste-1.7.2/docs/modules/debug.debugapp.txt
  32. 0 15
      desktop/core/ext-py/Paste-1.7.2/docs/modules/debug.fsdiff.txt
  33. 0 10
      desktop/core/ext-py/Paste-1.7.2/docs/modules/debug.prints.txt
  34. 0 13
      desktop/core/ext-py/Paste-1.7.2/docs/modules/debug.profile.txt
  35. 0 12
      desktop/core/ext-py/Paste-1.7.2/docs/modules/debug.watchthreads.txt
  36. 0 11
      desktop/core/ext-py/Paste-1.7.2/docs/modules/debug.wdg_validate.txt
  37. 0 12
      desktop/core/ext-py/Paste-1.7.2/docs/modules/errordocument.txt
  38. 0 9
      desktop/core/ext-py/Paste-1.7.2/docs/modules/evalexception.txt
  39. 0 48
      desktop/core/ext-py/Paste-1.7.2/docs/modules/exceptions.txt
  40. 0 15
      desktop/core/ext-py/Paste-1.7.2/docs/modules/fileapp.txt
  41. 0 40
      desktop/core/ext-py/Paste-1.7.2/docs/modules/fixture.txt
  42. 0 10
      desktop/core/ext-py/Paste-1.7.2/docs/modules/gzipper.txt
  43. 0 49
      desktop/core/ext-py/Paste-1.7.2/docs/modules/httpexceptions.txt
  44. 0 8
      desktop/core/ext-py/Paste-1.7.2/docs/modules/httpheaders.txt
  45. 0 10
      desktop/core/ext-py/Paste-1.7.2/docs/modules/httpserver.txt
  46. 0 10
      desktop/core/ext-py/Paste-1.7.2/docs/modules/lint.txt
  47. 0 10
      desktop/core/ext-py/Paste-1.7.2/docs/modules/pony.txt
  48. 0 13
      desktop/core/ext-py/Paste-1.7.2/docs/modules/progress.txt
  49. 0 14
      desktop/core/ext-py/Paste-1.7.2/docs/modules/proxy.txt
  50. 0 10
      desktop/core/ext-py/Paste-1.7.2/docs/modules/recursive.txt
  51. 0 13
      desktop/core/ext-py/Paste-1.7.2/docs/modules/registry.txt
  52. 0 14
      desktop/core/ext-py/Paste-1.7.2/docs/modules/reloader.txt
  53. 0 19
      desktop/core/ext-py/Paste-1.7.2/docs/modules/request.txt
  54. 0 15
      desktop/core/ext-py/Paste-1.7.2/docs/modules/response.txt
  55. 0 11
      desktop/core/ext-py/Paste-1.7.2/docs/modules/session.txt
  56. 0 11
      desktop/core/ext-py/Paste-1.7.2/docs/modules/transaction.txt
  57. 0 10
      desktop/core/ext-py/Paste-1.7.2/docs/modules/translogger.txt
  58. 0 10
      desktop/core/ext-py/Paste-1.7.2/docs/modules/url.txt
  59. 0 11
      desktop/core/ext-py/Paste-1.7.2/docs/modules/urlmap.txt
  60. 0 14
      desktop/core/ext-py/Paste-1.7.2/docs/modules/urlparser.txt
  61. 0 12
      desktop/core/ext-py/Paste-1.7.2/docs/modules/util.import_string.txt
  62. 0 11
      desktop/core/ext-py/Paste-1.7.2/docs/modules/util.multidict.txt
  63. 0 19
      desktop/core/ext-py/Paste-1.7.2/docs/modules/wsgilib.txt
  64. 0 10
      desktop/core/ext-py/Paste-1.7.2/docs/modules/wsgiwrappers.txt
  65. 0 917
      desktop/core/ext-py/Paste-1.7.2/docs/news.txt
  66. 0 150
      desktop/core/ext-py/Paste-1.7.2/docs/paste-httpserver-threadpool.txt
  67. 0 42
      desktop/core/ext-py/Paste-1.7.2/docs/test_server.ini
  68. 0 156
      desktop/core/ext-py/Paste-1.7.2/docs/testing-applications.txt
  69. 0 304
      desktop/core/ext-py/Paste-1.7.2/docs/url-parsing-with-wsgi.txt
  70. 0 382
      desktop/core/ext-py/Paste-1.7.2/docs/web/default-site.css
  71. 0 69
      desktop/core/ext-py/Paste-1.7.2/docs/web/site.js
  72. 0 90
      desktop/core/ext-py/Paste-1.7.2/docs/web/style.css
  73. 0 17
      desktop/core/ext-py/Paste-1.7.2/paste/__init__.py
  74. 0 9
      desktop/core/ext-py/Paste-1.7.2/paste/auth/__init__.py
  75. 0 352
      desktop/core/ext-py/Paste-1.7.2/paste/auth/auth_tkt.py
  76. 0 122
      desktop/core/ext-py/Paste-1.7.2/paste/auth/basic.py
  77. 0 99
      desktop/core/ext-py/Paste-1.7.2/paste/auth/cas.py
  78. 0 395
      desktop/core/ext-py/Paste-1.7.2/paste/auth/cookie.py
  79. 0 213
      desktop/core/ext-py/Paste-1.7.2/paste/auth/digest.py
  80. 0 149
      desktop/core/ext-py/Paste-1.7.2/paste/auth/form.py
  81. 0 113
      desktop/core/ext-py/Paste-1.7.2/paste/auth/grantip.py
  82. 0 79
      desktop/core/ext-py/Paste-1.7.2/paste/auth/multi.py
  83. 0 412
      desktop/core/ext-py/Paste-1.7.2/paste/auth/open_id.py
  84. 0 133
      desktop/core/ext-py/Paste-1.7.2/paste/cascade.py
  85. 0 271
      desktop/core/ext-py/Paste-1.7.2/paste/cgiapp.py
  86. 0 116
      desktop/core/ext-py/Paste-1.7.2/paste/cgitb_catcher.py
  87. 0 120
      desktop/core/ext-py/Paste-1.7.2/paste/config.py
  88. 0 5
      desktop/core/ext-py/Paste-1.7.2/paste/debug/__init__.py
  89. 0 79
      desktop/core/ext-py/Paste-1.7.2/paste/debug/debugapp.py
  90. 0 435
      desktop/core/ext-py/Paste-1.7.2/paste/debug/doctest_webapp.py
  91. 0 409
      desktop/core/ext-py/Paste-1.7.2/paste/debug/fsdiff.py
  92. 0 148
      desktop/core/ext-py/Paste-1.7.2/paste/debug/prints.py
  93. 0 227
      desktop/core/ext-py/Paste-1.7.2/paste/debug/profile.py
  94. 0 93
      desktop/core/ext-py/Paste-1.7.2/paste/debug/testserver.py
  95. 0 347
      desktop/core/ext-py/Paste-1.7.2/paste/debug/watchthreads.py
  96. 0 117
      desktop/core/ext-py/Paste-1.7.2/paste/debug/wdg_validate.py
  97. 0 372
      desktop/core/ext-py/Paste-1.7.2/paste/errordocument.py
  98. 0 7
      desktop/core/ext-py/Paste-1.7.2/paste/evalexception/__init__.py
  99. 0 68
      desktop/core/ext-py/Paste-1.7.2/paste/evalexception/evalcontext.py
  100. 0 161
      desktop/core/ext-py/Paste-1.7.2/paste/evalexception/media/debug.js

+ 0 - 119
desktop/core/ext-py/Paste-1.7.2/PKG-INFO

@@ -1,119 +0,0 @@
-Metadata-Version: 1.0
-Name: Paste
-Version: 1.7.2
-Summary: Tools for using a Web Server Gateway Interface stack
-Home-page: http://pythonpaste.org
-Author: Ian Bicking
-Author-email: ianb@colorstudy.com
-License: MIT
-Description: These provide several pieces of "middleware" (or filters) that can be nested to build web applications.  Each
-        piece of middleware uses the WSGI (`PEP 333`_) interface, and should
-        be compatible with other middleware based on those interfaces.
-        
-        .. _PEP 333: http://www.python.org/peps/pep-0333.html
-        
-        Includes these features...
-        
-        Testing
-        -------
-        
-        * A fixture for testing WSGI applications conveniently and in-process,
-        in ``paste.fixture``
-        
-        * A fixture for testing command-line applications, also in
-        ``paste.fixture``
-        
-        * Check components for WSGI-compliance in ``paste.lint``
-        
-        Dispatching
-        -----------
-        
-        * Chain and cascade WSGI applications (returning the first non-error
-        response) in ``paste.cascade``
-        
-        * Dispatch to several WSGI applications based on URL prefixes, in
-        ``paste.urlmap``
-        
-        * Allow applications to make subrequests and forward requests
-        internally, in ``paste.recursive``
-        
-        Web Application
-        ---------------
-        
-        * Run CGI programs as WSGI applications in ``paste.cgiapp``
-        
-        * Traverse files and load WSGI applications from ``.py`` files (or
-        static files), in ``paste.urlparser``
-        
-        * Serve static directories of files, also in ``paste.urlparser``; also
-        in that module serving from Egg resources using ``pkg_resources``.
-        
-        Tools
-        -----
-        
-        * Catch HTTP-related exceptions (e.g., ``HTTPNotFound``) and turn them
-        into proper responses in ``paste.httpexceptions``
-        
-        * Several authentication techniques, including HTTP (Basic and
-        Digest), signed cookies, and CAS single-signon, in the
-        ``paste.auth`` package.
-        
-        * Create sessions in ``paste.session`` and ``paste.flup_session``
-        
-        * Gzip responses in ``paste.gzip``
-        
-        * A wide variety of routines for manipulating WSGI requests and
-        producing responses, in ``paste.request``, ``paste.response`` and
-        ``paste.wsgilib``
-        
-        Debugging Filters
-        -----------------
-        
-        * Catch (optionally email) errors with extended tracebacks (using
-        Zope/ZPT conventions) in ``paste.exceptions``
-        
-        * Catch errors presenting a `cgitb
-        <http://python.org/doc/current/lib/module-cgitb.html>`_-based
-        output, in ``paste.cgitb_catcher``.
-        
-        * Profile each request and append profiling information to the HTML,
-        in ``paste.debug.profile``
-        
-        * Capture ``print`` output and present it in the browser for
-        debugging, in ``paste.debug.prints``
-        
-        * Validate all HTML output from applications using the `WDG Validator
-        <http://www.htmlhelp.com/tools/validator/>`_, appending any errors
-        or warnings to the page, in ``paste.debug.wdg_validator``
-        
-        Other Tools
-        -----------
-        
-        * A file monitor to allow restarting the server when files have been
-        updated (for automatic restarting when editing code) in
-        ``paste.reloader``
-        
-        * A class for generating and traversing URLs, and creating associated
-        HTML code, in ``paste.url``
-        
-        The latest version is available in a `Subversion repository
-        <http://svn.pythonpaste.org/Paste/trunk#egg=Paste-dev>`_.
-        
-        For the latest changes see the `news file
-        <http://pythonpaste.org/news.html>`_.
-        
-        
-Keywords: web application server wsgi
-Platform: UNKNOWN
-Classifier: Development Status :: 5 - Production/Stable
-Classifier: Intended Audience :: Developers
-Classifier: License :: OSI Approved :: MIT License
-Classifier: Programming Language :: Python
-Classifier: Topic :: Internet :: WWW/HTTP
-Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
-Classifier: Topic :: Software Development :: Libraries :: Python Modules
-Classifier: Topic :: Internet :: WWW/HTTP :: WSGI
-Classifier: Topic :: Internet :: WWW/HTTP :: WSGI :: Application
-Classifier: Topic :: Internet :: WWW/HTTP :: WSGI :: Middleware
-Classifier: Topic :: Internet :: WWW/HTTP :: WSGI :: Server
-Classifier: Framework :: Paste

+ 0 - 110
desktop/core/ext-py/Paste-1.7.2/docs/DeveloperGuidelines.txt

@@ -1,110 +0,0 @@
-++++++++++++++++++++++++++++
-Python Paste Developer Guide
-++++++++++++++++++++++++++++
-
-Hi.  Welcome to Paste.  I hope you enjoy your stay here.
-
-I hope to bring together multiple efforts here, for Paste to support
-multiple frameworks and directions, while presenting a fairly
-integrated frontend to users.  How to do that?  That's an open
-question, and this code is in some ways an exploration.
-
-There's some basic principles:
-
-* Keep stuff decoupled.
-
-* Must be testable.  Of course tested is even better than testable.
-
-* Use WSGI standards for communication between decoupled libraries.
-
-* When possible, use HTTP semantics for communicating between
-  libraries (e.g., indicate cachability using the appropriate HTTP
-  headers).
-
-* When possible, use WSGI as a wrapper around web-neutral libraries.
-  For instance, the configuration is a simple library, but the WSGI
-  middleware that puts the configuration in place is really really
-  simple.  If it could be used outside of a web context, then having
-  both a library and middleware form is good.
-
-* Entry into frameworks should be easy, but exit should also be easy.
-  Heterogeneous frameworks and applications are the ambition.  But we
-  have to get some messiness into Paste before we can try to resolve
-  that messiness.
-
-* When all is said and done, users should be able to ignore much of
-  what we've done and focus on writing their applications, and Stuff
-  Just Works.  Documentation is good; stuff that works without user
-  intervention is better.
-
-Developer Info
-==============
-
-Mostly, if there's a problem we can discuss it and work it out, no one
-is going to bite your head off for committing something.
-
-* Framework-like things should go in subpackages, or perhaps in
-  separate distributions entirely (Paste WebKit and Wareweb were
-  extracted for this reason).
-
-* Integrating external servers and frameworks is also interesting, but
-  it's best to introduce that as a requirement instead of including
-  the work here.  Paste Script contains several wrappers for external
-  projects (servers in particular).
-
-* Tests are good.  We use py.test_, because it is simple.  I want to
-  use doctests too, but the infrastructure isn't really there now --
-  but please feel free to use those too.  ``unittest`` is kind of
-  annoying, and py.test is both more powerful and easier to write for.
-  Tests should go in the ``tests/`` directory.  ``paste.fixture``
-  contains some convenience functions for testing WSGI applications
-  and middleware.  Pay particular attention to ``TestApp``.
-  
-.. _py.test: http://codespeak.net/py/current/doc/test.html
-
-* If you move something around that someone may be using, keep their
-  imports working and introduce a warning, like::
-
-    def backward_compat_function(*args, **kw):
-        import warnings
-        # Deprecated on 2005 Mar 5
-        warnings.warn('Moved to foo.function', DeprecationWarning, 2)
-        return foo.function(*args, **kw)
-
-* If something is really experimental, put it in your home directory,
-  or make a branch in your home directory.  You can make a home
-  directory for yourself, in ``http://svn.w4py.org/home/username``.
-
-* Not everything in the repository or even in the trunk will
-  necessarily go into the release.  The release should contain stuff
-  that is tested, documented, and useful.  Each module or feature also
-  needs a champion -- someone who will stand by the code, answer
-  questions, etc.  It doesn't have to be the original developer, but
-  there has to be *someone*.  So when a release is cut, if some
-  modules don't fulfill that they may be left out.
-
-* Try to keep to the `Style Guidelines`_.  But if you are bringing in
-  outside work, don't stress out too much about it.  Still, if you
-  have a choice, follow that.  Those guidelines are meant to represent
-  conventional Python style guides, there's nothing out of the normal
-  there.
-
-.. _Style Guidelines: StyleGuide.html
-
-* Write your docstrings in `restructured text
-  <http://docutils.sourceforge.net/rst.html>`_.  As time goes on, I
-  want to rely on docstrings more for documentation, with shorter
-  narrative documentation pointing into the documentation generated
-  from docstrings.
-
-  The generation is done with `Pudge <http://pudge.lesscode.org/>`_.
-  To try generating the documentation, this should work::
-
-    $ easy_install svn://lesscode.org/buildutils/trunk \
-                   svn://lesscode.org/pudge/trunk
-    $ cd Paste
-    $ python setup.py pudge
-
-  This will install Pudge and `buildutils
-  <http://buildutils.lesscode.org/>`_, and then generate the
-  documentation into ``Paste/docs/html/``.

+ 0 - 102
desktop/core/ext-py/Paste-1.7.2/docs/StyleGuide.txt

@@ -1,102 +0,0 @@
-+++++++++++++++++++
-Paste Style Guide
-+++++++++++++++++++
-
-Generally you should follow the recommendations in `PEP 8`_, the
-Python Style Guide.  Some things to take particular note of:
-
-.. _PEP 8: http://www.python.org/peps/pep-0008.html
-
-* **No tabs**.  Not anywhere.  Always indent with 4 spaces.
-
-* I don't stress too much on line length.  But try to break lines up
-  by grouping with parenthesis instead of with backslashes (if you
-  can).  Do asserts like::
-
-    assert some_condition(a, b), (
-        "Some condition failed, %r isn't right!" % a)
-
-* But if you are having problems with line length, maybe you should
-  just break the expression up into multiple statements.
-
-* Blank lines between methods, unless they are very small and closely
-  bound to each other.
-
-* Don't use the form ``condition and trueValue or falseValue``.  Break
-  it out and use a variable.
-
-* I (Ian Bicking) am very picky about whitespace.  There's one and
-  only one right way to do it.  Good examples::
-
-    short = 3
-    longerVar = 4
-
-    if x == 4:
-        do stuff
-
-    func(arg1='a', arg2='b')
-    func((a + b)*10)
-
-  **Bad** examples::
-
-    short    =3
-    longerVar=4
-
-    if x==4: do stuff
-
-    func(arg1 = 'a', arg2 = 'b')
-    func(a,b)
-    func( a, b )
-    [ 1, 2, 3 ]
-
-  If the whitespace isn't right, it'll annoy me and I'll feel a need
-  to fix it.  Really, this whitespace stuff shouldn't be that
-  controversial should it?  Some particular points that I feel
-  strongly about:
-
-  * No space after a function name (bad: ``func (arg)``).
-  * No space after or before  a parenthesis (bad: ``func( arg )``).
-  * Always one space after a comma (bad: ``func(a,b)``).
-
-* Use ``@@`` to mark something that is suboptimal, or where you have a
-  concern that it's not right.  Try to also date it and put your
-  username there.
-
-* Docstrings are good.  They should look like::
-
-    class AClass(object):
-        """
-        doc string...
-        """
-
-  Don't use single quotes (''') -- they tend to cause problems in
-  Emacs.  Don't bother trying make the string less vertically compact.
-
-* Comments go right before the thing they are commenting on.
-
-* Methods never, ever, ever start with capital letters.  Generally
-  only classes are capitalized.  But definitely never methods.
-
-* Use ``cls`` to refer to a class.  Use ``meta`` to refer to a
-  metaclass (which also happens to be a class, but calling a metaclass
-  ``cls`` will be confusing).
-
-* Use ``isinstance`` instead of comparing types.  E.g.::
-
-    if isinstance(var, str): ...
-    # Bad:
-    if type(var) is StringType: ...
-
-* Never, ever use two leading underscores.  This is annoyingly
-  private.  If name clashes are a concern, use explicit name mangling
-  instead (e.g., ``_MyThing_blahblah``).  This is essentially the same
-  thing as double-underscore, only it's transparent where double
-  underscore obscures.
-
-* Module names should be unique in the package.  Subpackages shouldn't
-  share module names with sibling or parent packages.  Sadly this
-  isn't possible for ``__init__.py``, but it's otherwise easy enough.
-
-* Module names should be all lower case, and probably have no
-  underscores (smushedwords).
-

+ 0 - 15
desktop/core/ext-py/Paste-1.7.2/docs/_static/paste.css

@@ -1,15 +0,0 @@
-a.invisible-link {
-  color: #fff;
-  text-decoration: none;
-}
-
-a.invisible-link:visited {
-  color: #fff;
-  text-decoration: none;
-}
-
-a.invisible:link {
-  color: #fff;
-  text-decoration: none;
-}
-

+ 0 - 20
desktop/core/ext-py/Paste-1.7.2/docs/_templates/layout.html

@@ -1,20 +0,0 @@
-{% extends "!layout.html" %}
-
-{% block extrahead %}
-{{ super() }}
-<link rel="stylesheet" type="text/css"
- href="{{ pathto('_static/paste.css') }}">
-{% endblock %}
-
-{% block sidebartoc %}
-<h3><a href="http://pythonpaste.org/" class="invisible-link">Python Paste</a></h3>
-
-<ul>
-<li><a href="http://trac.pythonpaste.org">Issue tracker</a></li>
-<li><a href="http://pythonpaste.org/">Paste core</a></li>
-<li><a href="http://pythonpaste.org/deploy/">Paste Deploy</a></li>
-<li><a href="http://pythonpaste.org/script/">Paste Script</a></li>
-</ul>
-
-{{ super() }}
-{% endblock %}

+ 0 - 15
desktop/core/ext-py/Paste-1.7.2/docs/community/index.txt

@@ -1,15 +0,0 @@
-Community
-=========
-
-Much of the communication goes on in the `mailing lists
-<mailing-list.html>`_; see that page for information on the lists.
-
-For live IRC discussion, try the ``#pythonpaste`` channel on `Freenode
-<http://freenode.net/>`_.
-
-If you find bugs in the code or documentation, please `submit a ticket
-<http://pythonpaste.org/trac/report>`_.  You can also `view tickets
-<http://pythonpaste.org/trac/report>`_.
-
-
-

+ 0 - 35
desktop/core/ext-py/Paste-1.7.2/docs/community/mailing-list.txt

@@ -1,35 +0,0 @@
-Mailing Lists
-=============
-
-General discussion and questions should go to: 
-
-`paste-users@pythonpaste.org <http://pythonpaste.org/mailman/listinfo/paste-users>`_:
-    `Subscribe <http://pythonpaste.org/mailman/listinfo/paste-users>`__,
-    `Archives <http://pythonpaste.org/archives/list/paste-users.en.html>`__
-
-To receive announcements:
-
-`paste-news@pythonpaste.org <http://pythonpaste.org/mailman/listinfo/paste-news>`_:
-    `Subscribe <http://pythonpaste.org/mailman/listinfo/paste-news>`__,
-    `Archives <http://pythonpaste.org/archives/list/paste-news.en.html>`__
-
-To receive notification of new checkins:
-
-`paste-checkins@pythonpaste.org <http://pythonpaste.org/mailman/listinfo/paste-checkins>`_:
-    `Subscribe <http://pythonpaste.org/mailman/listinfo/paste-checkins>`__,
-    `RSS feed <http://pythonpaste.org/trac/timeline/?daysback=90&max=50&wiki=on&ticket=on&changeset=on&milestone=on&format=rss>`_
-
-Bug reports should be added to the tracker, but you can be notified of
-new bugs on the list:
-
-`paste-bugs@pythonpaste.org <http://pythonpaste.org/mailman/listinfo/paste-bugs>`_:
-    `Subscribe <http://pythonpaste.org/mailman/listinfo/paste-bugs>`__,
-    `View bug reports <http://pythonpaste.org/trac/report>`__,
-    `Submit bug report <http://pythonpaste.org/trac/newticket>`_
-
-More abstract discussion of Python web programming should go to:
-
-`web-sig@python.org <http://mail.python.org/mailman/listinfo/web-sig>`_:
-    `Subscribe <http://mail.python.org/mailman/listinfo/web-sig>`__,
-    `Archives <http://www.python.org/pipermail/web-sig/>`__
-

+ 0 - 13
desktop/core/ext-py/Paste-1.7.2/docs/community/repository.txt

@@ -1,13 +0,0 @@
-Repository
-==========
-
-Paste is kept in a `Subversion <http://subversion.tigris.org/>`_
-repository at http://svn.pythonpaste.org/Paste
-
-If you are using a command-line Subversion client, you can check
-it out like::
-
-    svn co http://svn.pythonpaste.org/Paste/trunk Paste
-
-If you are on Windows you may want to use `TortoiseSVN
-<http://tortoisesvn.tigris.org/>`_.

+ 0 - 132
desktop/core/ext-py/Paste-1.7.2/docs/conf.py

@@ -1,132 +0,0 @@
-# -*- coding: utf-8 -*-
-#
-# Paste documentation build configuration file, created by
-# sphinx-quickstart on Tue Apr 22 22:08:49 2008.
-#
-# 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
-
-# If your extensions are in another directory, add it here.
-#sys.path.append('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 = '.txt'
-
-# The master toctree document.
-master_doc = 'index'
-
-# General substitutions.
-project = 'Paste'
-copyright = '2008, Ian Bicking'
-
-# The default replacements for |version| and |release|, also used in various
-# other places throughout the built documents.
-#
-# The short X.Y version.
-version = '1.7'
-# The full version, including alpha/beta/rc tags.
-release = '1.7.2'
-
-# 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 = ['include/contact.txt', 'include/reference_header.txt']
-
-# 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 = 'default.css'
-
-# 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
-
-# Content template for the index page.
-#html_index = ''
-
-# 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 true, the reST sources are included in the HTML build as _sources/<name>.
-#html_copy_source = True
-
-# Output file base name for HTML help builder.
-htmlhelp_basename = 'Pastedoc'
-
-
-# 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 = []
-
-# 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

+ 0 - 394
desktop/core/ext-py/Paste-1.7.2/docs/default.css

@@ -1,394 +0,0 @@
-/*
-:Author: David Goodger, Ian Bicking
-:Contact: ianb@colorstudy.com
-:date: $Date: 2003/11/01 20:35:45 $
-:version: $Revision: 1.3 $
-:copyright: This stylesheet has been placed in the public domain.
-
-A modification of the default cascading style sheet (v.1.3) for the
-HTML output of Docutils.  
-*/
-
-body {
-  font-family: Arial, sans-serif;
-  background-color: #fff;
-}
-
-em, i {
-  /* Typically serif fonts have much nicer italics */
-  font-family: Times New Roman, Times, serif;
-}
-
-li {
-  list-style-type: circle;
-}
-
-a.target {
-  color: blue;
-}
-
-a.toc-backref {
-  text-decoration: none;
-  color: black;
-}
-
-a.toc-backref:hover {
-  background-color: inherit;
-}
-
-a:hover {
-  background-color: #ccc;
-}
-
-h1 a:hover, h2 a:hover, h3 a:hover, h4 a:hover, h5 a:hover, h6:hover { 
-  background-color: inherit;
-}
-
-cite {
-  font-style: normal;
-  font-family: monospace;
-  font-weight: bold;
-}
-
-dd {
-  margin-bottom: 0.5em;
-}
-
-div.abstract {
-  margin: 2em 5em;
-}
-
-div.abstract p.topic-title {
-  font-weight: bold;
-  text-align: center;
-}
-
-div.attention, div.caution, div.danger, div.error, div.hint,
-div.important, div.note, div.tip, div.warning {
-  background-color: #ccc;
-  width: 40%;
-  border: medium outset;
-  padding: 3px;
-  float: right
-}
-
-div.attention p.admonition-title, div.caution p.admonition-title,
-div.danger p.admonition-title, div.error p.admonition-title,
-div.warning p.admonition-title {
-  color: #c00;
-  font-weight: bold;
-  font-family: sans-serif;
-  text-align: center;
-  background-color: #999;
-  display: block;
-  margin: 0;
-}
-
-div.hint p.admonition-title, div.important p.admonition-title,
-div.note p.admonition-title, div.tip p.admonition-title {
-  font-weight: bold;
-  font-family: sans-serif;
-  text-align: center;
-  background-color: #999;
-  display: block;
-  margin: 0;
-}
-
-div.dedication {
-  margin: 2em 5em;
-  text-align: center;
-  font-style: italic;
-}
-
-div.dedication p.topic-title {
-  font-weight: bold;
-  font-style: normal;
-}
-
-div.figure {
-  margin-left: 2em;
-}
-
-div.footer, div.header {
-  font-size: smaller;
-}
-
-div.system-messages {
-  margin: 5em;
-}
-
-div.system-messages h1 {
-  color: red;
-}
-
-div.system-message {
-  border: medium outset;
-  padding: 1em;
-}
-
-div.system-message p.system-message-title {
-  color: red;
-  font-weight: bold;
-}
-
-div.topic {
-  margin: 2em;
-}
-
-h1, h2, h3, h4, h5, h6 {
-  font-family: Helvetica, Arial, sans-serif;
-  border: thin solid black;
-  /* This makes the borders rounded on Mozilla, which pleases me */
-  -moz-border-radius: 8px;
-  padding: 4px;
-}
-
-h1 {
-  background-color: #449;
-  color: #fff;
-  border: medium solid black;
-}
-
-h1 a.toc-backref, h2 a.toc-backref { 
-  color: #fff;
-}
-
-h2 {
-  background-color: #666;
-  color: #fff;
-  border: medium solid black;
-}
-
-h3, h4, h5, h6 {
-  background-color: #ccc;
-  color: #000;
-}
-
-h3 a.toc-backref, h4 a.toc-backref, h5 a.toc-backref, 
-h6 a.toc-backref { 
-  color: #000;
-}
-
-h1.title {
-  text-align: center;
-  background-color: #449;
-  color: #fff;
-  border: thick solid black;
-  -moz-border-radius: 20px;
-}
-
-h2.subtitle {
-  text-align: center;
-}
-
-hr {
-  width: 75%;
-}
-
-ol.simple, ul.simple {
-  margin-bottom: 1em;
-}
-
-ol.arabic {
-  list-style: decimal;
-}
-
-ol.loweralpha {
-  list-style: lower-alpha;
-}
-
-ol.upperalpha {
-  list-style: upper-alpha;
-}
-
-ol.lowerroman {
-  list-style: lower-roman;
-}
-
-ol.upperroman {
-  list-style: upper-roman;
-}
-
-p.caption {
-  font-style: italic;
-}
-
-p.credits {
-  font-style: italic;
-  font-size: smaller;
-}
-
-p.first {
-  margin-top: 0;
-}
-
-p.label {
-  white-space: nowrap;
-}
-
-p.topic-title {
-  font-weight: bold;
-}
-
-pre.address {
-  margin-bottom: 0;
-  margin-top: 0;
-  font-family: serif;
-  font-size: 100%;
-}
-
-pre.line-block {
-  font-family: serif;
-  font-size: 100%;
-}
-
-pre.literal-block, pre.doctest-block {
-  margin-left: 2em;
-  margin-right: 2em;
-  background-color: #eee;
-  border: thin black solid;
-  padding: 5px;
-}
-
-span.classifier {
-  font-family: sans-serif;
-  font-style: oblique;
-}
-
-span.classifier-delimiter {
-  font-family: sans-serif;
-  font-weight: bold;
-}
-
-span.interpreted {
-  font-family: sans-serif;
-}
-
-span.option-argument {
-  font-style: italic;
-}
-
-span.pre {
-  white-space: pre;
-}
-
-span.problematic {
-  color: red;
-}
-
-table {
-  margin-top: 0.5em;
-  margin-bottom: 0.5em;
-}
-
-table.citation {
-  border-left: solid thin gray;
-  padding-left: 0.5ex
-}
-
-table.docinfo {
-  margin: 2em 4em;
-}
-
-table.footnote {
-  border-left: solid thin black;
-  padding-left: 0.5ex;
-}
-
-td, th {
-  padding-left: 0.5em;
-  padding-right: 0.5em;
-  vertical-align: top;
-}
-
-td > p:first-child, th > p:first-child {
-  margin-top: 0em;
-}
-
-th.docinfo-name, th.field-name {
-  font-weight: bold;
-  text-align: left;
-  white-space: nowrap;
-}
-
-h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt {
-  font-size: 100%;
-}
-
-code, tt {
-  color: #006;
-}
-
-ul.auto-toc {
-  list-style-type: none;
-}
-
-/*****************************************
- * Doctest embedded examples
- *****************************************/
-
-span.doctest-url { 
-  background-color: #eee;
-  border-top: 2px outset #666;
-  border-left: 2px outset #666;
-  border-right: 2px outset #666;
-  padding: 0.25em;
-}
-
-div.doctest-example { 
-  border: outset 5px #666;
-  background-color: #eee;
-  font-family: default;
-  padding: 0.5em;
-}
-
-div.doctest-example h1 { 
-  background-color: inherit;
-  border: none;
-  color: inherit;
-  font-family: default;
-}
-
-div.doctest-example tt { 
-  color: inherit;
-}
-
-div.doctest-status { 
-  background-color: #060;
-  color: #fff;
-}
-
-span.doctest-header { 
-  background-color: #ccc;
-  font-family: monospace;
-}
-
-pre.doctest-errors { 
-  border: none;
-  background-color: #333;
-  color: #600;
-}
-
-div.source-code { 
-  background-color: #000;
-  border: inset #999 3px;
-  overflow: auto;
-}
-
-pre.source-code { 
-  background-color: #000;
-  border: inset #999 3px;
-  overflow: auto;
-  font-family: monospace;
-  color: #fff;
-}
-
-span.source-filename { 
-  background-color: #000;
-  border-top: 2px outset #999;
-  border-left: 2px outset #999;
-  border-right: 2px outset #999;
-  padding: 0.25em;
-  color: #fff
-}
-

+ 0 - 148
desktop/core/ext-py/Paste-1.7.2/docs/developer-features.txt

@@ -1,148 +0,0 @@
-Features
-========
-
-Testing
--------
-
-* A fixture for testing WSGI applications conveniently and in-process,
-  in :class:`paste.fixture.TestApp`
-
-* A fixture for testing command-line applications, also in
-  :class:`paste.fixture.TestFileEnvironment`
-
-* Check components for WSGI-compliance in :mod:`paste.lint`
-
-* Check filesystem changes, with :mod:`paste.debug.fsdiff`
-
-Server
-------
-
-* A threaded HTTP server in :mod:`paste.httpserver`
-
-* A tool for seeing and killing errant threads in the HTTP server, in
-  :mod:`paste.debug.watchthreads`
-
-Dispatching
------------
-
-* Chain and cascade WSGI applications (returning the first non-error
-  response) in :mod:`paste.cascade`
-
-* Dispatch to several WSGI applications based on URL prefixes, in
-  :mod:`paste.urlmap`
-
-* Allow applications to make subrequests and forward requests
-  internally, in :mod:`paste.recursive`
-
-* Redirect error pages (e.g., 404 Not Found) to custom error pages, in
-  :mod:`paste.errordocument`.
-
-Web Application
----------------
-
-* Easily deal with incoming requests and sending a response in
-  :mod:`paste.wsgiwrappers`
-
-* Work directly with the WSGI environment in :mod:`paste.request`
-
-* Run CGI programs as WSGI applications in :mod:`paste.cgiapp`
-
-* Traverse files and load WSGI applications from ``.py`` files (or
-  static files), in :mod:`paste.urlparser`
-
-* Serve static directories of files, also in :mod:`paste.urlparser`; also
-  serve using the Setuptools ``pkg_resources`` resource API.
-
-* Proxy to other servers, treating external HTTP servers as WSGI
-  applications, in :mod:`paste.proxy`.
-
-* Serve files (with support for ``If-Modified-Since``, etc) in
-  :mod:`paste.fileapp`
-
-Tools
------
-
-* Catch HTTP-related exceptions (e.g., ``HTTPNotFound``) and turn them
-  into proper responses in :mod:`paste.httpexceptions`
-
-* Manage HTTP header fields with :mod:`paste.httpheaders`
-
-* Handle authentication/identification of requests in :mod:`paste.auth`
-
-* Create sessions in :mod:`paste.session` and :mod:`paste.flup_session`
-
-* Gzip responses in :mod:`paste.gzipper`
-
-* A wide variety of routines for manipulating WSGI requests and
-  producing responses, in :mod:`paste.request`, :mod:`paste.response` and
-  :mod:`paste.wsgilib`.
-
-* Create Apache-style logs in :mod:`paste.translogger`
-
-* Handy request and response wrappers in :mod:`paste.wsgiwrappers`
-
-* Handling of request-local module globals sanely in :mod:`paste.registry`
-
-Authentication
---------------
-
-* Authentication using cookies in :mod:`paste.auth.cookie` and
-  :mod:`paste.auth.auth_tkt`; login form in :mod:`paste.auth.form`
-
-* Authentication using `OpenID <http://openid.net/>`_ in
-  :mod:`paste.auth.open_id`, using `CAS
-  <http://www.ja-sig.org/products/cas/>`_ in :mod:`paste.auth.cas`
-
-* HTTP authentication in :mod:`paste.auth.basic` and
-  :mod:`paste.auth.digest`
-
-* Dispatch to different authentication methods based on User-Agent, in
-  :mod:`paste.auth.multi`
-
-* Grant roles based on IP addresses, in :mod:`paste.auth.grantip`
-
-Debugging Filters
------------------
-
-* Catch (optionally email) errors with extended tracebacks (using
-  Zope/ZPT conventions) in :mod:`paste.exceptions`
-
-* During debugging, show tracebacks with information about each stack
-  frame, including an interactive prompt that runs in the individual
-  stack frames, in :mod:`paste.evalexception`.
-
-* Catch errors presenting a `cgitb
-  <http://python.org/doc/current/lib/module-cgitb.html>`_-based
-  output, in :mod:`paste.cgitb_catcher`.
-
-* Profile each request and append profiling information to the HTML,
-  in :mod:`paste.debug.profile`
-
-* Capture ``print`` output and present it in the browser for
-  debugging, in :mod:`paste.debug.prints`
-
-* Validate all HTML output from applications using the `WDG Validator
-  <http://www.htmlhelp.com/tools/validator/>`_, appending any errors
-  or warnings to the page, in :mod:`paste.debug.wdg_validator`
-
-Other Tools
------------
-
-* A file monitor to allow restarting the server when files have been
-  updated (for automatic restarting when editing code) in
-  :mod:`paste.reloader`
-
-* A class for generating and traversing URLs, and creating associated
-  HTML code, in :mod:`paste.url`
-
-* A small templating language (for internal use) in
-  :mod:`paste.util.template`
-
-* A class to help with loops in templates, in :mod:`paste.util.looper`
-
-* Import modules and objects given a string, in
-  :mod:`paste.util.import_string`
-
-* Ordered dictionary that can have multiple values with the same key,
-  in :mod:`paste.util.multidict`
-

+ 0 - 484
desktop/core/ext-py/Paste-1.7.2/docs/do-it-yourself-framework.txt

@@ -1,484 +0,0 @@
-A Do-It-Yourself Framework
-++++++++++++++++++++++++++
-
-:author: Ian Bicking <ianb@colorstudy.com>
-:revision: $Rev: 7315 $
-:date: $LastChangedDate: 2008-04-18 16:27:28 -0500 (Fri, 18 Apr 2008) $
-
-This tutorial has been translated `into Portuguese
-<http://montegasppa.blogspot.com/2007/06/um-framework-faa-voc-mesmo.html>`_.
-
-A newer version of this article is available `using WebOb
-<http://pythonpaste.org/webob/do-it-yourself.html>`_.
-
-.. contents::
-
-.. comments:
-
-   Explain SCRIPT_NAME/PATH_INFO better
-
-Introduction and Audience
-=========================
-
-This short tutorial is meant to teach you a little about WSGI, and as
-an example a bit about the architecture that Paste has enabled and
-encourages.
-
-This isn't an introduction to all the parts of Paste -- in fact, we'll
-only use a few, and explain each part.  This isn't to encourage
-everyone to go off and make their own framework (though honestly I
-wouldn't mind).  The goal is that when you have finished reading this
-you feel more comfortable with some of the frameworks built using this
-architecture, and a little more secure that you will understand the
-internals if you look under the hood.
-
-What is WSGI?
-=============
-
-At its simplest WSGI is an interface between web servers and web
-applications.  We'll explain the mechanics of WSGI below, but a higher
-level view is to say that WSGI lets code pass around web requests in a
-fairly formal way.  But there's more!  WSGI is more than just HTTP.
-It might seem like it is just *barely* more than HTTP, but that little
-bit is important:
-
-* You pass around a CGI-like environment, which means data like
-  ``REMOTE_USER`` (the logged-in username) can be securely passed
-  about.
-
-* A CGI-like environment can be passed around with more context --
-  specifically instead of just one path you two: ``SCRIPT_NAME`` (how
-  we got here) and ``PATH_INFO`` (what we have left).
-
-* You can -- and often should -- put your own extensions into the WSGI
-  environment.  This allows for callbacks, extra information,
-  arbitrary Python objects, or whatever you want.  These are things
-  you can't put in custom HTTP headers.
-
-This means that WSGI can be used not just between a web server an an
-application, but can be used at all levels for communication.  This
-allows web applications to become more like libraries -- well
-encapsulated and reusable, but still with rich reusable functionality.
-
-Writing a WSGI Application
-==========================
-
-The first part is about how to use `WSGI
-<http://www.python.org/peps/pep-0333.html>`_ at its most basic.  You
-can read the spec, but I'll do a very brief summary:
-
-* You will be writing a *WSGI application*.  That's an object that
-  responds to requests.  An application is just a callable object
-  (like a function) that takes two arguments: ``environ`` and
-  ``start_response``.
-
-* The environment looks a lot like a CGI environment, with keys like
-  ``REQUEST_METHOD``, ``HTTP_HOST``, etc.
-
-* The environment also has some special keys like ``wsgi.input`` (the
-  input stream, like the body of a POST request).
-
-* ``start_response`` is a function that starts the response -- you
-  give the status and headers here.
-
-* Lastly the application returns an iterator with the body response
-  (commonly this is just a list of strings, or just a list containing
-  one string that is the entire body.)
-
-So, here's a simple application::
-
-    def app(environ, start_response):
-        start_response('200 OK', [('content-type', 'text/html')])
-        return ['Hello world!']
-
-Well... that's unsatisfying.  Sure, you can imagine what it does, but
-you can't exactly point your web browser at it.
-
-There's other cleaner ways to do this, but this tutorial isn't about
-*clean* it's about *easy-to-understand*.  So just add this to the
-bottom of your file::
-
-    if __name__ == '__main__':
-        from paste import httpserver
-        httpserver.serve(app, host='127.0.0.1', port='8080')
-
-Now visit http://localhost:8080 and you should see your new app.
-If you want to understand how a WSGI server works, I'd recommend
-looking at the `CGI WSGI server
-<http://www.python.org/peps/pep-0333.html#the-server-gateway-side>`_
-in the WSGI spec.
-
-An Interactive App
-------------------
-
-That last app wasn't very interesting.  Let's at least make it
-interactive.  To do that we'll give a form, and then parse the form
-fields::
-
-    from paste.request import parse_formvars
-
-    def app(environ, start_response):
-        fields = parse_formvars(environ)
-        if environ['REQUEST_METHOD'] == 'POST':
-            start_response('200 OK', [('content-type', 'text/html')])
-            return ['Hello, ', fields['name'], '!']
-        else:
-            start_response('200 OK', [('content-type', 'text/html')])
-            return ['<form method="POST">Name: <input type="text" '
-                    'name="name"><input type="submit"></form>']
-
-The ``parse_formvars`` function just takes the WSGI environment and
-calls the `cgi <http://python.org/doc/current/lib/module-cgi.html>`_
-module (the ``FieldStorage`` class) and turns that into a MultiDict.
-
-Now For a Framework
-===================
-
-Now, this probably feels a bit crude.  After all, we're testing for
-things like REQUEST_METHOD to handle more than one thing, and it's
-unclear how you can have more than one page.
-
-We want to build a framework, which is just a kind of generic
-application.  In this tutorial we'll implement an *object publisher*,
-which is something you may have seen in Zope, Quixote, or CherryPy.
-
-Object Publishing
------------------
-
-In a typical Python object publisher you translate ``/`` to ``.``.  So
-``/articles/view?id=5`` turns into ``root.articles.view(id=5)``.  We
-have to start with some root object, of course, which we'll pass in...
-
-    class ObjectPublisher(object):
-
-        def __init__(self, root):
-            self.root = root
-
-        def __call__(self, environ, start_response):
-            ...
-
-    app = ObjectPublisher(my_root_object)
-
-We override ``__call__`` to make instances of ``ObjectPublisher``
-callable objects, just like a function, and just like WSGI
-applications.  Now all we have to do is translate that ``environ``
-into the thing we are publishing, then call that thing, then turn the
-response into what WSGI wants.
-
-The Path
---------
-
-WSGI puts the requested path into two variables: ``SCRIPT_NAME`` and
-``PATH_INFO``.  ``SCRIPT_NAME`` is everything that was used up
-*getting here*.  ``PATH_INFO`` is everything left over -- it's
-the part the framework should be using to find the object.  If you put
-the two back together, you get the full path used to get to where we
-are right now; this is very useful for generating correct URLs, and
-we'll make sure we preserve this.
-
-So here's how we might implement ``__call__``::
-
-    def __call__(self, environ, start_response):
-        fields = parse_formvars(environ)
-        obj = self.find_object(self.root, environ)
-        response_body = obj(**fields.mixed())
-        start_response('200 OK', [('content-type', 'text/html')])
-        return [response_body]
-
-    def find_object(self, obj, environ):
-        path_info = environ.get('PATH_INFO', '')
-        if not path_info or path_info == '/':
-            # We've arrived!
-            return obj
-        # PATH_INFO always starts with a /, so we'll get rid of it:
-        path_info = path_info.lstrip('/')
-        # Then split the path into the "next" chunk, and everything
-        # after it ("rest"):
-        parts = path_info.split('/', 1)
-        next = parts[0]
-        if len(parts) == 1:
-            rest = ''
-        else:
-            rest = '/' + parts[1]
-        # Hide private methods/attributes:
-        assert not next.startswith('_')
-        # Now we get the attribute; getattr(a, 'b') is equivalent
-        # to a.b...
-        next_obj = getattr(obj, next)
-        # Now fix up SCRIPT_NAME and PATH_INFO...
-        environ['SCRIPT_NAME'] += '/' + next
-        environ['PATH_INFO'] = rest
-        # and now parse the remaining part of the URL...
-        return self.find_object(next_obj, environ)
-
-And that's it, we've got a framework.
-
-Taking It For a Ride
---------------------
-
-Now, let's write a little application.  Put that ``ObjectPublisher``
-class into a module ``objectpub``::
-
-    from objectpub import ObjectPublisher
-
-    class Root(object):
-
-        # The "index" method:
-        def __call__(self):
-            return '''
-            <form action="welcome">
-            Name: <input type="text" name="name">
-            <input type="submit">
-            </form>
-            '''
-
-        def welcome(self, name):
-            return 'Hello %s!' % name
-
-    app = ObjectPublisher(Root())
-
-    if __name__ == '__main__':
-        from paste import httpserver
-        httpserver.serve(app, host='127.0.0.1', port='8080')
-
-Alright, done!  Oh, wait.  There's still some big missing features,
-like how do you set headers?  And instead of giving ``404 Not Found``
-responses in some places, you'll just get an attribute error.  We'll
-fix those up in a later installment...
-
-Give Me More!
--------------
-
-You'll notice some things are missing here.  Most specifically,
-there's no way to set the output headers, and the information on the
-request is a little slim.
-
-::
-
-    # This is just a dictionary-like object that has case-
-    # insensitive keys:
-    from paste.response import HeaderDict
-
-    class Request(object):
-        def __init__(self, environ):
-            self.environ = environ
-            self.fields = parse_formvars(environ)
-
-    class Response(object):
-        def __init__(self):
-            self.headers = HeaderDict(
-                {'content-type': 'text/html'})
-
-Now I'll each you a little trick.  We don't want to change the
-signature of the methods.  But we can't put the request and response
-objects in normal global variables, because we want to be
-thread-friendly, and all threads see the same global variables (even
-if they are processing different requests).
-
-But Python 2.4 introduced a concept of "thread-local values".  That's
-a value that just this one thread can see.  This is in the
-`threading.local <http://docs.python.org/lib/module-threading.html>`_
-object.  When you create an instance of ``local`` any attributes you
-set on that object can only be seen by the thread you set them in.  So
-we'll attach the request and response objects here.
-
-So, let's remind ourselves of what the ``__call__`` function looked
-like::
-
-    class ObjectPublisher(object):
-        ...
-
-        def __call__(self, environ, start_response):
-            fields = parse_formvars(environ)
-            obj = self.find_object(self.root, environ)
-            response_body = obj(**fields.mixed())
-            start_response('200 OK', [('content-type', 'text/html')])
-            return [response_body]
-
-Lets's update that::
-
-    import threading
-    webinfo = threading.local()
-
-        def __call__(self, environ, start_response):
-            webinfo.request = Request(environ)
-            webinfo.response = Response()
-            obj = self.find_object(self.root, environ)
-            response_body = obj(**dict(webinfo.request.fields))
-            start_response('200 OK', webinfo.response.headers.items())
-            return [response_body]
-
-Now in our method we might do::
-
-    class Root:
-        def rss(self):
-            webinfo.response.headers['content-type'] = 'text/xml'
-            ...
-
-If we were being fancier we would do things like handle `cookies
-<http://python.org/doc/current/lib/module-Cookie.html>`_ in these
-objects.  But we aren't going to do that now.  You have a framework,
-be happy!
-
-WSGI Middleware
-===============
-
-`Middleware
-<http://www.python.org/peps/pep-0333.html#middleware-components-that-play-both-sides>`_
-is where people get a little intimidated by WSGI and Paste.  
-
-What is middleware?  Middleware is software that serves as an
-intermediary.  
-
-
-So lets
-write one.  We'll write an authentication middleware, so that you can
-keep your greeting from being seen by just anyone.
-
-Let's use HTTP authentication, which also can mystify people a bit.
-HTTP authentication is fairly simple:
-
-* When authentication is requires, we give a ``401 Authentication
-  Required`` status with a ``WWW-Authenticate: Basic realm="This
-  Realm"`` header
-
-* The client then sends back a header ``Authorization: Basic
-  encoded_info``
-
-* The "encoded_info" is a base-64 encoded version of
-  ``username:password``
-
-So how does this work?  Well, we're writing "middleware", which means
-we'll typically pass the request on to another application.  We could
-change the request, or change the response, but in this case sometimes
-we *won't* pass the request on (like, when we need to give that 401
-response).
-
-To give an example of a really really simple middleware, here's one
-that capitalizes the response::
-
-    class Capitalizer(object):
-
-        # We generally pass in the application to be wrapped to
-        # the middleware constructor:
-        def __init__(self, wrap_app):
-            self.wrap_app = wrap_app
-
-        def __call__(self, environ, start_response):
-            # We call the application we are wrapping with the
-            # same arguments we get...
-            response_iter = self.wrap_app(environ, start_response)
-            # then change the response...
-            response_string = ''.join(response_iter)
-            return [response_string.upper()]
-
-Techically this isn't quite right, because there there's two ways to
-return the response body, but we're skimming bits.
-`paste.wsgilib.intercept_output
-<http://pythonpaste.org/module-paste.wsgilib.html#intercept_output>`_
-is a somewhat more thorough implementation of this.
-
-So here's some code that does something useful, authentication::
-
-    class AuthMiddleware(object):
-
-        def __init__(self, wrap_app):
-            self.wrap_app = wrap_app
-
-        def __call__(self, environ, start_response):
-            if not self.authorized(environ.get('HTTP_AUTHORIZATION')):
-                # Essentially self.auth_required is a WSGI application
-                # that only knows how to respond with 401...
-                return self.auth_required(environ, start_response)
-            # But if everything is okay, then pass everything through
-            # to the application we are wrapping...
-            return self.wrap_app(environ, start_response)
-
-        def authorized(self, auth_header):
-            if not auth_header:
-                # If they didn't give a header, they better login...
-                return False
-            # .split(None, 1) means split in two parts on whitespace:
-            auth_type, encoded_info = auth_header.split(None, 1)
-            assert auth_type.lower() == 'basic'
-            unencoded_info = encoded_info.decode('base64')
-            username, password = unencoded_info.split(':', 1)
-            return self.check_password(username, password)
-
-        def check_password(self, username, password):
-            # Not very high security authentication...
-            return username == password
-
-        def auth_required(self, environ, start_response):
-            start_response('401 Authentication Required',
-                [('Content-type', 'text/html'),
-                 ('WWW-Authenticate', 'Basic realm="this realm"')])
-            return ["""
-            <html>
-             <head><title>Authentication Required</title></head>
-             <body>
-              <h1>Authentication Required</h1>
-              If you can't get in, then stay out.
-             </body>
-            </html>"""]
-
-So, how do we use this?
-
-::
-
-    app = ObjectPublisher(Root())
-    wrapped_app = AuthMiddleware(app)
-
-    if __name__ == '__main__':
-        from paste import httpserver
-        httpserver.serve(wrapped_app, host='127.0.0.1', port='8080')
-
-Now you have middleware!  Hurrah!
-
-Give Me More Middleware!
-------------------------
-
-It's even easier to use other people's middleware than to make your
-own, because then you don't have to program.  If you've been following
-along, you've probably encountered a few exceptions, and have to look
-at the console to see the exception reports.  Let's make that a little
-easier, and show the exceptions in the browser...
-
-::
-
-    app = ObjectPublisher(Root())
-    wrapped_app = AuthMiddleware(app)
-    from paste.exceptions.errormiddleware import ErrorMiddleware
-    exc_wrapped_app = ErrorMiddleware(wrapped_app)
-
-Easy!  But let's make it *more* fancy...
-
-::
-
-    app = ObjectPublisher(Root())
-    wrapped_app = AuthMiddleware(app)
-    from paste.evalexception import EvalException
-    exc_wrapped_app = EvalException(wrapped_app)
-
-So go make an error now.  And hit the little +'s.  And type stuff in
-to the boxes.
-
-Configuration
-=============
-
-Now that you've created your framework and application (I'm sure it's
-much nicer than the one I've given so far) you might find the manually
-plugging together of some of these pieces a little crude.  Well, if
-*you* don't, anyone else who uses your app and wants to install it in
-a different location or configure it differently won't be as happy.
-
-So, we want to separate the application setup from the application
-configuration.  
-
-What's Next?
-============
-
-Stay tuned, I'll be talking about configuration (using `Paste Deploy
-<http://pythonpaste.org/deploy/>`_) later, and I hope to give a short
-introduction to packaging and plugins as well.  When that happens I'll
-note it on `my blog <http://blog.ianbicking.org>`_.

+ 0 - 36
desktop/core/ext-py/Paste-1.7.2/docs/download/index.txt

@@ -1,36 +0,0 @@
-Downloads
-=========
-
-Each of these packages is available in several formats.  The source
-distribution is a complete set of documentation, tests, and the source
-files themselves.  There are also two "Egg" files: these are files
-`easy_install <http://peak.telecommunity.com/DevCenter/EasyInstall>`_
-can install directly into your ``site-packages/`` directory, and are
-Python-version specific.  The download files for the latest version
-are always located on the Cheese Shop pages (listed below).
-
-* `Paste <http://cheeseshop.python.org/pypi/Paste>`_
-* `Paste Script <http://cheeseshop.python.org/pypi/PasteScript>`_
-* `Paste Deploy <http://cheeseshop.python.org/pypi/PasteDeploy>`_
-* `Paste WebKit <http://cheeseshop.python.org/pypi/PasteWebKit>`_
-* `Wareweb <http://cheeseshop.python.org/pypi/Wareweb>`_
-
-All the packages are available in the Subversion repository rooted at
-http://svn.pythonpaste.org/Paste/
-
-* http://svn.pythonpaste.org/Paste/trunk
-* http://svn.pythonpaste.org/Paste/Script/trunk
-* http://svn.pythonpaste.org/Paste/Deploy/trunk
-* http://svn.pythonpaste.org/Paste/WebKit/trunk
-* http://svn.pythonpaste.org/Paste/Wareweb/trunk
-* ... and others
-
-Use::
-
-    svn co http://svn.pythonpaste.org/Paste/trunk Paste
-
-to check out a working copy of Paste.  You can also use::
-
-    easy_install Paste==dev
-
-to install the trunk version of Paste (or the other packages).

+ 0 - 109
desktop/core/ext-py/Paste-1.7.2/docs/future.txt

@@ -1,109 +0,0 @@
-The Future Of Paste
-===================
-
-Introduction
-------------
-
-Paste has been under development for a while, and has lots of code in it.  Too much code!  The code is largely decoupled except for some core functions shared by many parts of the code.  Those core functions are largely replaced in `WebOb <>`_, and replaced with better implementations.
-
-The future of these pieces is to split them into independent packages, and refactor the internal Paste dependencies to rely instead on WebOb.
-
-Already Extracted
------------------
-
-paste.fixture:
-  WebTest
-  ScriptTest
-
-paste.lint:
-  wsgiref.validate
-
-paste.exceptions and paste.evalexception:
-  WebError
-
-paste.util.template:
-  Tempita
-
-
-To Be Separated
----------------
-
-paste.httpserver and paste.debug.watchthreads:
-  Not sure what to call this.
-
-paste.cascade and paste.errordocuments:
-  Not sure; Ben has an implementation of errordocuments in ``pylons.middleware.StatusCodeRedirect``
-
-paste.urlmap, paste.deploy.config.PrefixMiddleware:
-  In... some routing thing?  Together with the previous package?
-
-paste.proxy:
-  WSGIProxy (needs lots of cleanup though)
-
-paste.fileapp, paste.urlparser.StaticURLParser, paste.urlparser.PkgResourcesParser:
-  In some new file-serving package.
-
-paste.cgiapp, wphp.fcgi_app:
-  Some proxyish app... maybe WSGIProxy?
-
-paste.translogger, paste.debug.prints, paste.util.threadedprint, wsgifilter.proxyapp.DebugHeaders:
-  Some... other place.  Something loggy.
-
-paste.registry, paste.config:
-  Not sure.  Alberto Valverde expressed interest in splitting out paste.registry.
-
-paste.cgitb_catcher:
-  Move to WebError?  Not sure if it matters.  For some reason people use this, though.
-
-
-To Deprecate
-------------
-
-(In that, I won't extract these anywhere; I'm not going to do any big deletes anytime soon, though)
-
-paste.recursive
-  Better to do it manually (with webob.Request.get_response)
-
-paste.wsgiwrappers, paste.request, paste.response, paste.wsgilib, paste.httpheaders, paste.httpexceptions:
-  All the functionality is already in WebOb.
-
-paste.urlparser.URLParser:
-  Really this is tied to paste.webkit more than anything.
-
-paste.auth.*:
-  Well, these all need to be refactored, and replacements exist in AuthKit and repoze.who.  Some pieces might still have utility.
-
-paste.debug.profile:
-  I think repoze.profile supersedes this.
-
-paste.debug.wdg_validator:
-  It could get reimplemented with more options for validators, but I'm not really that interested at the moment.  The code is nothing fancy.
-
-paste.transaction:
-  More general in repoze.tm
-
-paste.url:
-  No one uses this
-
-
-Undecided
----------
-
-paste.debug.fsdiff:
-  Maybe ScriptTest?
-
-paste.session:
-  It's an okay naive session system.  But maybe Beaker makes it irrelevant (Beaker does seem slightly more complex to setup).  But then, this can just live here indefinitely.
-
-paste.gzipper:
-  I'm a little uncomfortable with this in concept.  It's largely in WebOb right now, but not as middleware.
-
-paste.reloader:
-  Maybe this should be moved to paste.script (i.e., paster serve)
-
-paste.debug.debugapp, paste.script.testapp:
-  Alongside other debugging tools, I guess
-
-paste.progress:
-  Not sure this works.
-

+ 0 - 5
desktop/core/ext-py/Paste-1.7.2/docs/include/contact.txt

@@ -1,5 +0,0 @@
-If you have questions about this document, please contact the `paste
-mailing list <http://pythonpaste.org/mailman/listinfo/paste-users>`_
-or try IRC (``#pythonpaste`` on freenode.net).  If there's something that
-confused you and you want to give feedback, please `submit an issue
-<http://pythonpaste.org/trac/newticket?component=documentation>`_.

+ 0 - 5
desktop/core/ext-py/Paste-1.7.2/docs/include/reference_header.txt

@@ -1,5 +0,0 @@
-Paste Reference Document
-@@@@@@@@@@@@@@@@@@@@@@@@
-
-.. contents::
-

+ 0 - 69
desktop/core/ext-py/Paste-1.7.2/docs/index.txt

@@ -1,69 +0,0 @@
-Python Paste
-============
-
-Contents:
-
-.. toctree::
-   :maxdepth: 1
-
-   news
-   future
-   testing-applications
-   url-parsing-with-wsgi
-   do-it-yourself-framework
-   paste-httpserver-threadpool
-   developer-features
-   DeveloperGuidelines
-   StyleGuide
-   paste-httpserver-threadpool
-   testing-applications
-   url-parsing-with-wsgi
-   community/index.txt
-   community/mailing-list.txt
-   community/repository.txt
-   download/index.txt
-   license
-
-Indices and tables
-==================
-
-* :ref:`genindex`
-* :ref:`modindex`
-* :ref:`search`
-
-.. comment:
-
-   I want to put these somewhere sometime, but no place for them now...
-   Python Paste -- 50% tastier than Elmer's!  
-   Paste: making the web sticky.  
-   Fix broken websites by applying Paste liberally.
-   Paste: paper over your inconsistencies. 
-   Paste: a soft mixture of malleable consistency.  
-   Paste: a tasty mixture to be spread on bread or crackers.  
-   Paste: glue that won't hurt you if you eat it.
-   Python Paste: the web extruded into the form of a snake.
-   Paste: the vinegar eel.
-   Paste: you bring the cut.
-   Paste: a doughy substance from which to make metaphorical web cupcakes.
-   LAMP?  LAMPP!
-   Putting the P in Wep 2.0!
-   Frankenweb crush tiny humans!
-   DSL? DSF!
-   Paste: Comfort for the framework-scarred
-
-Other Components
-================
-
-* `Paste Deploy <./deploy/>`_
-
-* `Paste Script <./script/>`_
-
-* `WebOb <./webob/>`_
-
-* `WSGI specification <http://www.python.org/peps/pep-0333.html>`_
-
-License
-=======
-
-Paste is distributed under the `MIT license
-<http://www.opensource.org/licenses/mit-license.php>`_.

+ 0 - 20
desktop/core/ext-py/Paste-1.7.2/docs/license.txt

@@ -1,20 +0,0 @@
-Copyright (c) 2006-2007 Ian Bicking and Contributors
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+ 0 - 14
desktop/core/ext-py/Paste-1.7.2/docs/modules/auth.auth_tkt.txt

@@ -1,14 +0,0 @@
-:mod:`paste.auth.auth_tkt` -- auth_tkt cookie parsing
-=====================================================
-
-.. automodule:: paste.auth.auth_tkt
-
-Module Contents
----------------
-
-.. autoclass:: AuthTKTMiddleware
-.. autofunction:: make_auth_tkt_middleware
-.. autoclass:: AuthTicket
-.. autoexception:: BadTicket
-
-

+ 0 - 11
desktop/core/ext-py/Paste-1.7.2/docs/modules/auth.basic.txt

@@ -1,11 +0,0 @@
-:mod:`paste.auth.basic` -- Basic HTTP authentication
-====================================================
-
-.. automodule:: paste.auth.basic
-
-Module Contents
----------------
-
-.. autoclass:: AuthBasicAuthenticator
-.. autoclass:: AuthBasicHandler
-.. autofunction:: make_basic

+ 0 - 11
desktop/core/ext-py/Paste-1.7.2/docs/modules/auth.cas.txt

@@ -1,11 +0,0 @@
-:mod:`paste.auth.cas` -- CAS authentication
-===========================================
-
-.. automodule:: paste.auth.cas
-
-Module Contents
----------------
-
-.. autoclass:: AuthCASHandler
-
-

+ 0 - 12
desktop/core/ext-py/Paste-1.7.2/docs/modules/auth.cookie.txt

@@ -1,12 +0,0 @@
-:mod:`paste.auth.cookie` -- Cookie-based authentication
-=======================================================
-
-.. automodule:: paste.auth.cookie
-
-Module Contents
----------------
-
-.. autoclass:: AuthCookieSigner
-.. autoclass:: AuthCookieHandler
-.. autoclass:: AuthCookieEnviron
-.. autofunction:: make_auth_cookie

+ 0 - 12
desktop/core/ext-py/Paste-1.7.2/docs/modules/auth.digest.txt

@@ -1,12 +0,0 @@
-:mod:`paste.auth.digest` -- HTTP Digest login
-=============================================
-
-.. automodule:: paste.auth.digest
-
-Module Contents
----------------
-
-.. autoclass:: AuthDigestAuthenticator
-.. autoclass:: AuthDigestHandler
-.. autofunction:: digest_password
-.. autofunction:: make_digest

+ 0 - 10
desktop/core/ext-py/Paste-1.7.2/docs/modules/auth.form.txt

@@ -1,10 +0,0 @@
-:mod:`paste.auth.form` -- HTML form/cookie authentication
-=========================================================
-
-.. automodule:: paste.auth.form
-
-Module Contents
----------------
-
-.. autoclass:: AuthFormHandler
-.. autofunction:: make_form

+ 0 - 10
desktop/core/ext-py/Paste-1.7.2/docs/modules/auth.grantip.txt

@@ -1,10 +0,0 @@
-:mod:`paste.auth.grantip` -- Set user and groups based on IP address
-====================================================================
-
-.. automodule:: paste.auth.grantip
-
-Module Contents
----------------
-
-.. autoclass:: GrantIPMiddleware
-.. autofunction:: make_grantip

+ 0 - 11
desktop/core/ext-py/Paste-1.7.2/docs/modules/auth.multi.txt

@@ -1,11 +0,0 @@
-:mod:`paste.auth.multi` -- Authentication via one of multiple methods
-=====================================================================
-
-.. automodule:: paste.auth.multi
-
-Module Contents
----------------
-
-.. autoclass:: MultiHandler
-
-

+ 0 - 12
desktop/core/ext-py/Paste-1.7.2/docs/modules/auth.open_id.txt

@@ -1,12 +0,0 @@
-:mod:`paste.auth.open_id` -- OpenID authentication
-==================================================
-
-.. automodule:: paste.auth.open_id
-
-Module Contents
----------------
-
-.. comment:
-
-   .. autoclass:: AuthOpenIDHandler
-   .. autofunction:: make_open_id_middleware

+ 0 - 10
desktop/core/ext-py/Paste-1.7.2/docs/modules/cascade.txt

@@ -1,10 +0,0 @@
-:mod:`paste.cascade` -- send requests to multiple applications until success
-============================================================================
-
-.. automodule:: paste.cascade
-
-Module Contents
----------------
-
-.. autoclass:: Cascade
-.. autofunction:: make_cascade

+ 0 - 11
desktop/core/ext-py/Paste-1.7.2/docs/modules/cgiapp.txt

@@ -1,11 +0,0 @@
-:mod:`paste.cgiapp` -- run CGI scripts as WSGI applications
-===========================================================
-
-.. automodule:: paste.cgiapp
-
-Module Contents
----------------
-
-.. autoclass:: CGIApplication
-.. autoexception:: CGIError
-.. autofunction:: make_cgi_application

+ 0 - 10
desktop/core/ext-py/Paste-1.7.2/docs/modules/cgitb_catcher.txt

@@ -1,10 +0,0 @@
-:mod:`paste.cgitb_catcher` -- catch exceptions using cgitb
-==========================================================
-
-.. automodule:: paste.cgitb_catcher
-
-Module Contents
----------------
-
-.. autoclass:: CgitbMiddleware
-.. autofunction:: make_cgitb_middleware

+ 0 - 13
desktop/core/ext-py/Paste-1.7.2/docs/modules/debug.debugapp.txt

@@ -1,13 +0,0 @@
-:mod:`paste.debug.debugapp` -- debug app
-========================================
-
-.. automodule:: paste.debug.debugapp
-
-Module Contents
----------------
-
-.. autoclass:: SimpleApplication
-.. autoclass:: SlowConsumer
-.. autofunction:: make_test_app
-.. autofunction:: make_slow_app
-

+ 0 - 15
desktop/core/ext-py/Paste-1.7.2/docs/modules/debug.fsdiff.txt

@@ -1,15 +0,0 @@
-:mod:`paste.debug.fsdiff` -- Show differences between directories
-=================================================================
-
-.. automodule:: paste.debug.fsdiff
-
-Module Contents
----------------
-
-.. autoclass:: Diff
-.. autoclass:: Snapshot
-.. autoclass:: File
-.. autoclass:: Dir
-.. autofunction:: report_expected_diffs
-.. autofunction:: show_diff
-

+ 0 - 10
desktop/core/ext-py/Paste-1.7.2/docs/modules/debug.prints.txt

@@ -1,10 +0,0 @@
-:mod:`paste.debug.prints` -- capture print output
-=================================================
-
-.. automodule:: paste.debug.prints
-
-Module Contents
----------------
-
-.. autoclass:: PrintDebugMiddleware
-

+ 0 - 13
desktop/core/ext-py/Paste-1.7.2/docs/modules/debug.profile.txt

@@ -1,13 +0,0 @@
-:mod:`paste.debug.profile` -- profile applications and requests
-===============================================================
-
-.. automodule:: paste.debug.profile
-
-Module Contents
----------------
-
-.. autoclass:: ProfileMiddleware
-.. autofunction:: make_profile_middleware
-.. autofunction:: profile_decorator
-
-

+ 0 - 12
desktop/core/ext-py/Paste-1.7.2/docs/modules/debug.watchthreads.txt

@@ -1,12 +0,0 @@
-:mod:`paste.debug.watchthreads` -- watch thread workers in paste.httpserver
-===========================================================================
-
-.. automodule:: paste.debug.watchthreads
-
-Module Contents
----------------
-
-.. autoclass:: WatchThreads
-.. autofunction:: make_watch_threads
-.. autofunction:: make_bad_app
-

+ 0 - 11
desktop/core/ext-py/Paste-1.7.2/docs/modules/debug.wdg_validate.txt

@@ -1,11 +0,0 @@
-:mod:`paste.debug.debugapp` -- debug app
-========================================
-
-.. automodule:: paste.debug.wdg_validate
-
-Module Contents
----------------
-
-.. autoclass:: WDGValidateMiddleware
-.. autofunction:: make_wdg_validate_middleware
-

+ 0 - 12
desktop/core/ext-py/Paste-1.7.2/docs/modules/errordocument.txt

@@ -1,12 +0,0 @@
-:mod:`paste.errordocument` -- Do internal redirects for error responses
-=======================================================================
-
-.. automodule:: paste.errordocument
-
-Module Contents
----------------
-
-.. autoclass:: StatusBasedForward
-.. autofunction:: make_errordocument
-
-

+ 0 - 9
desktop/core/ext-py/Paste-1.7.2/docs/modules/evalexception.txt

@@ -1,9 +0,0 @@
-:mod:`paste.evalexception` -- Interactive debugging for errors
-==============================================================
-
-.. automodule:: paste.evalexception
-
-Module Contents
----------------
-
-.. autoclass:: EvalException

+ 0 - 48
desktop/core/ext-py/Paste-1.7.2/docs/modules/exceptions.txt

@@ -1,48 +0,0 @@
-:mod:`paste.exceptions` -- Catch, display, and notify for exceptions
-====================================================================
-
-.. automodule:: paste.exceptions.errormiddleware
-
-Module Contents
----------------
-
-.. autoclass:: ErrorMiddleware
-.. autofunction:: handle_exception
-.. autofunction:: make_error_middleware
-
-:mod:`paste.exceptions.collector` -- Collection information from exceptions
-===========================================================================
-
-.. automodule:: paste.exceptions.collector
-
-Module Contents
----------------
-
-.. autoclass:: ExceptionCollector
-.. autofunction:: collect_exception
-
-:mod:`paste.exceptions.formatter` -- Format exception information
-=================================================================
-
-.. automodule:: paste.exceptions.formatter
-
-Module Contents
----------------
-
-.. autoclass:: TextFormatter
-.. autoclass:: HTMLFormatter
-.. autofunction:: format_html
-.. autofunction:: format_text
-
-:mod:`paste.exceptions.reporter` -- Report exceptions
-=====================================================
-
-.. automodule:: paste.exceptions.reporter
-
-Module Contents
----------------
-
-.. autoclass:: EmailReporter
-.. autoclass:: LogReporter
-.. autoclass:: FileReporter
-.. autoclass:: WSGIAppReporter

+ 0 - 15
desktop/core/ext-py/Paste-1.7.2/docs/modules/fileapp.txt

@@ -1,15 +0,0 @@
-:mod:`paste.fileapp` -- Serve files
-===================================
-
-.. automodule:: paste.fileapp
-
-Module Contents
----------------
-
-.. autoclass:: FileApp
-.. autoclass:: DirectoryApp
-.. autofunction:: DataApp
-.. autofunction:: ArchiveStore
-
-
-

+ 0 - 40
desktop/core/ext-py/Paste-1.7.2/docs/modules/fixture.txt

@@ -1,40 +0,0 @@
-:mod:`paste.fixture` -- Test applications
-=========================================
-
-.. contents::
-
-.. automodule:: paste.fixture
-
-Module Contents
----------------
-
-.. autoclass:: TestApp
-   :members:
-.. autoclass:: TestRequest
-
-Forms
------
-
-.. autoclass:: Form
-   :members:
-.. autoclass:: Field
-   :members:
-.. autoclass:: Select
-.. autoclass:: Radio
-.. autoclass:: Checkbox
-.. autoclass:: Text
-.. autoclass:: Textarea
-.. autoclass:: Hidden
-.. autoclass:: Submit
-
-Script Testing
---------------
-
-.. autoclass:: TestFileEnvironment
-   :members:
-.. autoclass:: ProcResult
-   :members:
-.. autoclass:: FoundFile
-.. autoclass:: FoundDir
-
-

+ 0 - 10
desktop/core/ext-py/Paste-1.7.2/docs/modules/gzipper.txt

@@ -1,10 +0,0 @@
-:mod:`paste.gzipper` -- Gzip-compress responses
-===============================================
-
-.. automodule:: paste.gzipper
-
-Module Contents
----------------
-
-.. autoclass:: middleware
-.. autofunction:: make_gzip_middleware

+ 0 - 49
desktop/core/ext-py/Paste-1.7.2/docs/modules/httpexceptions.txt

@@ -1,49 +0,0 @@
-:mod:`paste.httpexceptions` -- Easily product HTTP errors
-=========================================================
-
-.. automodule:: paste.httpexceptions
-
-Module Contents
----------------
-
-.. autoclass:: HTTPExceptionHandler
-.. autofunction:: make_middleware
-
-Exceptions
-----------
-
-.. autoexception:: HTTPException
-.. autoexception:: HTTPError
-.. autoexception:: HTTPRedirection
-.. autoexception:: HTTPMultipleChoices
-.. autoexception:: HTTPMovedPermanently
-.. autoexception:: HTTPFound
-.. autoexception:: HTTPNotModified
-.. autoexception:: HTTPUseProxy
-.. autoexception:: HTTPTemporaryRedirect
-.. autoexception:: HTTPClientError
-.. autoexception:: HTTPBadRequest
-.. autoexception:: HTTPUnauthorized
-.. autoexception:: HTTPPaymentRequired
-.. autoexception:: HTTPForbidden
-.. autoexception:: HTTPNotFound
-.. autoexception:: HTTPMethodNotAllowed
-.. autoexception:: HTTPNotAcceptable
-.. autoexception:: HTTPProxyAuthenticationRequired
-.. autoexception:: HTTPRequestTimeout
-.. autoexception:: HTTPConflict
-.. autoexception:: HTTPGone
-.. autoexception:: HTTPLengthRequired
-.. autoexception:: HTTPPreconditionFailed
-.. autoexception:: HTTPRequestEntityTooLarge
-.. autoexception:: HTTPRequestURITooLong
-.. autoexception:: HTTPUnsupportedMediaType
-.. autoexception:: HTTPRequestRangeNotSatisfiable
-.. autoexception:: HTTPExpectationFailed
-.. autoexception:: HTTPServerError
-.. autoexception:: HTTPInternalServerError
-.. autoexception:: HTTPNotImplemented
-.. autoexception:: HTTPBadGateway
-.. autoexception:: HTTPServiceUnavailable
-.. autoexception:: HTTPGatewayTimeout
-.. autoexception:: HTTPVersionNotSupported

+ 0 - 8
desktop/core/ext-py/Paste-1.7.2/docs/modules/httpheaders.txt

@@ -1,8 +0,0 @@
-:mod:`paste.httpheaders` -- Manipulate HTTP Headers
-===================================================
-
-.. comment:
-   I just don't feel like documenting the items...
-
-.. automodule:: paste.httpheaders
-   :members:

+ 0 - 10
desktop/core/ext-py/Paste-1.7.2/docs/modules/httpserver.txt

@@ -1,10 +0,0 @@
-:mod:`paste.httpserver` -- HTTP server
-======================================
-
-.. automodule:: paste.httpserver
-
-Module Contents
----------------
-
-.. autofunction:: serve
-.. autofunction:: server_runner

+ 0 - 10
desktop/core/ext-py/Paste-1.7.2/docs/modules/lint.txt

@@ -1,10 +0,0 @@
-:mod:`paste.lint` -- Check for the validity of WSGI requests and responses
-==========================================================================
-
-.. automodule:: paste.lint
-
-Module Contents
----------------
-
-.. autofunction:: middleware
-.. autoexception:: WSGIWarning

+ 0 - 10
desktop/core/ext-py/Paste-1.7.2/docs/modules/pony.txt

@@ -1,10 +0,0 @@
-:mod:`paste.pony` -- Add pony power to your application
-=======================================================
-
-.. automodule:: paste.pony
-
-Module Contents
----------------
-
-.. autoclass:: PonyMiddleware
-.. autofunction:: make_pony

+ 0 - 13
desktop/core/ext-py/Paste-1.7.2/docs/modules/progress.txt

@@ -1,13 +0,0 @@
-:mod:`paste.progress` -- Track progress of uploads
-==================================================
-
-.. automodule:: paste.progress
-
-Module Contents
----------------
-
-.. autoclass:: UploadProgressMonitor
-.. autoclass:: UploadProgressReporter
-
-
-

+ 0 - 14
desktop/core/ext-py/Paste-1.7.2/docs/modules/proxy.txt

@@ -1,14 +0,0 @@
-:mod:`paste.proxy` -- Proxy WSGI requests to HTTP requests
-==========================================================
-
-.. automodule:: paste.proxy
-
-Module Contents
----------------
-
-.. autoclass:: Proxy
-.. autofunction:: make_proxy
-.. autoclass:: TransparentProxy
-.. autofunction:: make_transparent_proxy
-
-

+ 0 - 10
desktop/core/ext-py/Paste-1.7.2/docs/modules/recursive.txt

@@ -1,10 +0,0 @@
-:mod:`paste.recursive` -- internal requests
-===========================================
-
-.. automodule:: paste.recursive
-
-Module Contents
----------------
-
-.. autoclass:: RecursiveMiddleware
-.. autofunction:: ForwardRequestException

+ 0 - 13
desktop/core/ext-py/Paste-1.7.2/docs/modules/registry.txt

@@ -1,13 +0,0 @@
-:mod:`paste.registry` -- Manage thread-local request-specific objects
-=====================================================================
-
-.. automodule:: paste.registry
-
-Module Contents
----------------
-
-.. autoclass:: StackedObjectProxy
-.. autoclass:: Registry
-.. autoclass:: RegistryManager
-.. autoclass:: StackedObjectRestorer
-.. autofunction:: make_registry_manager

+ 0 - 14
desktop/core/ext-py/Paste-1.7.2/docs/modules/reloader.txt

@@ -1,14 +0,0 @@
-:mod:`paste.reloader` -- Monitor for file changes to restart the process
-========================================================================
-
-.. automodule:: paste.reloader
-
-Module Contents
----------------
-
-.. autofunction:: install
-.. autoclass:: Monitor
-.. autofunction:: watch_file
-
-
-

+ 0 - 19
desktop/core/ext-py/Paste-1.7.2/docs/modules/request.txt

@@ -1,19 +0,0 @@
-:mod:`paste.request` -- Utility functions for the WSGI environment
-==================================================================
-
-.. automodule:: paste.request
-
-Module Contents
----------------
-
-.. autofunction:: get_cookies
-.. autofunction:: get_cookie_dict
-.. autofunction:: parse_querystring
-.. autofunction:: parse_formvars
-.. autofunction:: construct_url
-.. autofunction:: path_info_split
-.. autofunction:: path_info_pop
-.. autofunction:: resolve_relative_url
-.. autoclass:: EnvironHeaders
-
-

+ 0 - 15
desktop/core/ext-py/Paste-1.7.2/docs/modules/response.txt

@@ -1,15 +0,0 @@
-:mod:`paste.response` -- Utility functions for producing responses
-==================================================================
-
-.. automodule:: paste.response
-
-Module Contents
----------------
-
-.. autoclass:: HeaderDict
-.. autofunction:: has_header
-.. autofunction:: header_value
-.. autofunction:: remove_header
-.. autofunction:: replace_header
-
-

+ 0 - 11
desktop/core/ext-py/Paste-1.7.2/docs/modules/session.txt

@@ -1,11 +0,0 @@
-:mod:`paste.session` -- Simple file-based sessions
-==================================================
-
-.. automodule:: paste.session
-
-Module Contents
----------------
-
-.. autoclass:: SessionMiddleware
-.. autofunction:: make_session_middleware
-

+ 0 - 11
desktop/core/ext-py/Paste-1.7.2/docs/modules/transaction.txt

@@ -1,11 +0,0 @@
-:mod:`paste.transaction` -- DB-API transactions
-===============================================
-
-.. automodule:: paste.transaction
-
-Module Contents
----------------
-
-.. autoclass:: TransactionManagerMiddleware
-.. autoclass:: ConnectionFactory
-.. autofunction:: BasicTransactionHandler

+ 0 - 10
desktop/core/ext-py/Paste-1.7.2/docs/modules/translogger.txt

@@ -1,10 +0,0 @@
-:mod:`paste.translogger` -- Log requests
-========================================
-
-.. automodule:: paste.translogger
-
-Module Contents
----------------
-
-.. autoclass:: TransLogger
-.. autofunction:: make_filter

+ 0 - 10
desktop/core/ext-py/Paste-1.7.2/docs/modules/url.txt

@@ -1,10 +0,0 @@
-:mod:`paste.url` -- URL convenience class
-=========================================
-
-.. automodule:: paste.url
-
-Module Contents
----------------
-
-.. autoclass:: URL
-.. autoclass:: Image

+ 0 - 11
desktop/core/ext-py/Paste-1.7.2/docs/modules/urlmap.txt

@@ -1,11 +0,0 @@
-:mod:`paste.urlmap` -- Map URL paths
-====================================
-
-.. automodule:: paste.urlmap
-
-Module Contents
----------------
-
-.. autoclass:: URLMap
-.. autofunction:: urlmap_factory
-.. autoclass:: PathProxyURLMap

+ 0 - 14
desktop/core/ext-py/Paste-1.7.2/docs/modules/urlparser.txt

@@ -1,14 +0,0 @@
-:mod:`paste.urlparser` -- Handle URL paths and server static files
-==================================================================
-
-.. automodule:: paste.urlparser
-
-Module Contents
----------------
-
-.. autoclass:: StaticURLParser
-.. autofunction:: make_static
-.. autoclass:: PkgResourcesParser
-.. autofunction:: make_pkg_resources
-.. autoclass:: URLParser
-.. autofunction:: make_url_parser

+ 0 - 12
desktop/core/ext-py/Paste-1.7.2/docs/modules/util.import_string.txt

@@ -1,12 +0,0 @@
-:mod:`paste.util.import_string` -- Import objects from strings
-==============================================================
-
-.. automodule:: paste.util.import_string
-
-Module Contents
----------------
-
-.. autofunction:: eval_import
-.. autofunction:: simple_import
-.. autofunction:: import_module
-.. autofunction:: try_import_module

+ 0 - 11
desktop/core/ext-py/Paste-1.7.2/docs/modules/util.multidict.txt

@@ -1,11 +0,0 @@
-:mod:`paste.util.multidict` -- Dictionaries with multiple values
-================================================================
-
-.. automodule:: paste.util.multidict
-
-Module Contents
----------------
-
-.. autoclass:: MultiDict
-.. autoclass:: UnicodeMultiDict
-

+ 0 - 19
desktop/core/ext-py/Paste-1.7.2/docs/modules/wsgilib.txt

@@ -1,19 +0,0 @@
-:mod:`paste.wsgilib` -- Miscellaneous WSGI utility functions
-============================================================
-
-.. automodule:: paste.wsgilib
-
-Module Contents
----------------
-
-.. autofunction:: add_close
-.. autofunction:: add_start_close
-.. autofunction:: chained_app_iters
-.. autoclass:: encode_unicode_app_iter
-.. autofunction:: catch_errors
-.. autofunction:: catch_errors_app
-.. autofunction:: raw_interactive
-.. autofunction:: interactive
-.. autofunction:: dump_environ
-.. autofunction:: capture_stdout
-.. autofunction:: intercept_output

+ 0 - 10
desktop/core/ext-py/Paste-1.7.2/docs/modules/wsgiwrappers.txt

@@ -1,10 +0,0 @@
-:mod:`paste.wsgiwrappers` -- Wrapper functions for WSGI request and response
-============================================================================
-
-.. automodule:: paste.wsgiwrappers
-
-Module Contents
----------------
-
-.. autoclass:: WSGIRequest
-.. autoclass:: WSGIResponse

+ 0 - 917
desktop/core/ext-py/Paste-1.7.2/docs/news.txt

@@ -1,917 +0,0 @@
-News
-====
-
-.. contents::
-
-1.7.2
------
-
-* In :mod:`paste.proxy`, added some more headers that are disallowed
-  in WSGI (e.g., Keep-Alive).  Send Content-Length.  Also fix the
-  missing query string when using :class:`paste.proxy.Proxy`
-  (:class:`paste.proxy.TransparentProxy` already worked).
-
-* Make :mod:`paste.debug.prints` work with Google App Engine.
-
-* Make ``environ['wsgi.input']`` with :mod:`paste.httpserver` only
-  have a ``seek`` method if it is wrapping something with a seek
-  method (which usually it is not).
-
-* In :mod:`paste.httpserver` re-raise KeyboardInterrupt in worker
-  threads.
-
-* Added support for the ``HttpOnly`` Cookie property to
-  :mod:`paste.wsgiwrappers`
-
-* Added :func:`paste.reloader.add_file_callback`, which lets you watch
-  files based on a callback.
-
-* Quiet Python 2.6 deprecation warnings.
-
-* Fix :mod:`paste.auth.cookie` generating bad headers.
-
-* Added :class:`paste.reloader.JythonMonitor` for an experimental,
-  optimized reloader on Jython.
-
-1.7.1
------
-
-* Normalize and make absolute the paths passed to
-  :class:`paste.urlparser.StaticURLParser` (before passing a
-  relative-to-cwd path to that class would cause Forbidden errors).
-
-* Deprecate :func:`paste.fixture.setup_module`
-
-1.7
----
-
-* Fixed bug in :class:`paste.fixture.TestApp` that would submit forms
-  with unnamed fields (like an unnamed submit button).  Also made
-  checkboxes with no explicit ``value`` send ``on`` instead of
-  ``checked`` (which is what browsers do).
-
-* Fixed bug in :mod:`paste.httpserver` where
-  ``environ['wsgi.input'].readline(max_size)`` ignored the max_size
-  argument, which can lead to large memory usage (from Jakub Stolarski)
-
-* Make :mod:`paste.cascade` notice sockets that have stopped producing
-  data.  From Casey Zednick.
-
-* In :class:`paste.fixture.TestApp` Accept MultiDict values for the
-  ``params`` argument in requests.  (Anything with a ``.items()``
-  method will have its items encoded as the request parameters.)
-
-* Fix :mod:`paste.httpserver` to allow binding to port 0.
-
-* In :mod:`paste.auth.auth_tkt`, set the same cookies (with the same
-  domains) in ``set_cookie`` as get unset in ``logout_user_cookie``.
-
-* In :mod:`paste.translogger` save REQUEST_METHOD in case it gets
-  overridden somewhere (e.g., when using errordocuments POST would
-  show up as GET).
-
-* Exceptions with unicode messages don't cause the collector to fail.
-
-* Sometimes :class:`paste.exceptions.errormiddleware.ErrorMiddleware`
-  would not call start_response properly; this is fixed (from Andreas
-  Kloecker).
-
-* :mod:`paste.fixture.TestApp` can store multiple cookie values
-  (previously only one cookie was stored; from Andrey Lebedev)
-
-* ``u'' in TestApp(app).get('/')`` will work when the body isn't ASCII
-  (before it would give a unicode error).  This problem wasn't present
-  in the recommended `WebTest <http://pythonpaste.org/webtest/>`_.
-
-* :mod:`paste.debug.profile` won't break when content is served with no
-  Content-Type.
-
-* Accept relative paths and paths with ``/../`` in them for
-  :class:`paste.urlparser.StaticURLParser` (from Eric Larson).  Also fix
-  problem with case normalization on Windows (from Ionel Maries
-  Cristian).
-
-* :class:`paste.registry.StackedObjectProxy`'s now include the proxied object's names via
-  ``__dir__`` (for Python 2.6).
-
-* Use ``environ['wsgi.file_wrapper']`` when available (in
-  ``paste.fileapp``).
-
-* Make :mod:`paste.debug.prints` compatible with App Engine.
-
-* Fix the ``domain`` keyword in
-  :method:`paste.wsgiwrappers.WSGIResponse.delete_cookie`.
-
-1.6.1
------
-
-* Fixed bug in paste lint where PATH_INFO would become unicode.
-
-1.6
----
-
-* Make the import of ``socket.sslerror`` conditional in
-  ``paste.exceptions.reporter`` (needed for Python interpreters
-  compiled without SSL support).
-
-* In ``paste.proxy.TransparentProxy``, don't overwrite
-  ``X-Forwarded-For`` header if it is already in the environment.
-
-* Added ``226 IM Used`` status code to ``paste.wsgiwrappers``
-
-* In ``paste.fixture.TestApp`` treat ``<image type="image">`` the same
-  as a submit button.
-
-* Use ``OpenSSL.tsafe.Connection`` for https with
-  ``paste.httpserver``, avoiding some possible errors (``sslv3 alert
-  bad record mac``).
-
-* Fix small issue with ``paste.cgiapp`` and mod_wsgi.
-
-* Use ``BaseCookie`` instead of ``SimpleCookie`` for storing cookies
-  (avoids quoting cookie values).
-
-1.5.1
------
-
-* Make ``paste.cascade`` more tolerant of a missing or invalid
-  Content-Length.
-
-1.5
----
-
-* Fixed memory leak with ``paste.registry`` not properly removing
-  all references to registered objects should register be called
-  multiple times during a single context for a StackedObjectProxy.
-
-* ``paste.httpheaders.CONTENT_RANGE`` returns ``bytes
-  START-END/LENGTH`` instead of just ``START-END/LENGTH``
-
-* In ``paste.fixture.TestApp`` set ``CONTENT_TYPE`` to
-  ``'application/x-www-form-urlencoded'`` whenever there are
-  parameters (and no other content type was provided).
-
-* In ``paste.session``, when cleaning files ignore files that aren't
-  session files.
-
-* ``paste.httpexceptions.HTTPExceptionHandler`` will no longer catch
-  exceptions raised during the app_iter iteration.
-
-* ``paste.cascade.Cascade`` copies ``wsgi.input`` when cascading, so
-  that one of the applications cannot read the input and leave a later
-  application blocked when it tries to read the input.
-
-* Fix assigning to ``WSGIResponse.charset`` breaking the content-type.
-
-* SMTP authentication is supported for the exception handler.  You may
-  now set ``smtp_username``, ``smtp_password`` and ``smtp_use_tls`` to
-  control this behavior.  From pthy.
-
-1.4.2
------
-
-* Remove FreeBSD threadpool condition in paste.httpserver (which was
-  also breaking code for Windows users).
-
-* Fix problem with ``paste.wsgilib.intercept_output`` and passing up
-  exceptions.
-
-1.4.1
------
-
-* Allow customization of the ``paste.config.ConfigMiddleware`` environ
-  key.
-
-* Added a ``current`` method (an alias of ``current_conf``) to
-  ``paste.config.DispatchingConfig``.
-
-* Make test response ``.form`` attribute work when you have a single
-  named form.
-
-* Try to encode any unicode input to ``paste.auth.auth_tkt``
-
-* ``paste.wsgiwrappers.WSGIResponse`` now has a ``.content_type``
-  attribute (that does not include parameters), and a ``.charset``
-  attribute (that gets the charset parameter).
-
-* Inherit inherit show_exceptions_in_wsgi_errors from global
-  configuration.  Inherit ``debug`` more properly.
-
-1.4
----
-
-* In ``paste.httpserver`` added lots of functionality to the
-  threadpool.  See `the paste.httpserver threadpool documentation
-  <paste-httpserver-threadpool.html>`_ for details.  This catches
-  worker threads (and WSGI apps) that take too long to complete their
-  task; killing them eventually, adding more worker threads when the
-  pool is exhausted and it doesn't look good that it'll clear soon,
-  and optionally killing the process when there are too many
-  lost/zombie threads (you must be using some kind supervisor process
-  for this last response to make sense).
-
-* Save host and scheme information during real HTTP proxy requests to
-  ``paste.httpserver``, into the keys
-  ``paste.httpserver.proxy.scheme`` and
-  ``paste.httpserver.proxy.host``
-
-* In ``paste.exceptions`` always call ``start_response``; may help
-  problems when there is an exception in ``start_response`` itself.
-
-* Added method to ``paste.registry.StackedObjectProxy``,
-  ``_object_stack()``, which returns a list of all the registered
-  objects.  Useful if you want to search through the effective history
-  of a stacked object.
-
-* Fixed infinite recursion problem with
-  ``paste.request.EnvironHeaders.keys()``.
-
-* Fix ``paste.wsgiwrappers.WSGIRequest.urlvars`` to use
-  ``wsgiorg.routing_args``
-
-* Remove port from ``paste.request.construct_url`` if it's the default
-  port (e.g., port 80 for ``http``).
-
-* ``paste.proxy`` works with headers with continuations in the
-  response (i.e., a header that spans multiple lines).  Also, treat a
-  missing Content-Length as 0, not unlimited (may have previously
-  caused freeze ups for some kinds of requests).
-
-* ``StackedObjectProxy`` supports ``__call__`` (i.e., you can use
-  ``StackedObjectProxy`` with callable objects).
-
-* Fixed ``ProfileMiddleware`` not calling ``close()`` on consumed
-  app_iters.
-
-* ``httpheaders.AcceptLanguage`` now won't give an exception when
-  there is a malformed parameter in the header.
-
-* Fix ``paste.auth.form.auth_form`` Paste Deploy entry point.
-
-* Added REST methods to ``paste.fixture.TestApp``, so you can more
-  easily do requests like PUT and DELETE.  From Anders Pearson.
-
-* Added ``{{default var=default_value}}`` command to
-  ``paste.util.template``.  Make ``{{# comment}}`` work.
-
-1.3
----
-
-* In ``paste.httpserver`` remove the reverse DNS lookup to set
-  ``REMOTE_HOST``
-
-* In ``paste.fileapp``, if the client sends both If-None-Match and
-  If-Modified-Since, prefer If-None-Match.  Make ETags include the
-  size as well as last modified timestamp.  Make it possible to
-  override how mimetypes are guessed.
-
-* ``HTTPException`` objects now have a ``exc.response(environ)``
-  method that returns a ``WSGIResponse`` object.
-
-* ``egg:Paste#watch_threads`` will show tracebacks of each thread
-  under Python 2.5.
-
-* Made ``paste.util.template`` trim whitespace around statements that
-  are on their own line.
-
-* ``paste.fileapp.DataApp`` now accepts ``allowed_headers=[...]`` to
-  specify the allowed headers.  By default only ``GET`` and ``HEAD``
-  are allowed.
-
-* Added ``paste.util.import_string.try_import_module``, which imports
-  modules and catches ``ImportError``, but only if it's an error
-  importing the specific module, not an uncaught ``ImportError`` in
-  the module being imported. 
-
-1.2.1
------
-
-* ``paste.httpserver`` didn't implement the ``readline`` that the
-  ``cgi`` module wants (regression in 1.2).
-
-1.2
----
-
-* **Backward incompatible change**: ``paste.fileapp.FileApp`` properly
-  supports request methods, including HEAD.  If you were subclassing
-  ``FileApp`` or ``DataApp`` and overriding ``__call__()`` you may have
-  to subclass ``get()`` instead.
-
-* paste.httpheaders now parses the HTTP Accept-Language header and returns
-  a list of languages the browser supports in the order it prefers them.
-
-* paste.mimeparse module added that handles parsing HTTP Accept headers
-  for quality and mime-types.
-
-* ``paste.request.construct_url`` was adding ``SERVER_PORT`` to
-  ``HTTP_HOST``; but ``HTTP_HOST`` (from the Host header) generally
-  contains a port when necessary, and ``SERVER_PORT`` should only be
-  used with ``SERVER_NAME``.
-
-* Added entry point for ``paste.registry.RegistryManager``
-  (``egg:Paste#registry``).
-
-* ``paste.request.HeaderDict`` fixed to know that ``Content-Length``
-  maps to ``CONTENT_LENGTH``.
-
-* Can use ``paste.urlparser.StaticURLParser`` with sub-instances other
-  than ``paste.fileapp.FileApp`` (if you subclass and override
-  ``make_app``)
-
-* ``paste.fixture.TestApp.get(status=X)`` takes a list of allowed
-  status codes for ``X``.
-
-* Added a small templating system for internal use (``paste.util.template``)
-
-* Removed a bunch of long-deprecated modules (generally modules that
-  have been moved to other names).
-
-In paste.wsgiwrappers
-~~~~~~~~~~~~~~~~~~~~~
-
-* ``paste.wsgiwrappers.WSGIRequest`` has match_accept() function to screen
-  incoming HTPT Accept values against a list of mime-types.
-
-* ``paste.wsgiwrappers.WSGIRequest.defaults`` now accepts a new key:
-
-  ``language``: 
-    The i18n language that should be used as the fallback should
-    a translation not occur in a language file. See docs for
-    details.
-
-* ``paste.wsgiwrappers.WSGIRequest`` can now optionally decode form
-  parameters to unicode when it has a ``charset`` value set.
-
-* Deprecated the ``paste.wsgiwrappers.settings`` StackedObjectProxy
-  dictionary for ``paste.wsgiwrappers.WSGIResponse.defaults``.
-
-In paste.httpserver
-~~~~~~~~~~~~~~~~~~~
-
-* Regression in 1.1 fixed, where Paste's HTTP server would drop
-  trailing slashes from paths.
-
-* ``paste.httpserver`` now puts a key in the environment when using a
-  thread pool that allows you to track the thread pool and see any
-  wedged threads.  ``egg:Paste#watch_threads`` is an application that
-  can display this information.
-
-* ``paste.httpserver`` now accepts all request methods, not just
-  ``GET``, ``PUT``, etc.  (Methods like ``MKCOL`` were previously
-  rejected.)
-
-* ``paste.httpserver`` has a ``wsgi.input`` that now does not block if
-  you try to read past the end (it is limited to returning the number
-  of bytes given in ``Content-Length``).  Double-reading from
-  ``wsgi.input`` won't give you the same data, but it won't cause
-  blocking.
-
-1.1.1
------
-
-* Fixed major issue with serving static files on Windows (a regression
-  in Paste 1.1 where most static files would return 404 Not Found).
-
-* Fixed ``parse_dict_querystring`` returning empty dicts instead of
-  ``MultiDict``\ s.
-
-* Added ``paste.config``, a rewrite of ``paste.deploy.config`` using
-  ``paste.registry``. This version of ``ConfigMiddleware`` will
-  enable use of ``paste.config.CONFIG`` within the ``EvalException``
-  interactive debugger.
-
-* Fixed problem where ``paste.recursive`` would leave ``wsgi.input``
-  and ``CONTENT_LENGTH`` set for recursive requests.
-
-* Changed the static file servers to give 404 Not Found responses when
-  you have extra parts after a static file, instead of 400 Bad
-  Request (like when you request ``/file.html/extra/path``)
-
-1.1
----
-
-* Security fix for ``paste.urlparser.StaticURLParser``.  The problem
-  allowed escaping the root (and reading files) when used with
-  ``paste.httpserver`` (this does not effect other servers, and does
-  not apply when proxying requests from Apache to
-  ``paste.httpserver``).
-
-* ``paste.httpserver`` and ``paste.fixture.TestApp`` url-unquote
-  ``SCRIPT_NAME`` and ``PATH_INFO``, as specified in the CGI spec.
-  Thanks to Jon Nelson for pointing out both these issues.
-
-* ``paste.registry`` now works within the ``EvalException``
-  interactive debugger.
-
-* Fixed ``paste.auth.open_id`` failures not returning a correct
-  response.
-
-* Changed ``paste.httpexceptions.HTTPUnauthorized`` so that the
-  ``WWW-Authenticate`` header is not required.  401 responses don't
-  *have* to have that header.
-
-* In ``paste.fixture.TestApp``: ``<form>`` tags that have to
-  ``action`` will preserve the existing query string.  (Generally
-  relative links that are completely empty should but were not
-  preserving the query string)
-
-* Made ``paste.*`` compatible with `py2exe <http://www.py2exe.org/>`_
-  by adding a ``modulefinder`` call in ``__init__.py``
-
-* The ``paste.gzipper`` gzipping middleware wasn't changing the
-  Content-Length header properly; thanks to Brad Clements for the fix.
-
-* Fixed ``paste.proxy`` to not use anything based on the dict form of
-  ``httplib..HTTPMessage``.  This form folds headers together in a way
-  that breaks ``Set-Cookie`` headers (two ``Set-Cookie`` headers would
-  be merged into one).
-
-* ``paste.request.parse_formvars`` didn't accept parameters in
-  ``CONTENT_TYPE``.  ``prototype.js`` sets a ``charset`` parameter,
-  which caused a problem.
-
-* Added a ``__traceback_decorator__`` magic local variable, to allow
-  arbitrary manipulation of the output of
-  ``paste.exceptions.collector`` before formatting.
-
-* Added unicorn power to ``paste.pony`` (from Chad Whitacre)
-
-* For ``paste.httpserver`` SSL support: add support loading an
-  explicit certificate context, and using ``ssl_pem='*'`` create an
-  unsigned SSL certificate (from Jason Kirtland).
-
-* Fix some cases where ``paste.httpserver`` can have an orphaned
-  thread pool (causing the process to not shut down properly).  Patch
-  from jek.
-
-1.0
----
-
-* Fixed ``parsed_formvars`` potentially locking up on wsgi.input
-  after modification of ``QUERY_STRING``.
-
-* Fixed problem where ``paste.exceptions.errormiddleware`` didn't
-  expose the ``.close()`` method of the app_iter that it wraps (to
-  catch exceptions).  This is a problem if the server about the
-  errormiddleware aborts the request; it should then call
-  ``.close()``, but won't necessarily exhaust the iterator to do so.
-
-* Added entry point for ``paste.translogger``
-  (``egg:Paste#translogger``)
-
-* Fixed some cases where long data (e.g., a file upload) would show up
-  in the error report, creating a very very large report.  Also, put
-  in a monkeypatch for the ``cgi`` module so that
-  ``repr(uploaded_field)`` won't load the entire field into memory
-  (from its temporary file location).
-
-* Added a ``force_host`` option to ``paste.proxy.TransparentProxy``,
-  which will force all incoming requests to the same host, but leave
-  the ``Host`` header intact.
-
-* Added automatic cleanup of old sessions for ``paste.session``, from
-  Amir Salihefendic.
-
-* Quote the function name in tracebacks in the exception formatter;
-  Genshi has function names that use ``<>``.
-
-0.9.9
------
-
-* Fixed ``paste.response.HeaderDict`` ``get`` and ``setdefault``
-  methods to be case insensitive
-
-* Fix use of ``TestApp().post(params={'key': ['list of',
-  'values']})`` as reported by Syver Enstad.
-
-* ``paste.fileapp.DataApp`` is now directly usable (was previously
-  only usable as an abstract base class).
-
-0.9.8
------
-
-* Fixed ``wsgiwrappers.WSGIResponse.delete_cookie``. It also now takes
-  optional path and domain arguments
-
-* ``wsgiwrappers.WSGIResponse`` now handles generator/iterator content
-  more cleanly, and properly encodes unicode content according to its
-  specified charset
-
-* Fixed ``wsgiwrappers.WSGIResponse`` mishandling multiple headers of
-  the same name
-
-* Added a Paste Deploy entry point for ``paste.auth.cookie``
-
-* Moved Paste Deploy dependencies out of top-level modules and into
-  Paste-Deploy-specific entry point functions.  This should make Paste
-  more-or-less Paste Deploy independent.  ``paste.urlparser`` and
-  ``paste.exceptions.errormiddleware`` still have some leftover bits.
-
-* Added another redirector type to ``paste.recursive``,
-  ``environ['paste.recursive.include_app_iter']`` which gives access
-  to the original app_iter (useful for tranfsering unserialized data
-  in internal WSGI requests, as in `WSGIRemote
-  <http://svn.pythonpaste.org/Paste/WSGIRemote/trunk>`_
-
-* Bug with ``wsgilib.catch_errors`` and app_iters with no ``close()``
-  method.
-
-* Long words in tracebacks weren't being wrapped correctly at all.
-  Also, large data would cause the wrapping routine to give a
-  recursion error.  Now large data is truncated (at 1000 characters),
-  and recursion won't be a problem.  Also, wrapping shouldn't lose
-  characters.
-
-* Better exception if you try to put a non-str into environ when using
-  ``paste.auth.cookie``
-
-* ``paste.exceptions.collector`` produces an
-  ``exc_data.exception_type`` that is a class, not a string.  This
-  helps it get formatted better in Python 2.5.
-
-* All the tests pass on Python 2.5!
-
-* Added ``paste.proxy.TransparentProxy``, which just sends the request
-  described in the WSGI environ on without any modification.  More
-  useful for WSGI clients than servers, it effectively allows any
-  WSGI-based request mechanism to act like an httplib-based request
-  mechanism.
-
-* Added a ``cache_max_age`` argument to
-  ``paste.urlparser.StaticURLParser``, which allows you to encourage
-  the caching of static files.  Patch from Brad Clements.
-
-* Added ``suppress_http_headers`` to ``paste.proxy.Proxy``, which will
-  filter out HTTP headers from the request before passing it on.
-  Patch from Brad Clements.
-
-0.9.7
------
-
-* The ``EvalException`` 'full traceback' button is now only displayed
-  when the full traceback differs from the regular (includes hidden
-  frames).
-
-* Fixed ``EvalException`` returning a Content-type of 'text-html'
-  instead of 'text/html' in some cases.
-
-0.9.6
------
-
-* Renamed the ``paste.util.multidict.multidict`` class to
-  ``paste.util.multidict.MultiDict``
-
-0.9.5
------
-
-* Fixed a security vulnerability in ``paste.urlparser``'s StaticURLParser
-  and PkgResourcesParser where, with some servers, you could escape
-  the document root.
-
-* Significantly improved ``paste.httpserver``'s (egg:Paste#http)
-  performance. It now uses a thread pool: previously it created a new
-  thread for every request. To revert back to the old, slower behavior,
-  set::
-
-    use_threadpool = false
-
-  in the [server:main] section of the config file.
-
-* More control of where the output of ``paste.debug.prints`` goes.
-
-* Added a warning to ``paste.wsgilib.add_close`` if the upstream
-  app_iter consumer doesn't call the ``app_iter.close()`` method.
-
-* Fixed ``testapp.post(params={})``
-
-* Fixed ``paste.translogger.TransLogger`` to log to the Apache combined
-  log format as advertised.
-
-* Fixed ``paste.urlparser`` classes to handle quoted characters (e.g.
-  %20) in URL paths.
-
-* Changed ``paste.session`` to allow manipulating a session for the
-  first time after ``start_response`` is called.
-
-* Added ``paste.wsgilib.add_start_close`` which calls a function just
-  before returning the first chunk of the app_iter.
-
-* Changed ``paste.urlmap`` so that it matches domain-specific mappings
-  before domain-neutral mappings.
-
-* Fixed IE 6 potentially receiving the following ``"400 Bad Request"``
-  error on file downloads::
-
-    Please check your system clock.
-    According to this server, the time provided in the
-    If-Modified-Since header is in the future.
-
-* Added a 'no' keyword argument to ``TestResponse.mustcontain``, so
-  you can assert that a response does contain some strings at the same
-  time that you assert that a response *does not* contain other
-  strings, like::
-
-    res = app.get('/')
-    res.mustcontain('this must be there',
-                    no=['error', 'unexpected'])
-
-* Fixed ``fileapp.FileApp`` to pay attention to the ``If-None-Match``
-  header, which does ETag matching; before only ``If-Modified-Since``
-  was supported, even though an ``ETag`` header was being sent; in
-  particular Firefox would then only send ``If-None-Match`` and so
-  conditional requests never worked.
-
-* Changed usage of ``paste.request.MultiDict`` to
-  ``paste.util.multidict``, particularly in ``paste.wsgiwrappers``
-  where ``request.GET`` returns a new style of dictionary interface.
-
-* Be more careful in ``paste.request.parse_formvars`` not to let 
-  the ``cgi`` module read from ``wsgi.input`` when there are no
-  parsable variables in the input (based on ``CONTENT_TYPE``).
-
-0.9.4
------
-
-* This released was lost in a tragic clerical accident.
-
-0.9.3
------
-
-* 0.9.2 Included a version of MochiKit that was no longer compatible with
-  evalexception; 0.9.3 reverts to a previous version.
-
-* Change wsgi.run_once=False for ``paste.httpserver``
-
-* Added entry points for debug apps
-
-0.9.2
------
-
-* Fix in paste.urlmap when connecting with host:port.
-
-* Added ``/_debug/summary`` to evalexception, which gives a
-  JSON-formatted list of all the exceptions in memory.
-
-0.9.1
------
-
-* A fix for paste.errordocument, when doing an internal redirect from 
-  a POST request (the request is rewritten as a GET request)
-
-0.9
----
-
-* Added `paste.request.WSGIRequest
-  <class-paste.request.WSGIRequest.html>`_, a request object that
-  wraps the WSGI environment.
-
-* Added `paste.registry <module-paste.registry.html>`_, which is
-  middleware for registering threadlocal objects in a request.
-
-* Avoid annoying warning from paste.recursive
-
-* ``paste.httpserver`` now removes HTTPServer's transaction logging,
-  which was doing a reverse DNS lookup.
-
-* Added ``has_session`` to ``paste.session``
-
-* Allow for conditional ``paste.wsgilib.intercept_output`` which
-  should be slightly faster (and streamable) compared to doing the
-  condition manually.
-
-* Added entry point for `paste.proxy <module-paste.proxy.html>`_, plus
-  improvements from Brad Clements (support path in target, filter
-  request methods)
-
-* Added `paste.pony <module-paste.pony.html>`_ so pony power can be
-  added to any WSGI application.
-
-* Added port matching to ``paste.urlmap``.
-
-0.5
----
-
-* Added `paste.auth.auth_tkt <module-paste.auth.auth_tkt.html>`_
-
-* Added `paste.auth.grantip <module-paste.auth.grantip.html>`_
-
-0.4.1
------
-
-* Some bug fixes to the `built-in HTTP server
-  <module-paste.httpserver.html>`_.
-
-* Experimental `paste.progress <module-paste.progress.html>`_
-  middleware for tracking upload progress
-
-* Some tweaking of how `paste.reload <module-paste.reload.html>`_
-  works, especially with respect to shutdown.
-
-0.4
----
-
-* Fixed up paste documentation (especially for new packages/modules)
-
-* Added `paste.auth <module-paste.auth.html>`_ package for authentication
-  related WSGI middle-ware components:
-
-  - ``basic`` and ``digest`` HTTP authentication as described by RFC 2617
-
-  - support for Yale's Central Authentication System (``cas``)
-
-  - ``open_id`` supports single sign-on originally developed for
-    LiveJournal (see http://openid.net)
-
-  - ``cookie`` digitally signs cookies to record the current
-    authenticated user (``REMOTE_USER``), session identifier
-    (``REMOTE_SESSION``), and other WSGI entries in the ``environ``.
-
-  - a ``form`` module (to be used with ``cookie`` or an equivalent)
-    provides a simple HTML based form authentication.
-
-  - the ``multi`` module is an *experimental* mechanism for choosing
-    an authentication mechanism based on the WSGI ``environ``
-
-* Added `paste.httpserver <module-paste.httpserver.html>`_ module which
-  provides a very simple WSGI server built upon python's
-  ``BaseHTTPServer``; this server has support for several features:
-
-  - support for SSL connections via OpenSSL
-
-  - support for HTTP/1.1 ``100 Continue`` messages as required by the
-    WSGI specification (many HTTP server implementations don't do this)
-
-  - implemented as a Mix-In so that it can be used with other
-    more enchanted versions of ``BaseHTTPServer``
-
-  - support for 'Keep-Alive' (standard in HTTP/1.1) by either providing
-    a content-length or closing a connection if one is not available
-
-* Improved the `paste.httpexceptions <module-paste.httpexceptions.html>`_
-  module:
-
-  - added missing exception objects, and better descriptions
-
-  - fixed several bugs in how exceptions are caught and propagated
-
-  - usage as a ``wsgi_application()`` enables exceptions to be
-    returned without throwing or catching the error
-
-  - support for plain/text messages for text-only clients such as
-    curl, python's urllib, or Microsoft Excel
-
-  - allows customization of the HTML template for higher-level frameworks
-
-* Added `paste.httpheaders <module-paste.httpheaders.html>`_ module
-  to provide a uniform mechanism to access/update standard HTTP headers
-  in a WSGI ``environ`` and ``response_headers`` collection; it includes
-  specific support for:
-
-  - providing "common" header names and sorting them as suggested
-    by RFC 2616
-
-  - validated support for ``Cache-Control`` header construction
-
-  - validated support for ``Content-Disposition`` header construction
-
-  - parsing of ``If-Modified-Since`` and other date oriented headers
-
-  - parsing of Range header for partial-content delivery
-
-  - composition of HTTP/1.1 digest ``Authorization`` responses
-
-* Improved `paste.fileapp <module-paste.fileapp.html>`_ to support:
-
-  - static in-memory resources
-
-  - incremental downloading of files from disk
-
-  - responding to 'Range' requests to handle partial downloads
-
-  - allowing cache settings to be easily provided; including
-    support for HTTP/1.0 'Expires' and HTTP/1.1 'Cache-Control'
-
-* Added an *experimental* `paste.transaction
-  <module-paste.transaction.html>`_ module for handling
-  commit/rollback of standard DBAPI database connections
-
-* Added a `paste.util.datetimeutil <module-paste.util.datetimeutil.html>`_
-  module for parsing standard date/time user-generated text values
-
-* Added a `debug <module-paste.debug.html>`_ package, which includes:
-
-  - previous top-level modules ``prints``, ``profile``,
-    ``wdg_validate`` and ``doctest_webapp``
-
-  - a ``testserver`` module suitable to test HTTP socket
-    connections via ``py.test``
-
-* Re-factored `paste.wsgilib <module-paste.wsgilib.html>`_ into
-  several other modules:
-
-  - functions regarding header manipulation moved to
-    `paste.response <module-paste.response.html>`_
-
-  - functions regarding cookies and arguments moved to
-    `paste.request <module-paste.request.html>`_
-
-* Significant improvements to ``wsgiutils.wsgilib`` module:
-
-  - added a ``dump_environ`` application to help debugging
-
-  - fixes to ``raw_interactive`` to comply with WSGI specifications
-
-  - ``raw_interactive`` now logs all 5xx exceptions and sets HTTP_HOST
-
-* Added an argument ``no_profile`` to
-  `paste.debug.profile.profile_decorator
-  <module-paste.debug.profile.html#profile_decorator>`_; if that
-  option is false, then don't profile the function at all.
-
-* Changed `paste.lint <module-paste.lint.html>`_ to check that the
-  status contains a message (e.g., ``"404 Not Found"`` instead of just
-  ``"404"``).  Check that environmental variables
-  ``HTTP_CONTENT_TYPE`` and ``HTTP_CONTENT_LENGTH`` are no present.
-  Made unknown ``REQUEST_METHOD`` a warning (not an error).
-
-* Added parameter ``cwd`` to `TestFileEnvironment.run
-  <class-paste.fixture.TestFileEnvironment.html#run>`_
-
-* `paste.fixture.TestApp <class-paste.fixture.TestApp.html>`_:
-
-  - Form filling code (use ``response.forms[0]`` to get a `form object
-    <class-paste.fixture.Form.html>`_)
-
-  - Added `click method
-    <class-paste.fixture.TestResponse.html#click>`_.
-
-  - Better attribute errors.
-
-  - You can force set hidden fields using
-    ``form.fields[name].force_value(value)`` (normally setting the
-    value of a hidden field is an error).
-
-  - Frameworks can now add custom attributes to the response object.
-
-* ``paste.wsgilib.capture_output`` is deprecated in favor of
-  `paste.wsgilib.intercept_output
-  <module-paste.wsgilib.html#intercept_output>`_
-
-* Remove use of exceptions in `paste.cascade.Cascade
-  <class-paste.cascade.Cascade.html>`_, which causes weird effects in
-  some cases.  Generally we aren't using exceptions internally now,
-  only return status codes.  Also in cascade, be careful to keep
-  cascaded requests from sharing the same environment.
-
-* ``paste.wsgilib.error_response`` is deprecated
-  (`paste.httpexceptions <module-paste.httpexceptions.html>`_ replaces
-  this with exception's ``.wsgi_application`` method).
-
-* Moved ``paste.login`` to the attic, since `paste.auth
-  <module-paste.auth.html>`_ pretty much replaces it.
-
-* `paste.urlparser <module-paste.urlparser.html>`_ improvements:
-
-  - Added an application `urlparser.StaticURLParser
-    <class-paste.urlparser.StaticURLParser.html>`_ for serving static
-    files.
-
-  - Added an application `urlparser.PkgResourcesParser
-    <class-paste.urlparser.PkgResourcesParser.html>`_ for serving static
-    files found with ``pkg_resources`` (e.g., out of zipped Eggs).
-
-  - Be less picky about ambiguous filenames when using `URLParser
-    <class-paste.urlparser.URLParser.html>`_; if an exact file match
-    exists, use that.  (``file.gif.bak`` would cause a request for
-    ``file.gif`` to be ambiguous before)
-
-  - Now looks for a ``.wsgi_application`` attribute when serving
-    Python files/modules, as a general hook for returning a WSGI
-    application version of an object.
-
-* The `ErrorMiddleware
-  <class-paste.exceptions.errormiddleware.ErrorMiddleware.html>`_:
-
-  - Returns trimmed-down exceptions if there is a ``_`` GET variable
-    in the request (which is meant to signal an XMLHttpRequest).
-    Exceptions displayed in this context are best when they are smaller
-    and easier to display.
-
-  - Includes a text version of the traceback, for easier
-    copy-and-paste.
-
-  - Avoid printing exceptions to ``wsgi.errors`` if they are already
-    displayed elsewhere (at least by default).
-
-  - Highlight Python code.
-
-* Use ``pkg_resources.declare_namespace`` so that there are less
-  problems about confusing the ``paste`` package that is provided by
-  Paste, Paste Script, Paste Deploy, and Paste WebKit.  Before you
-  could get one of these at random if you didn't use
-  ``pkg_resources.require`` first.
-
-* Cleaned up use of ``exc_info`` argument in ``start_response`` calls
-  (both accepting and producing), in a variety of places.
-
-

+ 0 - 150
desktop/core/ext-py/Paste-1.7.2/docs/paste-httpserver-threadpool.txt

@@ -1,150 +0,0 @@
-The Paste HTTP Server Thread Pool
-=================================
-
-This document describes how the thread pool in ``paste.httpserver``
-works, and how it can adapt to problems.
-
-Note all of the configuration parameters listed here are prefixed with
-``threadpool_`` when running through a Paste Deploy configuration.
-
-Error Cases
------------
-
-When a WSGI application is called, it's possible that it will block
-indefinitely.  There's two basic ways you can manage threads:
-
-* Start a thread on every request, close it down when the thread stops
-
-* Start a pool of threads, and reuse those threads for subsequent
-  requests
-
-In both cases things go wrong -- if you start a thread every request
-you will have an explosion of threads, and with it memory and a loss
-of performance.  This can culminate in really high loads, swapping,
-and the whole site grinds to a halt.
-
-If you are using a pool of threads, all the threads can simply be used
-up.  New requests go into a queue to be processed, but since that
-queue never moves forward everyone will just block.  The site
-basically freezes, though memory usage doesn't generally get worse.
-
-Paste Thread Pool
------------------
-
-The thread pool in Paste has some options to walk the razor's edge
-between the two techniques, and to try to respond usefully in most
-cases.
-
-The pool tracks all workers threads.  Threads can be in a few states:
-
-* Idle, waiting for a request ("idle")
-
-* Working on a request
-
-  * For a reasonable amount of time ("busy")
-
-  * For an unreasonably long amount of time ("hung")
-
-* Thread that should die
-
-  * An exception has been injected that should kill the thread, but it
-    hasn't happened yet ("dying")
-
-  * An exception has been injected, but the thread has persisted for
-    an unreasonable amount of time ("zombie")
-
-When a request comes in, if there are no idle worker threads waiting
-then the server looks at the workers; all workers are busy or hung.
-If too many are hung, another thread is opened up.  The limit is if
-there are less than ``spawn_if_under`` busy threads.  So if you have
-10 workers, ``spawn_if_under`` is 5, and there are 6 hung threads and
-4 busy threads, another thread will be opened (bringing the number of
-busy threads back to 5).  Later those threads may be collected again
-if some of the threads become un-hung.  A thread is hung if it has
-been working for longer than ``hung_thread_limit`` (default 30
-seconds).
-
-Every so often, the server will check all the threads for error
-conditions.  This happens every ``hung_check_period`` requests
-(default 100).  At this time if there are more than enough threads
-(because of ``spawn_if_under``) some threads may be collected.  If any
-threads have been working for longer than ``kill_thread_limit``
-(default 1800 seconds, i.e., 30 minutes) then the thread will be
-killed.
-
-To kill a thread the ``ctypes`` module must be installed.  This will
-raise an exception (``SystemExit``) in the thread, which should cause
-the thread to stop.  It can take quite a while for this to actually
-take effect, sometimes on the order of several minutes.  This uses a
-non-public API (hence the ``ctypes`` requirement), and so it might not
-work in all cases.  I've tried it in pure Python code and with a hung
-socket, and in both cases it worked.  As soon as the thread is killed
-(before it is actually dead) another worker is added to the pool.
-
-If the killed thread lives longer than ``dying_thread_limit`` (default
-300 seconds, 5 minutes) then it is considered a zombie.
-
-Zombie threads are not handled specially unless you set
-``max_zombies_before_die``.  If you set this and there are more than
-this many zombie threads, then the entire process will be killed.
-This is useful if you are running the server under some process
-monitor, such as ``start-stop-daemon``, ``daemontools``, ``runit``, or
-with ``paster serve --monitor``.  To make the process die, it may run
-``os._exit``, which is considered an impolite way to exit a process
-(akin to ``kill -9``).  It *will* try to run the functions registered
-with ``atexit`` (except for the thread cleanup functions, which are
-the ones which will block so long as there are living threads).
-
-Notification
-------------
-
-If you set ``error_email`` (including setting it globally in a Paste
-Deploy ``[DEFAULT]`` section) then you will be notified of two error
-conditions: when hung threads are killed, and when the process is
-killed due to too many zombie threads.
-
-Missed Cases
-------------
-
-If you have a worker pool size of 10, and 11 slow or hung requests
-come in, the first 10 will get handed off but the server won't know
-yet that they will hang.  The last request will stay stuck in a queue
-until another request comes in.  When a later request comes later
-(after ``hung_thread_limit`` seconds) the server will notice the
-problem and add more threads, and the 11th request will come through.
-
-If a trickle of bad requests keeps coming in, the number of hung
-threads will keep increasing.  At 100 the ``hung_check_period`` may
-not clean them up fast enough.
-
-Killing threads is not something Python really supports.  Corruption
-of the process, memory leaks, or who knows what might occur.  For the
-most part the threads seem to be killed in a fairly simple manner --
-an exception is raised, and ``finally`` blocks do get executed.  But
-this hasn't been tried much in production, so there's not much
-experience with it.
-
-watch_threads
--------------
-
-If you want to see what's going on in your process, you can install
-the application ``egg:Paste#watch_threads`` (in the
-``paste.debug.watchthreads`` module).  This lets you see requests and
-how long they have been running.  In Python 2.5 you can see tracebacks
-of the running requests; before that you can only see request data
-(URLs, User-Agent, etc).  If you set ``allow_kill = true`` then you
-can also kill threads from the application.  The thread pool is
-intended to run reliably without intervention, but this can help debug
-problems or give you some feeling of what causes problems in the site.
-
-This does open up privacy problems, as it gives you access to all the
-request data in the site, including cookies, IP addresses, etc.  It
-shouldn't be left on in a public setting.
-
-socket_timeout
---------------
-
-The HTTP server (not the thread pool) also accepts an argument
-``socket_timeout``.  It is turned off by default.  You might find it
-helpful to turn it on.
-

+ 0 - 42
desktop/core/ext-py/Paste-1.7.2/docs/test_server.ini

@@ -1,42 +0,0 @@
-[DEFAULT]
-error_email = ianb@colorstudy.com
-
-[app:main]
-use = egg:PasteScript#test
-
-[server:main]
-use = egg:Paste#http
-host = 127.0.0.1:8081
-# These options make it easier to trigger the thread pool catches
-# (i.e., threads are hung fast, killed fast, spawn fast, and the
-# whole process dies quickly due to zombies)
-threadpool_workers = 3
-threadpool_hung_thread_limit = 10
-threadpool_kill_thread_limit = 20
-threadpool_spawn_if_under = 2
-threadpool_max_zombie_threads_before_die = 2
-threadpool_hung_check_period = 1
-threadpool_dying_limit = 10
-
-[server:cherrypy]
-use = egg:PasteScript#cherrypy
-host = 127.0.0.1:8080
-
-[filter-app:watch_threads]
-use = egg:Paste#error_catcher
-debug = true
-next = watch_threads_inner
-
-[app:watch_threads_inner]
-use = egg:Paste#urlmap
-/bad = bad_app
-/ = watch_app
-
-[app:watch_app]
-use = egg:Paste#watch_threads
-allow_kill = true
-
-[app:bad_app]
-paste.app_factory = paste.debug.watchthreads:make_bad_app
-
-

+ 0 - 156
desktop/core/ext-py/Paste-1.7.2/docs/testing-applications.txt

@@ -1,156 +0,0 @@
-Testing Applications with Paste
-+++++++++++++++++++++++++++++++
-
-:author: Ian Bicking <ianb@colorstudy.com>
-:revision: $Rev: 7409 $
-:date: $LastChangedDate: 2008-06-12 12:36:10 -0500 (Thu, 12 Jun 2008) $
-
-.. contents::
-
-Introduction
-============
-
-Paste includes functionality for testing your application in a
-convenient manner.  These facilities are quite young, and feedback is
-invited.  Feedback and discussion should take place on the
-`Paste-users list
-<http://pythonpaste.org/mailman/listinfo/paste-users>`_.
-
-These facilities let you test your Paste and WSGI-based applications
-easily and without a server. 
-
-.. include:: include/contact.txt
-
-The Tests Themselves
-====================
-
-The ``app`` object is a wrapper around your application, with many
-methods to make testing convenient.  Here's an example test script::
-
-    def test_myapp():
-        res = app.get('/view', params={'id': 10})
-        # We just got /view?id=10
-        res.mustcontain('Item 10')
-        res = app.post('/view', params={'id': 10, 'name': 'New item
-            name'})
-        # The app does POST-and-redirect...
-        res = res.follow()
-        assert res.request.url == '/view?id=10'
-        res.mustcontain('New item name')
-        res.mustcontain('Item updated')
-
-The methods of the ``app`` object (a ``paste.tests.fixture.TestApp``
-object):
-
-``get(url, params={}, headers={}, status=None)``:
-    Gets the URL.  URLs are based in the root of your application; no
-    domains are allowed.  Parameters can be given as a dictionary, or
-    included directly in the ``url``.  Headers can also be added.
-
-    This tests that the status is a ``200 OK`` or a redirect header,
-    unless you pass in a ``status``.  A status of ``"*"`` will never
-    fail; or you can assert a specific status (like ``500``).
-
-    Also, if any errors are written to the error stream this will
-    raise an error.
-
-``post(url, params={}, headers={}, status=None, upload_files=())``:
-    POSTS to the URL.  Like GET, except also allows for uploading
-    files.  The uploaded files are a list of ``(field_name, filename,
-    file_content)``.  
-
-    If you don't want to do a urlencoded post body, you can put a
-    ``content-type`` header in your header, and pass the body in as a
-    string with ``params``.
-
-The response object:
-
-``header(header_name, [default])``:
-    Returns the named header.  It's an error if there is more than one
-    matching header.  If you don't provide a default, it is an error
-    if there is no matching header.
-
-``all_headers(header_name):``
-    Returns a list of all matching headers.
-
-``follow(**kw)``:
-    Follows the redirect, returning the new response.  It is an error
-    if this response wasn't a redirect.  Any keyword arguments are
-    passed to ``app.get`` (e.g., ``status``).
-
-``x in res``:
-    Returns True if the string is found in the response.  Whitespace
-    is normalized for this test.
-
-``mustcontain(*strings)``:
-    Raises an error if any of the strings are not found in the
-    response.
-
-``showbrowser()``:
-    Opens the HTML response in a browser; useful for debugging.
-
-``str(res)``:
-    Gives a slightly-compacted version of the response.
-
-``click(description=None, linkid=None, href=None, anchor=None, index=None, verbose=False)``: 
-    Clicks the described link (`see docstring for more
-    <./class-paste.fixture.TestResponse.html#click>`_)
-
-``forms``:
-    Return a dictionary of forms; you can use both indexes (refer to
-    the forms in order) or the string ids of forms (if you've given
-    them ids) to identify the form.  See `Form Submissions <#form-submissions>`_ for
-    more on the form objects.
-
-Request objects:
-
-``url``:
-    The url requested.
-
-``environ``:
-    The environment used for the request.
-
-``full_url``:
-    The url with query string.
-
-Form Submissions
-================
-
-You can fill out and submit forms from your tests.  First you get the
-form::
-
-    res = testapp.get('/entry_form')
-    form = res.forms[0]
-
-Then you fill it in fields::
-
-    # when there's one unambiguous name field:
-    form['name'] = 'Bob'
-    # Enter something into the first field named 'age'
-    form.set('age', '45', index=1)
-
-Finally you submit::
-
-    # Submit with no particular submit button pressed:
-    form.submit()
-    # Or submit a button:
-    form.submit('submit_button_name')
-
-Framework Hooks
-===============
-
-Frameworks can detect that they are in a testing environment by the
-presence (and truth) of the WSGI environmental variable
-``"paste.testing"``.
-
-More generally, frameworks can detect that something (possibly a test
-fixture) is ready to catch unexpected errors by the presence and truth
-of ``"paste.throw_errors"`` (this is sometimes set outside of testing
-fixtures too, when an error-handling middleware is in place).
-
-Frameworks that want to expose the inner structure of the request may
-use ``"paste.testing_variables"``.  This will be a dictionary -- any
-values put into that dictionary will become attributes of the response
-object.  So if you do ``env["paste.testing_variables"]['template'] =
-template_name`` in your framework, then ``response.template`` will be
-``template_name``.

+ 0 - 304
desktop/core/ext-py/Paste-1.7.2/docs/url-parsing-with-wsgi.txt

@@ -1,304 +0,0 @@
-URL Parsing With WSGI And Paste
-+++++++++++++++++++++++++++++++
-
-:author: Ian Bicking <ianb@colorstudy.com>
-:revision: $Rev: 2685 $
-:date: $LastChangedDate: 2005-06-30 15:53:09 -0500 (Thu, 30 Jun 2005) $
-
-.. contents::
-
-Introduction and Audience
-=========================
-
-This document is intended for web framework authors and integrators,
-and people who want to understand the internal architecture of Paste.
-
-.. include:: include/contact.txt
-
-URL Parsing
-===========
-
-.. note::
-
-   Sometimes people use "URL", and sometimes "URI".  I think URLs are
-   a subset of URIs.  But in practice you'll almost never see URIs
-   that aren't URLs, and certainly not in Paste.  URIs that aren't
-   URLs are abstract Identifiers, that cannot necessarily be used to
-   Locate the resource.  This document is *all* about locating.
-
-Most generally, URL parsing is about taking a URL and determining what
-"resource" the URL refers to.  "Resource" is a rather vague term,
-intentionally.  It's really just a metaphor -- in reality there aren't
-any "resources" in HTTP; there are only requests and responses.
-
-In Paste, everything is about WSGI.  But that can seem too fancy.
-There are four core things involved: the *request* (personified in the
-WSGI environment), the *response* (personified inthe
-``start_response`` callback and the return iterator), the WSGI
-application, and the server that calls that application.  The
-application and request are objects, while the server and response are
-really more like actions than concrete objects.
-
-In this context, URL parsing is about mapping a URL to an
-*application* and a *request*.  The request actually gets modified as
-it moves through different parts of the system.  Two dictionary keys
-in particular relate to URLs -- ``SCRIPT_NAME`` and ``PATH_INFO`` --
-but any part of the environment can be modified as it is passed
-through the system.
-
-Dispatching
-===========
-
-.. note::
-
-   WSGI isn't object oriented?  Well, if you look at it, you'll notice
-   there's no objects except built-in types, so it shouldn't be a
-   surprise.  Additionally, the interface and promises of the objects
-   we do see are very minimal.  An application doesn't have any
-   interface except one method -- ``__call__`` -- and that method
-   *does* things, it doesn't give any other information.
-
-Because WSGI is action-oriented, rather than object-oriented, it's
-more important what we *do*.  "Finding" an application is probably an
-intermediate step, but "running" the application is our ultimate goal,
-and the only real judge of success.  An application that isn't run is
-useless to us, because it doesn't have any other useful methods.
-
-So what we're really doing is *dispatching* -- we're handing the
-request and responsibility for the response off to another object
-(another actor, really).  In the process we can actually retain some
-control -- we can capture and transform the response, and we can
-modify the request -- but that's not what the typical URL resolver will
-do.  
-
-Motivations
-===========
-
-The most obvious kind of URL parsing is finding a WSGI application.
-
-Typically when a framework first supports WSGI or is integrated into
-Paste, it is "monolithic" with respect to URLs.  That is, you define
-(in Paste, or maybe in Apache) a "root" URL, and everything under that
-goes into the framework.  What the framework does internally, Paste
-does not know -- it probably finds internal objects to dispatch to, 
-but the framework is opaque to Paste.  Not just to Paste, but to
-any code that isn't in that framework.
-
-That means that we can't mix code from multiple frameworks, or as
-easily share services, or use WSGI middleware that doesn't apply to
-the entire framework/application.
-
-An example of someplace we might want to use an "application" that
-isn't part of the framework would be uploading large files.  It's
-possible to keep track of upload progress, and report that back to the
-user, but no framework typically is capable of this.  This is usually
-because the POST request is completely read and parsed before it
-invokes any application code.
-
-This is resolvable in WSGI -- a WSGI application can provide its own
-code to read and parse the POST request, and simultaneously report
-progress (usually in a way that *another* WSGI application/request can
-read and report to the user on that progress).  This is an example
-where you want to allow "foreign" applications to be intermingled with
-framework application code.
-
-Finding Applications
-====================
-
-OK, enough theory.  How does a URL parser work?  Well, it is a WSGI
-application, and a WSGI server, in the typical "WSGI middleware"
-style.  Except that it determines which application it will serve
-for each request.
-
-Let's consider Paste's ``URLParser`` (in ``paste.urlparser``).  This
-class takes a directory name as its only required argument, and
-instances are WSGI applications.
-
-When a request comes in, the parser looks at ``PATH_INFO`` to see
-what's left to parse.  ``SCRIPT_NAME`` represents where we are *now*;
-it's the part of the URL that has been parsed.
-
-There's a couple special cases:
-
-The empty string:
-
-    URLParser serves directories.  When ``PATH_INFO`` is empty, that
-    means we got a request with no trailing ``/``, like say ``/blog``
-    If URLParser serves the ``blog`` directory, then this won't do --
-    the user is requesting the ``blog`` *page*.  We have to redirect
-    them to ``/blog/``.
-
-A single ``/``:
-
-    So, we got a trailing ``/``.  This means we need to serve the
-    "index" page.  In URLParser, this is some file named ``index``,
-    though that's really an implementation detail.  You could create
-    an index dynamically (like Apache's file listings), or whatever.
-
-Otherwise we get a string like ``/path...``.  Note that ``PATH_INFO``
-*must* start with a ``/``, or it must be empty.
-
-URLParser pulls off the first part of the path.  E.g., if
-``PATH_INFO`` is ``/blog/edit/285``, then the first part is ``blog``.
-It appends this to ``SCRIPT_NAME``, and strips it off ``PATH_INFO``
-(which becomes ``/edit/285``).
-
-It then searches for a file that matches "blog".  In URLParser, this
-means it looks for a filename which matches that name (ignoring the
-extension).  It then uses the type of that file (determined by
-extension) to create a WSGI application.
-
-One case is that the file is a directory.  In that case, the
-application is *another* URLParser instance, this time with the new
-directory.
-
-URLParser actually allows per-extension "plugins" -- these are just
-functions that get a filename, and produce a WSGI application.  One of
-these is ``make_py`` -- this function imports the module, and looks
-for special symbols; if it finds a symbol ``application``, it assumes
-this is a WSGI application that is ready to accept the request.  If it
-finds a symbol that matches the name of the module (e.g., ``edit``),
-then it assumes that is an application *factory*, meaning that when
-you call it with no arguments you get a WSGI application.
-
-Another function takes "unknown" files (files for which no better
-constructor exists) and creates an application that simply responds
-with the contents of that file (and the appropriate ``Content-Type``).
-
-In any case, ``URLParser`` delegates as soon as it can.  It doesn't
-parse the entire path -- it just finds the *next* application, which
-in turn may delegate to yet another application.
-
-Here's a very simple implementation of URLParser::
-
-    class URLParser(object):
-        def __init__(self, dir):
-            self.dir = dir
-        def __call__(self, environ, start_response):
-            segment = wsgilib.path_info_pop(environ)
-            if segment is None: # No trailing /
-                # do a redirect...
-            for filename in os.listdir(self.dir):
-                if os.path.splitext(filename)[0] == segment:
-                    return self.serve_application(
-                        environ, start_response, filename)
-            # do a 404 Not Found
-        def serve_application(self, environ, start_response, filename):
-            basename, ext = os.path.splitext(filename)
-            filename = os.path.join(self.dir, filename)
-            if os.path.isdir(filename):
-                return URLParser(filename)(environ, start_response)
-            elif ext == '.py':
-                module = import_module(filename)
-                if hasattr(module, 'application'):
-                    return module.application(environ, start_response)
-                elif hasattr(module, basename):
-                    return getattr(module, basename)(
-                        environ, start_response)
-            else:
-                return wsgilib.send_file(filename)
-
-Modifying The Request
-=====================
-
-Well, URLParser is one kind of parser.  But others are possible, and
-aren't too hard to write.
-
-Lets imagine a URL like ``/2004/05/01/edit``.  It's likely that
-``/2004/05/01`` doesn't point to anything on file, but is really more
-of a "variable" that gets passed to ``edit``.  So we can pull them off
-and put them somewhere.  This is a good place for a WSGI extension.
-Lets put them in ``environ["app.url_date"]``.
-
-We'll pass one other applications in -- once we get the date (if any)
-we need to pass the request onto an application that can actually
-handle it.  This "application" might be a URLParser or similar system
-(that figures out what ``/edit`` means).
-
-::
-
-    class GrabDate(object):
-        def __init__(self, subapp):
-            self.subapp = subapp
-        def __call__(self, environ, start_response):
-            date_parts = []
-            while len(date_parts) < 3:
-               first, rest = wsgilib.path_info_split(environ['PATH_INFO'])
-               try:
-                   date_parts.append(int(first))
-                   wsgilib.path_info_pop(environ)
-               except (ValueError, TypeError):
-	           break
-            environ['app.date_parts'] = date_parts
-            return self.subapp(environ, start_response)
-
-This is really like traditional "middleware", in that it sits between
-the server and just one application.
-
-Assuming you put this class in the ``myapp.grabdate`` module, you
-could install it by adding this to your configuration::
-
-    middleware.append('myapp.grabdate.GrabDate')
-
-Object Publishing
-=================
-
-Besides looking in the filesystem, "object publishing" is another
-popular way to do URL parsing.  This is pretty easy to implement as
-well -- it usually just means use ``getattr`` with the popped
-segments.  But we'll implement a rough approximation of `Quixote's
-<http://www.mems-exchange.org/software/quixote/>`_ URL parsing::
-
-    class ObjectApp(object):
-        def __init__(self, obj):
-            self.obj = obj
-        def __call__(self, environ, start_response):
-            next = wsgilib.path_info_pop(environ)
-            if next is None: 
-                # This is the object, lets serve it...
-                return self.publish(obj, environ, start_response)
-            next = next or '_q_index' # the default index method
-            if next in obj._q_export and getattr(obj, next, None):
-                return ObjectApp(getattr(obj, next))(
-                    environ, start_reponse)
-            next_obj = obj._q_traverse(next)
-            if not next_obj:
-                # Do a 404
-            return ObjectApp(next_obj)(environ, start_response)
-
-        def publish(self, obj, environ, start_response):
-            if callable(obj):
-                output = str(obj())
-            else:
-                output = str(obj)
-            start_response('200 OK', [('Content-type', 'text/html')])
-            return [output]
-
-The ``publish`` object is a little weak, and functions like
-``_q_traverse`` aren't passed interesting information about the
-request, but this is only a rough approximation of the framework.
-Things to note:
-
-* The object has standard attributes and methods -- ``_q_exports``
-  (attributes that are public to the web) and ``_q_traverse``
-  (a way of overriding the traversal without having an attribute for
-  each possible path segment).
-
-* The object isn't rendered until the path is completely consumed
-  (when ``next`` is ``None``).  This means ``_q_traverse`` has to
-  consume extra segments of the path.  In this version ``_q_traverse``
-  is only given the next piece of the path; Quixote gives it the
-  entire path (as a list of segments).  
-
-* ``publish`` is really a small and lame way to turn a Quixote object
-  into a WSGI application.  For any serious framework you'd want to do
-  a better job than what I do here.
-
-* It would be even better if you used something like `Adaptation
-  <http://www.python.org/peps/pep-0246.html>`_ to convert objects into
-  applications.  This would include removing the explicit creation of
-  new ``ObjectApp`` instances, which could also be a kind of fall-back
-  adaptation. 
-
-Anyway, this example is less complete, but maybe it will get you
-thinking.

+ 0 - 382
desktop/core/ext-py/Paste-1.7.2/docs/web/default-site.css

@@ -1,382 +0,0 @@
-/*
-:Author: David Goodger, Ian Bicking
-:Contact: ianb@colorstudy.com
-:date: $Date: 2003/11/01 20:35:45 $
-:version: $Revision: 1.3 $
-:copyright: This stylesheet has been placed in the public domain.
-
-A modification of the default cascading style sheet (v.1.3) for the
-HTML output of Docutils.  
-*/
-
-em, i {
-  /* Typically serif fonts have much nicer italics */
-  font-family: Times New Roman, Times, serif;
-}
-
-ul li {
-  list-style-type: circle;
-}
-
-a.toc-backref {
-  text-decoration: none;
-  color: black;
-}
-
-a.toc-backref:hover {
-  background-color: inherit;
-}
-
-h1 a:hover, h2 a:hover, h3 a:hover, h4 a:hover, h5 a:hover, h6:hover { 
-  background-color: inherit;
-}
-
-cite {
-  font-style: normal;
-  font-family: monospace;
-  font-weight: bold;
-}
-
-dd {
-  margin-bottom: 0.5em;
-}
-
-div.abstract {
-  margin: 2em 5em;
-}
-
-div.abstract p.topic-title {
-  font-weight: bold;
-  text-align: center;
-}
-
-div.attention, div.caution, div.danger, div.error, div.hint,
-div.important, div.note, div.tip, div.warning {
-  background-color: #ccc;
-  width: 40%;
-  border: medium outset;
-  padding: 3px;
-  float: right
-}
-
-div.attention p.admonition-title, div.caution p.admonition-title,
-div.danger p.admonition-title, div.error p.admonition-title,
-div.warning p.admonition-title {
-  color: #c00;
-  font-weight: bold;
-  font-family: sans-serif;
-  text-align: center;
-  background-color: #999;
-  display: block;
-  margin: 0;
-}
-
-div.hint p.admonition-title, div.important p.admonition-title,
-div.note p.admonition-title, div.tip p.admonition-title {
-  font-weight: bold;
-  font-family: sans-serif;
-  text-align: center;
-  background-color: #999;
-  display: block;
-  margin: 0;
-}
-
-div.dedication {
-  margin: 2em 5em;
-  text-align: center;
-  font-style: italic;
-}
-
-div.dedication p.topic-title {
-  font-weight: bold;
-  font-style: normal;
-}
-
-div.figure {
-  margin-left: 2em;
-}
-
-div.footer, div.header {
-  font-size: smaller;
-}
-
-div.system-messages {
-  margin: 5em;
-}
-
-div.system-messages h1 {
-  color: red;
-}
-
-div.system-message {
-  border: medium outset;
-  padding: 1em;
-}
-
-div.system-message p.system-message-title {
-  color: red;
-  font-weight: bold;
-}
-
-div.topic {
-  margin: 2em;
-}
-
-h3 a.toc-backref, h4 a.toc-backref, h5 a.toc-backref, 
-h6 a.toc-backref { 
-  color: #000;
-}
-
-h1.title {
-  text-align: center;
-}
-
-h2.subtitle {
-  text-align: center;
-}
-
-hr {
-  width: 75%;
-}
-
-ol.simple, ul.simple {
-  margin-bottom: 1em;
-}
-
-ul.contents li {
-  list-style: none;
-  margin: 0;
-  padding: 0;
-}
-
-ul.contents {
-  position: fixed;
-  top: 0px;
-  right: 0px;
-  background-color: #fd9;
-  border-left: 1px solid #f70;
-  border-bottom: 1px solid #f70;
-  width: 200px;
-  padding: 0;
-  margin: 0;
-}
-
-ul.contents a {
-  padding: 2px 1em 2px 1em;
-  display: block;
-  text-decoration: none;
-  color: #400;
-}
-
-ul.contents a:hover {
-  background-color: #f80;
-  color: #fff;
-}
-
-ul.contents li.header {
-  padding: 5px 1px 3px 0;
-  font-weight: bold;
-}
-
-ol.arabic {
-  list-style: decimal;
-}
-
-ol.loweralpha {
-  list-style: lower-alpha;
-}
-
-ol.upperalpha {
-  list-style: upper-alpha;
-}
-
-ol.lowerroman {
-  list-style: lower-roman;
-}
-
-ol.upperroman {
-  list-style: upper-roman;
-}
-
-p.caption {
-  font-style: italic;
-}
-
-p.credits {
-  font-style: italic;
-  font-size: smaller;
-}
-
-p.first {
-  margin-top: 0;
-}
-
-p.label {
-  white-space: nowrap;
-}
-
-p.topic-title {
-  font-weight: bold;
-}
-
-pre.address {
-  margin-bottom: 0;
-  margin-top: 0;
-  font-family: serif;
-  font-size: 100%;
-}
-
-pre.line-block {
-  font-family: serif;
-  font-size: 100%;
-}
-
-pre.literal-block, pre.doctest-block {
-  margin-left: 2em;
-  margin-right: 2em;
-  background-color: #eee;
-  border: thin black solid;
-  padding: 5px;
-}
-
-span.classifier {
-  font-family: sans-serif;
-  font-style: oblique;
-}
-
-span.classifier-delimiter {
-  font-family: sans-serif;
-  font-weight: bold;
-}
-
-span.interpreted {
-  font-family: sans-serif;
-}
-
-span.option-argument {
-  font-style: italic;
-}
-
-span.pre {
-  white-space: pre;
-}
-
-span.problematic {
-  color: red;
-}
-
-table {
-  margin-top: 0.5em;
-  margin-bottom: 0.5em;
-}
-
-table.citation {
-  border-left: solid thin gray;
-  padding-left: 0.5ex
-}
-
-table.docinfo {
-}
-
-table.footnote {
-  border-left: solid thin black;
-  padding-left: 0.5ex;
-}
-
-td, th {
-  padding-left: 0.5em;
-  padding-right: 0.5em;
-  vertical-align: top;
-}
-
-td > p:first-child, th > p:first-child {
-  margin-top: 0em;
-}
-
-th.docinfo-name, th.field-name {
-  font-weight: bold;
-  text-align: left;
-  white-space: nowrap;
-}
-
-h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt {
-  font-size: 100%;
-}
-
-code, tt {
-  color: #006;
-}
-
-ul.auto-toc {
-  list-style-type: none;
-}
-
-/*****************************************
- * Doctest embedded examples
- *****************************************/
-
-span.doctest-url { 
-  background-color: #eee;
-  border-top: 2px outset #666;
-  border-left: 2px outset #666;
-  border-right: 2px outset #666;
-  padding: 0.25em;
-}
-
-div.doctest-example { 
-  border: outset 5px #666;
-  background-color: #eee;
-  font-family: default;
-  padding: 0.5em;
-}
-
-div.doctest-example h1 { 
-  background-color: inherit;
-  border: none;
-  color: inherit;
-  font-family: default;
-}
-
-div.doctest-example tt { 
-  color: inherit;
-}
-
-div.doctest-status { 
-  background-color: #060;
-  color: #fff;
-}
-
-span.doctest-header { 
-  background-color: #ccc;
-  font-family: monospace;
-}
-
-pre.doctest-errors { 
-  border: none;
-  background-color: #333;
-  color: #600;
-}
-
-div.source-code { 
-  background-color: #000;
-  border: inset #999 3px;
-  overflow: auto;
-}
-
-pre.source-code { 
-  background-color: #000;
-  border: inset #999 3px;
-  overflow: auto;
-  font-family: monospace;
-  color: #fff;
-}
-
-span.source-filename { 
-  background-color: #000;
-  border-top: 2px outset #999;
-  border-left: 2px outset #999;
-  border-right: 2px outset #999;
-  padding: 0.25em;
-  color: #fff
-}
-

+ 0 - 69
desktop/core/ext-py/Paste-1.7.2/docs/web/site.js

@@ -1,69 +0,0 @@
-function setup_dropdowns() {
-  var els = document.getElementsByTagName('UL');
-  for (var i = 0; i < els.length; i++) {
-    var el = els[i];
-    if (el.className.search(/\bcontents\b/) > -1) {
-      enable_dropdown(el);
-    }
-  }
-}
-
-function enable_dropdown(el) {
-  var title = el.getElementsByTagName('LI')[0];
-  var plus_minus = document.createTextNode('  [-]');
-  if (title.childNodes[0].tagName != 'A') {
-    anchor = document.createElement('A');
-    while (title.childNodes.length) {
-      anchor.appendChild(title.childNodes[0]);
-    }
-    anchor.setAttribute('href', '#');
-    anchor.style.padding = '1px';
-    title.appendChild(anchor);
-  } else {
-    anchor = title.childNodes[0];
-  }
-  anchor.appendChild(plus_minus);
-  function show_hide() {
-    if (el.sub_hidden) {
-      set_sub_li(el, '');
-      anchor.removeChild(plus_minus);
-      plus_minus = document.createTextNode('  [-]');
-      anchor.appendChild(plus_minus);
-    } else {
-      set_sub_li(el, 'none');
-      anchor.removeChild(plus_minus);
-      plus_minus = document.createTextNode('  [+]');
-      anchor.appendChild(plus_minus);
-    }
-    el.sub_hidden = ! el.sub_hidden;
-    return false;
-  }
-  anchor.onclick = show_hide;
-  show_hide();
-}
-
-function set_sub_li(list, display) {
-  var sub = list.getElementsByTagName('LI');
-  for (var i = 1; i < sub.length; i++) {
-    sub[i].style.display = display;
-  }
-}
-
-function add_onload(func) {
-  if (window.onload) {
-    var old_onload = window.onload;
-    function new_onload() {
-      old_onload();
-      func();
-    }
-    window.onload = new_onload;
-  } else {
-    window.onload = func;
-  }
-}
-
-add_onload(setup_dropdowns);
-
-      
-
-

+ 0 - 90
desktop/core/ext-py/Paste-1.7.2/docs/web/style.css

@@ -1,90 +0,0 @@
-body {
-  font-family: Helvetica,Arial,sans-serif;
-  margin: 0;
-  background-color: #fff;
-  color: #000;
-}
-
-i, em {
-  font-family: Times New Roman,Times,serif;
-}
-
-a:link { 
-  color: #730;
-}
-
-a:visited { 
-  color: #402;
-}
-
-a:hover {
-  background-color: #fd8;
-}
-
-div#header {
-  display: block;
-  background-color: #930;
-  color: #fd6;
-  border-bottom: 3px solid #f70;
-  padding: 3px;
-  font-size: 30px;
-}
-
-div#header h1 { 
-  padding: 0;
-  margin: 0;
-  font-size: 1.5em;
-}
-
-div#nav {
-  float: left;
-  background-color: #fd9;
-  border: 1px solid #f70;
-  margin-right: 1em;
-  border-bottom: 1px solid #f70;
-  width: 200px;
-}
-
-div#nav ul {
-  padding: 0;
-  margin: 0;
-}
-
-div#nav li {
-  list-style: none;
-  margin: 0;
-}
-
-div#nav ul li ul li a { 
-  padding: 2px 2em 2px 2em;
-  font-weight: normal;
-}
-
-div#nav a {
-  display: block;
-  padding: 2px 1em 2px 1em;
-  text-decoration: none;
-  color: #400;
-  font-weight: bold;
-}
-
-div#nav a:hover {
-  background-color: #f80;
-  color: #fff;
-}
-
-/* If I ever do menus that show the "current" page, that would be
-   by marking some "links" as selected */
-div#nav span.selected {
-  display: block;
-  font-weight: bold;
-  padding: 2px 1em 2px 1em;
-}
-
-div#body {
-  padding: 1em;
-}
-
-h1.page-title {
-  margin-top: 0;
-}

+ 0 - 17
desktop/core/ext-py/Paste-1.7.2/paste/__init__.py

@@ -1,17 +0,0 @@
-# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
-# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
-try:
-    import pkg_resources
-    pkg_resources.declare_namespace(__name__)
-except ImportError:
-    # don't prevent use of paste if pkg_resources isn't installed
-    from pkgutil import extend_path
-    __path__ = extend_path(__path__, __name__) 
-
-try:
-    import modulefinder
-except ImportError:
-    pass
-else:
-    for p in __path__:
-        modulefinder.AddPackagePath(__name__, p)

+ 0 - 9
desktop/core/ext-py/Paste-1.7.2/paste/auth/__init__.py

@@ -1,9 +0,0 @@
-# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
-# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
-"""
-Package for authentication/identification of requests.
-
-The objective of this package is to provide single-focused middleware
-components that implement a particular specification.  Integration of
-the components into a usable system is up to a higher-level framework.
-"""

+ 0 - 352
desktop/core/ext-py/Paste-1.7.2/paste/auth/auth_tkt.py

@@ -1,352 +0,0 @@
-# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
-# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
-##########################################################################
-#
-# Copyright (c) 2005 Imaginary Landscape LLC and Contributors.
-#
-# Permission is hereby granted, free of charge, to any person obtaining
-# a copy of this software and associated documentation files (the
-# "Software"), to deal in the Software without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish,
-# distribute, sublicense, and/or sell copies of the Software, and to
-# permit persons to whom the Software is furnished to do so, subject to
-# the following conditions:
-#
-# The above copyright notice and this permission notice shall be
-# included in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-##########################################################################
-"""
-Implementation of cookie signing as done in `mod_auth_tkt
-<http://www.openfusion.com.au/labs/mod_auth_tkt/>`_.
-
-mod_auth_tkt is an Apache module that looks for these signed cookies
-and sets ``REMOTE_USER``, ``REMOTE_USER_TOKENS`` (a comma-separated
-list of groups) and ``REMOTE_USER_DATA`` (arbitrary string data).
-
-This module is an alternative to the ``paste.auth.cookie`` module;
-it's primary benefit is compatibility with mod_auth_tkt, which in turn
-makes it possible to use the same authentication process with
-non-Python code run under Apache.
-"""
-
-import time as time_mod
-try:
-    from hashlib import md5
-except ImportError:
-    from md5 import md5
-import Cookie
-from paste import request
-
-class AuthTicket(object):
-
-    """
-    This class represents an authentication token.  You must pass in
-    the shared secret, the userid, and the IP address.  Optionally you
-    can include tokens (a list of strings, representing role names),
-    'user_data', which is arbitrary data available for your own use in
-    later scripts.  Lastly, you can override the cookie name and
-    timestamp.
-
-    Once you provide all the arguments, use .cookie_value() to
-    generate the appropriate authentication ticket.  .cookie()
-    generates a Cookie object, the str() of which is the complete
-    cookie header to be sent.
-
-    CGI usage::
-
-        token = auth_tkt.AuthTick('sharedsecret', 'username',
-            os.environ['REMOTE_ADDR'], tokens=['admin'])
-        print 'Status: 200 OK'
-        print 'Content-type: text/html'
-        print token.cookie()
-        print
-        ... redirect HTML ...
-
-    Webware usage::
-
-        token = auth_tkt.AuthTick('sharedsecret', 'username',
-            self.request().environ()['REMOTE_ADDR'], tokens=['admin'])
-        self.response().setCookie('auth_tkt', token.cookie_value())
-
-    Be careful not to do an HTTP redirect after login; use meta
-    refresh or Javascript -- some browsers have bugs where cookies
-    aren't saved when set on a redirect.
-    """
-
-    def __init__(self, secret, userid, ip, tokens=(), user_data='',
-                 time=None, cookie_name='auth_tkt',
-                 secure=False):
-        self.secret = secret
-        self.userid = userid
-        self.ip = ip
-        self.tokens = ','.join(tokens)
-        self.user_data = user_data
-        if time is None:
-            self.time = time_mod.time()
-        else:
-            self.time = time
-        self.cookie_name = cookie_name
-        self.secure = secure
-
-    def digest(self):
-        return calculate_digest(
-            self.ip, self.time, self.secret, self.userid, self.tokens,
-            self.user_data)
-
-    def cookie_value(self):
-        v = '%s%08x%s!' % (self.digest(), int(self.time), self.userid)
-        if self.tokens:
-            v += self.tokens + '!'
-        v += self.user_data
-        return v
-
-    def cookie(self):
-        c = Cookie.SimpleCookie()
-        c[self.cookie_name] = self.cookie_value().encode('base64').strip().replace('\n', '')
-        c[self.cookie_name]['path'] = '/'
-        if self.secure:
-            c[self.cookie_name]['secure'] = 'true'
-        return c
-
-class BadTicket(Exception):
-    """
-    Exception raised when a ticket can't be parsed.  If we get
-    far enough to determine what the expected digest should have
-    been, expected is set.  This should not be shown by default,
-    but can be useful for debugging.
-    """
-    def __init__(self, msg, expected=None):
-        self.expected = expected
-        Exception.__init__(self, msg)
-
-def parse_ticket(secret, ticket, ip):
-    """
-    Parse the ticket, returning (timestamp, userid, tokens, user_data).
-
-    If the ticket cannot be parsed, ``BadTicket`` will be raised with
-    an explanation.
-    """
-    ticket = ticket.strip('"')
-    digest = ticket[:32]
-    try:
-        timestamp = int(ticket[32:40], 16)
-    except ValueError, e:
-        raise BadTicket('Timestamp is not a hex integer: %s' % e)
-    try:
-        userid, data = ticket[40:].split('!', 1)
-    except ValueError:
-        raise BadTicket('userid is not followed by !')
-    if '!' in data:
-        tokens, user_data = data.split('!', 1)
-    else:
-        # @@: Is this the right order?
-        tokens = ''
-        user_data = data
-    
-    expected = calculate_digest(ip, timestamp, secret,
-                                userid, tokens, user_data)
-
-    if expected != digest:
-        raise BadTicket('Digest signature is not correct',
-                        expected=(expected, digest))
-
-    tokens = tokens.split(',')
-
-    return (timestamp, userid, tokens, user_data)
-    
-def calculate_digest(ip, timestamp, secret, userid, tokens, user_data):
-    secret = maybe_encode(secret)
-    userid = maybe_encode(userid)
-    tokens = maybe_encode(tokens)
-    user_data = maybe_encode(user_data)
-    digest0 = md5(
-        encode_ip_timestamp(ip, timestamp) + secret + userid + '\0'
-        + tokens + '\0' + user_data).hexdigest()
-    digest = md5(digest0 + secret).hexdigest()
-    return digest
-
-def encode_ip_timestamp(ip, timestamp):
-    ip_chars = ''.join(map(chr, map(int, ip.split('.'))))
-    t = int(timestamp)
-    ts = ((t & 0xff000000) >> 24,
-          (t & 0xff0000) >> 16,
-          (t & 0xff00) >> 8,
-          t & 0xff)
-    ts_chars = ''.join(map(chr, ts))
-    return ip_chars + ts_chars
-
-def maybe_encode(s, encoding='utf8'):
-    if isinstance(s, unicode):
-        s = s.encode(encoding)
-    return s
-
-class AuthTKTMiddleware(object):
-
-    """
-    Middleware that checks for signed cookies that match what
-    `mod_auth_tkt <http://www.openfusion.com.au/labs/mod_auth_tkt/>`_
-    looks for (if you have mod_auth_tkt installed, you don't need this
-    middleware, since Apache will set the environmental variables for
-    you).
-
-    Arguments:
-    
-    ``secret``:
-        A secret that should be shared by any instances of this application.
-        If this app is served from more than one machine, they should all 
-        have the same secret.
-        
-    ``cookie_name``:
-        The name of the cookie to read and write from.  Default ``auth_tkt``.
-        
-    ``secure``:
-        If the cookie should be set as 'secure' (only sent over SSL) and if
-        the login must be over SSL.
-        
-    ``include_ip``:
-        If the cookie should include the user's IP address.  If so, then 
-        if they change IPs their cookie will be invalid.
-        
-    ``logout_path``:
-        The path under this middleware that should signify a logout.  The
-        page will be shown as usual, but the user will also be logged out
-        when they visit this page.
-        
-    If used with mod_auth_tkt, then these settings (except logout_path) should 
-    match the analogous Apache configuration settings.
-
-    This also adds two functions to the request:
-
-    ``environ['paste.auth_tkt.set_user'](userid, tokens='', user_data='')``
-
-        This sets a cookie that logs the user in.  ``tokens`` is a
-        string (comma-separated groups) or a list of strings.
-        ``user_data`` is a string for your own use.
-
-    ``environ['paste.auth_tkt.logout_user']()``
-
-        Logs out the user.
-    """
-
-    def __init__(self, app, secret, cookie_name='auth_tkt', secure=False,
-                 include_ip=True, logout_path=None):
-        self.app = app
-        self.secret = secret
-        self.cookie_name = cookie_name
-        self.secure = secure
-        self.include_ip = include_ip
-        self.logout_path = logout_path
-
-    def __call__(self, environ, start_response):
-        cookies = request.get_cookies(environ)
-        if cookies.has_key(self.cookie_name):
-            cookie_value = cookies[self.cookie_name].value
-        else:
-            cookie_value = ''
-        if cookie_value:
-            if self.include_ip:
-                remote_addr = environ['REMOTE_ADDR']
-            else:
-                # mod_auth_tkt uses this dummy value when IP is not
-                # checked:
-                remote_addr = '0.0.0.0'
-            # @@: This should handle bad signatures better:
-            # Also, timeouts should cause cookie refresh
-            timestamp, userid, tokens, user_data = parse_ticket(
-                self.secret, cookie_value, remote_addr)
-            tokens = ','.join(tokens)
-            environ['REMOTE_USER'] = userid
-            if environ.get('REMOTE_USER_TOKENS'):
-                # We want to add tokens/roles to what's there:
-                tokens = environ['REMOTE_USER_TOKENS'] + ',' + tokens
-            environ['REMOTE_USER_TOKENS'] = tokens
-            environ['REMOTE_USER_DATA'] = user_data
-            environ['AUTH_TYPE'] = 'cookie'
-        set_cookies = []
-        def set_user(userid, tokens='', user_data=''):
-            set_cookies.extend(self.set_user_cookie(
-                environ, userid, tokens, user_data))
-        def logout_user():
-            set_cookies.extend(self.logout_user_cookie(environ))
-        environ['paste.auth_tkt.set_user'] = set_user
-        environ['paste.auth_tkt.logout_user'] = logout_user
-        if self.logout_path and environ.get('PATH_INFO') == self.logout_path:
-            logout_user()
-        def cookie_setting_start_response(status, headers, exc_info=None):
-            headers.extend(set_cookies)
-            return start_response(status, headers, exc_info)
-        return self.app(environ, cookie_setting_start_response)
-
-    def set_user_cookie(self, environ, userid, tokens, user_data):
-        if not isinstance(tokens, basestring):
-            tokens = ','.join(tokens)
-        if self.include_ip:
-            remote_addr = environ['REMOTE_ADDR']
-        else:
-            remote_addr = '0.0.0.0'
-        ticket = AuthTicket(
-            self.secret,
-            userid,
-            remote_addr,
-            tokens=tokens,
-            user_data=user_data,
-            cookie_name=self.cookie_name,
-            secure=self.secure)
-        # @@: Should we set REMOTE_USER etc in the current
-        # environment right now as well?
-        cur_domain = environ.get('HTTP_HOST', environ.get('SERVER_NAME'))
-        wild_domain = '.' + cur_domain
-        cookies = [
-            ('Set-Cookie', '%s=%s; Path=/' % (
-            self.cookie_name, ticket.cookie_value())),
-            ('Set-Cookie', '%s=%s; Path=/; Domain=%s' % (
-            self.cookie_name, ticket.cookie_value(), cur_domain)),
-            ('Set-Cookie', '%s=%s; Path=/; Domain=%s' % (
-            self.cookie_name, ticket.cookie_value(), wild_domain))
-            ]
-        return cookies
-    
-    def logout_user_cookie(self, environ):
-        cur_domain = environ.get('HTTP_HOST', environ.get('SERVER_NAME'))
-        wild_domain = '.' + cur_domain
-        cookies = [
-            ('Set-Cookie', '%s=""; Path=/' % self.cookie_name),
-            ('Set-Cookie', '%s=""; Path=/; Domain=%s' %
-             (self.cookie_name, cur_domain)),
-            ('Set-Cookie', '%s=""; Path=/; Domain=%s' %
-             (self.cookie_name, wild_domain)),
-            ]
-        return cookies
-
-def make_auth_tkt_middleware(
-    app,
-    global_conf,
-    secret=None,
-    cookie_name='auth_tkt',
-    secure=False,
-    include_ip=True,
-    logout_path=None):
-    """
-    Creates the `AuthTKTMiddleware
-    <class-paste.auth.auth_tkt.AuthTKTMiddleware.html>`_.
-
-    ``secret`` is requird, but can be set globally or locally.
-    """
-    from paste.deploy.converters import asbool
-    secure = asbool(secure)
-    include_ip = asbool(include_ip)
-    if secret is None:
-        secret = global_conf.get('secret')
-    if not secret:
-        raise ValueError(
-            "You must provide a 'secret' (in global or local configuration)")
-    return AuthTKTMiddleware(
-        app, secret, cookie_name, secure, include_ip, logout_path or None)

+ 0 - 122
desktop/core/ext-py/Paste-1.7.2/paste/auth/basic.py

@@ -1,122 +0,0 @@
-# (c) 2005 Clark C. Evans
-# This module is part of the Python Paste Project and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
-# This code was written with funding by http://prometheusresearch.com
-"""
-Basic HTTP/1.0 Authentication
-
-This module implements ``Basic`` authentication as described in
-HTTP/1.0 specification [1]_ .  Do not use this module unless you
-are using SSL or need to work with very out-dated clients, instead
-use ``digest`` authentication.
-
->>> from paste.wsgilib import dump_environ
->>> from paste.httpserver import serve
->>> # from paste.auth.basic import AuthBasicHandler
->>> realm = 'Test Realm'
->>> def authfunc(environ, username, password):
-...     return username == password
->>> serve(AuthBasicHandler(dump_environ, realm, authfunc))
-serving on...
-
-.. [1] http://www.w3.org/Protocols/HTTP/1.0/draft-ietf-http-spec.html#BasicAA
-"""
-from paste.httpexceptions import HTTPUnauthorized
-from paste.httpheaders import *
-
-class AuthBasicAuthenticator(object):
-    """
-    implements ``Basic`` authentication details
-    """
-    type = 'basic'
-    def __init__(self, realm, authfunc):
-        self.realm = realm
-        self.authfunc = authfunc
-
-    def build_authentication(self):
-        head = WWW_AUTHENTICATE.tuples('Basic realm="%s"' % self.realm)
-        return HTTPUnauthorized(headers=head)
-
-    def authenticate(self, environ):
-        authorization = AUTHORIZATION(environ)
-        if not authorization:
-            return self.build_authentication()
-        (authmeth, auth) = authorization.split(' ', 1)
-        if 'basic' != authmeth.lower():
-            return self.build_authentication()
-        auth = auth.strip().decode('base64')
-        username, password = auth.split(':', 1)
-        if self.authfunc(environ, username, password):
-            return username
-        return self.build_authentication()
-
-    __call__ = authenticate
-
-class AuthBasicHandler(object):
-    """
-    HTTP/1.0 ``Basic`` authentication middleware
-
-    Parameters:
-
-        ``application``
-
-            The application object is called only upon successful
-            authentication, and can assume ``environ['REMOTE_USER']``
-            is set.  If the ``REMOTE_USER`` is already set, this
-            middleware is simply pass-through.
-
-        ``realm``
-
-            This is a identifier for the authority that is requesting
-            authorization.  It is shown to the user and should be unique
-            within the domain it is being used.
-
-        ``authfunc``
-
-            This is a mandatory user-defined function which takes a
-            ``environ``, ``username`` and ``password`` for its first
-            three arguments.  It should return ``True`` if the user is
-            authenticated.
-
-    """
-    def __init__(self, application, realm, authfunc):
-        self.application = application
-        self.authenticate = AuthBasicAuthenticator(realm, authfunc)
-
-    def __call__(self, environ, start_response):
-        username = REMOTE_USER(environ)
-        if not username:
-            result = self.authenticate(environ)
-            if isinstance(result, str):
-                AUTH_TYPE.update(environ, 'basic')
-                REMOTE_USER.update(environ, result)
-            else:
-                return result.wsgi_application(environ, start_response)
-        return self.application(environ, start_response)
-
-middleware = AuthBasicHandler
-
-__all__ = ['AuthBasicHandler']
-
-def make_basic(app, global_conf, realm, authfunc, **kw):
-    """
-    Grant access via basic authentication
-
-    Config looks like this::
-
-      [filter:grant]
-      use = egg:Paste#auth_basic
-      realm=myrealm
-      authfunc=somepackage.somemodule:somefunction
-      
-    """
-    from paste.util.import_string import eval_import
-    import types
-    authfunc = eval_import(authfunc)
-    assert isinstance(authfunc, types.FunctionType), "authfunc must resolve to a function"
-    return AuthBasicHandler(app, realm, authfunc)
-    
-
-if "__main__" == __name__:
-    import doctest
-    doctest.testmod(optionflags=doctest.ELLIPSIS)

+ 0 - 99
desktop/core/ext-py/Paste-1.7.2/paste/auth/cas.py

@@ -1,99 +0,0 @@
-# (c) 2005 Clark C. Evans
-# This module is part of the Python Paste Project and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
-# This code was written with funding by http://prometheusresearch.com
-"""
-CAS 1.0 Authentication
-
-The Central Authentication System is a straight-forward single sign-on
-mechanism developed by Yale University's ITS department.  It has since
-enjoyed widespread success and is deployed at many major universities
-and some corporations.
-
-    https://clearinghouse.ja-sig.org/wiki/display/CAS/Home
-    http://www.yale.edu/tp/auth/usingcasatyale.html
-
-This implementation has the goal of maintaining current path arguments
-passed to the system so that it can be used as middleware at any stage
-of processing.  It has the secondary goal of allowing for other
-authentication methods to be used concurrently.
-"""
-import urllib
-from paste.request import construct_url
-from paste.httpexceptions import HTTPSeeOther, HTTPForbidden
-
-class CASLoginFailure(HTTPForbidden):
-    """ The exception raised if the authority returns 'no' """
-
-class CASAuthenticate(HTTPSeeOther):
-    """ The exception raised to authenticate the user """
-
-def AuthCASHandler(application, authority):
-    """
-    middleware to implement CAS 1.0 authentication
-
-    There are several possible outcomes:
-
-    0. If the REMOTE_USER environment variable is already populated;
-       then this middleware is a no-op, and the request is passed along
-       to the application.
-
-    1. If a query argument 'ticket' is found, then an attempt to
-       validate said ticket /w the authentication service done.  If the
-       ticket is not validated; an 403 'Forbidden' exception is raised.
-       Otherwise, the REMOTE_USER variable is set with the NetID that
-       was validated and AUTH_TYPE is set to "cas".
-
-    2. Otherwise, a 303 'See Other' is returned to the client directing
-       them to login using the CAS service.  After logon, the service
-       will send them back to this same URL, only with a 'ticket' query
-       argument.
-
-    Parameters:
-
-        ``authority``
-
-            This is a fully-qualified URL to a CAS 1.0 service. The URL
-            should end with a '/' and have the 'login' and 'validate'
-            sub-paths as described in the CAS 1.0 documentation.
-
-    """
-    assert authority.endswith("/") and authority.startswith("http")
-    def cas_application(environ, start_response):
-        username = environ.get('REMOTE_USER','')
-        if username:
-            return application(environ, start_response)
-        qs = environ.get('QUERY_STRING','').split("&")
-        if qs and qs[-1].startswith("ticket="):
-            # assume a response from the authority
-            ticket = qs.pop().split("=", 1)[1]
-            environ['QUERY_STRING'] = "&".join(qs)
-            service = construct_url(environ)
-            args = urllib.urlencode(
-                    {'service': service,'ticket': ticket})
-            requrl = authority + "validate?" + args
-            result = urllib.urlopen(requrl).read().split("\n")
-            if 'yes' == result[0]:
-                environ['REMOTE_USER'] = result[1]
-                environ['AUTH_TYPE'] = 'cas'
-                return application(environ, start_response)
-            exce = CASLoginFailure()
-        else:
-            service = construct_url(environ)
-            args = urllib.urlencode({'service': service})
-            location = authority + "login?" + args
-            exce = CASAuthenticate(location)
-        return exce.wsgi_application(environ, start_response)
-    return cas_application
-
-middleware = AuthCASHandler
-
-__all__ = ['CASLoginFailure', 'CASAuthenticate', 'AuthCASHandler' ]
-
-if '__main__' == __name__:
-    authority = "https://secure.its.yale.edu/cas/servlet/"
-    from paste.wsgilib import dump_environ
-    from paste.httpserver import serve
-    from paste.httpexceptions import *
-    serve(HTTPExceptionHandler(
-             AuthCASHandler(dump_environ, authority)))

+ 0 - 395
desktop/core/ext-py/Paste-1.7.2/paste/auth/cookie.py

@@ -1,395 +0,0 @@
-# (c) 2005 Clark C. Evans
-# This module is part of the Python Paste Project and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
-# This code was written with funding by http://prometheusresearch.com
-"""
-Cookie "Saved" Authentication
-
-This authentication middleware saves the current REMOTE_USER,
-REMOTE_SESSION, and any other environment variables specified in a
-cookie so that it can be retrieved during the next request without
-requiring re-authentication. This uses a session cookie on the client
-side (so it goes away when the user closes their window) and does
-server-side expiration.
-
-Following is a very simple example where a form is presented asking for
-a user name (no actual checking), and dummy session identifier (perhaps
-corresponding to a database session id) is stored in the cookie.
-
-::
-
-  >>> from paste.httpserver import serve
-  >>> from paste.fileapp import DataApp
-  >>> from paste.httpexceptions import *
-  >>> from paste.auth.cookie import AuthCookieHandler
-  >>> from paste.wsgilib import parse_querystring
-  >>> def testapp(environ, start_response):
-  ...     user = dict(parse_querystring(environ)).get('user','')
-  ...     if user:
-  ...         environ['REMOTE_USER'] = user
-  ...         environ['REMOTE_SESSION'] = 'a-session-id'
-  ...     if environ.get('REMOTE_USER'):
-  ...         page = '<html><body>Welcome %s (%s)</body></html>'
-  ...         page %= (environ['REMOTE_USER'], environ['REMOTE_SESSION'])
-  ...     else:
-  ...         page = ('<html><body><form><input name="user" />'
-  ...                 '<input type="submit" /></form></body></html>')
-  ...     return DataApp(page, content_type="text/html")(
-  ...                    environ, start_response)
-  >>> serve(AuthCookieHandler(testapp))
-  serving on...
-
-"""
-
-import hmac, base64, random, time, warnings
-try:
-    from hashlib import sha1
-except ImportError:
-    # NOTE: We have to use the callable with hashlib (hashlib.sha1),
-    # otherwise hmac only accepts the sha module object itself
-    import sha as sha1
-from paste.request import get_cookies
-
-def make_time(value):
-    return time.strftime("%Y%m%d%H%M", time.gmtime(value))
-_signature_size = len(hmac.new('x', 'x', sha1).digest())
-_header_size = _signature_size + len(make_time(time.time()))
-
-# @@: Should this be using urllib.quote?
-# build encode/decode functions to safely pack away values
-_encode = [('\\', '\\x5c'), ('"', '\\x22'),
-           ('=', '\\x3d'), (';', '\\x3b')]
-_decode = [(v, k) for (k, v) in _encode]
-_decode.reverse()
-def encode(s, sublist = _encode):
-    return reduce((lambda a, (b, c): a.replace(b, c)), sublist, str(s))
-decode = lambda s: encode(s, _decode)
-
-class CookieTooLarge(RuntimeError):
-    def __init__(self, content, cookie):
-        RuntimeError.__init__("Signed cookie exceeds maximum size of 4096")
-        self.content = content
-        self.cookie = cookie
-
-_all_chars = ''.join([chr(x) for x in range(0, 255)])
-def new_secret():
-    """ returns a 64 byte secret """
-    return ''.join(random.sample(_all_chars, 64))
-
-class AuthCookieSigner(object):
-    """
-    save/restore ``environ`` entries via digially signed cookie
-
-    This class converts content into a timed and digitally signed
-    cookie, as well as having the facility to reverse this procedure.
-    If the cookie, after the content is encoded and signed exceeds the
-    maximum length (4096), then CookieTooLarge exception is raised.
-
-    The timeout of the cookie is handled on the server side for a few
-    reasons.  First, if a 'Expires' directive is added to a cookie, then
-    the cookie becomes persistent (lasting even after the browser window
-    has closed). Second, the user's clock may be wrong (perhaps
-    intentionally). The timeout is specified in minutes; and expiration
-    date returned is rounded to one second.
-
-    Constructor Arguments:
-
-        ``secret``
-
-            This is a secret key if you want to syncronize your keys so
-            that the cookie will be good across a cluster of computers.
-            It is recommended via the HMAC specification (RFC 2104) that
-            the secret key be 64 bytes since this is the block size of
-            the hashing.  If you do not provide a secret key, a random
-            one is generated each time you create the handler; this
-            should be sufficient for most cases.
-
-        ``timeout``
-
-            This is the time (in minutes) from which the cookie is set
-            to expire.  Note that on each request a new (replacement)
-            cookie is sent, hence this is effectively a session timeout
-            parameter for your entire cluster.  If you do not provide a
-            timeout, it is set at 30 minutes.
-
-        ``maxlen``
-
-            This is the maximum size of the *signed* cookie; hence the
-            actual content signed will be somewhat less.  If the cookie
-            goes over this size, a ``CookieTooLarge`` exception is
-            raised so that unexpected handling of cookies on the client
-            side are avoided.  By default this is set at 4k (4096 bytes),
-            which is the standard cookie size limit.
-
-    """
-    def __init__(self, secret = None, timeout = None, maxlen = None):
-        self.timeout = timeout or 30
-        if isinstance(timeout, basestring):
-            raise ValueError(
-                "Timeout must be a number (minutes), not a string (%r)"
-                % timeout)
-        self.maxlen  = maxlen or 4096
-        self.secret = secret or new_secret()
-
-    def sign(self, content):
-        """
-        Sign the content returning a valid cookie (that does not
-        need to be escaped and quoted).  The expiration of this
-        cookie is handled server-side in the auth() function.
-        """
-        cookie = base64.encodestring(
-            hmac.new(self.secret, content, sha1).digest() +
-            make_time(time.time() + 60*self.timeout) +
-            content)[:-1]
-        cookie = cookie.replace("/", "_").replace("=", "~")
-        if len(cookie) > self.maxlen:
-            raise CookieTooLarge(content, cookie)
-        return cookie
-
-    def auth(self, cookie):
-        """
-        Authenticate the cooke using the signature, verify that it
-        has not expired; and return the cookie's content
-        """
-        decode = base64.decodestring(
-            cookie.replace("_", "/").replace("~", "="))
-        signature = decode[:_signature_size]
-        expires = decode[_signature_size:_header_size]
-        content = decode[_header_size:]
-        if signature == hmac.new(self.secret, content, sha1).digest():
-            if int(expires) > int(make_time(time.time())):
-                return content
-            else:
-                # This is the normal case of an expired cookie; just
-                # don't bother doing anything here.
-                pass
-        else:
-            # This case can happen if the server is restarted with a
-            # different secret; or if the user's IP address changed
-            # due to a proxy.  However, it could also be a break-in
-            # attempt -- so should it be reported?
-            pass
-
-class AuthCookieEnviron(list):
-    """
-    a list of environment keys to be saved via cookie
-
-    An instance of this object, found at ``environ['paste.auth.cookie']``
-    lists the `environ` keys that were restored from or will be added
-    to the digially signed cookie.  This object can be accessed from an
-    `environ` variable by using this module's name.
-    """
-    def __init__(self, handler, scanlist):
-        list.__init__(self, scanlist)
-        self.handler = handler
-    def append(self, value):
-        if value in self:
-            return
-        list.append(self, str(value))
-
-class AuthCookieHandler(object):
-    """
-    the actual handler that should be put in your middleware stack
-
-    This middleware uses cookies to stash-away a previously authenticated
-    user (and perhaps other variables) so that re-authentication is not
-    needed.  This does not implement sessions; and therefore N servers
-    can be syncronized to accept the same saved authentication if they
-    all use the same cookie_name and secret.
-
-    By default, this handler scans the `environ` for the REMOTE_USER
-    and REMOTE_SESSION key; if found, it is stored. It can be
-    configured to scan other `environ` keys as well -- but be careful
-    not to exceed 2-3k (so that the encoded and signed cookie does not
-    exceed 4k). You can ask it to handle other environment variables
-    by doing:
-
-       ``environ['paste.auth.cookie'].append('your.environ.variable')``
-
-
-    Constructor Arguments:
-
-        ``application``
-
-            This is the wrapped application which will have access to
-            the ``environ['REMOTE_USER']`` restored by this middleware.
-
-        ``cookie_name``
-
-            The name of the cookie used to store this content, by default
-            it is ``PASTE_AUTH_COOKIE``.
-
-        ``scanlist``
-
-            This is the initial set of ``environ`` keys to
-            save/restore to the signed cookie.  By default is consists
-            only of ``REMOTE_USER`` and ``REMOTE_SESSION``; any tuple
-            or list of environment keys will work.  However, be
-            careful, as the total saved size is limited to around 3k.
-
-        ``signer``
-
-            This is the signer object used to create the actual cookie
-            values, by default, it is ``AuthCookieSigner`` and is passed
-            the remaining arguments to this function: ``secret``,
-            ``timeout``, and ``maxlen``.
-
-    At this time, each cookie is individually signed.  To store more
-    than the 4k of data; it is possible to sub-class this object to
-    provide different ``environ_name`` and ``cookie_name``
-    """
-    environ_name = 'paste.auth.cookie'
-    cookie_name  = 'PASTE_AUTH_COOKIE'
-    signer_class = AuthCookieSigner
-    environ_class = AuthCookieEnviron
-
-    def __init__(self, application, cookie_name=None, scanlist=None,
-                 signer=None, secret=None, timeout=None, maxlen=None):
-        if not signer:
-            signer = self.signer_class(secret, timeout, maxlen)
-        self.signer = signer
-        self.scanlist = scanlist or ('REMOTE_USER','REMOTE_SESSION')
-        self.application = application
-        self.cookie_name = cookie_name or self.cookie_name
-
-    def __call__(self, environ, start_response):
-        if self.environ_name in environ:
-            raise AssertionError("AuthCookie already installed!")
-        scanlist = self.environ_class(self, self.scanlist)
-        jar = get_cookies(environ)
-        if jar.has_key(self.cookie_name):
-            content = self.signer.auth(jar[self.cookie_name].value)
-            if content:
-                for pair in content.split(";"):
-                    (k, v) = pair.split("=")
-                    k = decode(k)
-                    if k not in scanlist:
-                        scanlist.append(k)
-                    if k in environ:
-                        continue
-                    environ[k] = decode(v)
-                    if 'REMOTE_USER' == k:
-                        environ['AUTH_TYPE'] = 'cookie'
-        environ[self.environ_name] = scanlist
-        if "paste.httpexceptions" in environ:
-            warnings.warn("Since paste.httpexceptions is hooked in your "
-                "processing chain before paste.auth.cookie, if an "
-                "HTTPRedirection is raised, the cookies this module sets "
-                "will not be included in your response.\n")
-
-        def response_hook(status, response_headers, exc_info=None):
-            """
-            Scan the environment for keys specified in the scanlist,
-            pack up their values, signs the content and issues a cookie.
-            """
-            scanlist = environ.get(self.environ_name)
-            assert scanlist and isinstance(scanlist, self.environ_class)
-            content = []
-            for k in scanlist:
-                v = environ.get(k)
-                if v is not None:
-                    if type(v) is not str:
-                        raise ValueError(
-                            "The value of the environmental variable %r "
-                            "is not a str (only str is allowed; got %r)"
-                            % (k, v))
-                    content.append("%s=%s" % (encode(k), encode(v)))
-            if content:
-                content = ";".join(content)
-                content = self.signer.sign(content)
-                cookie = '%s=%s; Path=/;' % (self.cookie_name, content)
-                if 'https' == environ['wsgi.url_scheme']:
-                    cookie += ' secure;'
-                response_headers.append(('Set-Cookie', cookie))
-            return start_response(status, response_headers, exc_info)
-        return self.application(environ, response_hook)
-
-middleware = AuthCookieHandler
-
-# Paste Deploy entry point:
-def make_auth_cookie(
-    app, global_conf,
-    # Should this get picked up from global_conf somehow?:
-    cookie_name='PASTE_AUTH_COOKIE',
-    scanlist=('REMOTE_USER', 'REMOTE_SESSION'),
-    # signer cannot be set
-    secret=None,
-    timeout=30,
-    maxlen=4096):
-    """
-    This middleware uses cookies to stash-away a previously
-    authenticated user (and perhaps other variables) so that
-    re-authentication is not needed.  This does not implement
-    sessions; and therefore N servers can be syncronized to accept the
-    same saved authentication if they all use the same cookie_name and
-    secret.
-
-    By default, this handler scans the `environ` for the REMOTE_USER
-    and REMOTE_SESSION key; if found, it is stored. It can be
-    configured to scan other `environ` keys as well -- but be careful
-    not to exceed 2-3k (so that the encoded and signed cookie does not
-    exceed 4k). You can ask it to handle other environment variables
-    by doing:
-
-       ``environ['paste.auth.cookie'].append('your.environ.variable')``
-
-    Configuration:
-
-        ``cookie_name``
-
-            The name of the cookie used to store this content, by
-            default it is ``PASTE_AUTH_COOKIE``.
-
-        ``scanlist``
-
-            This is the initial set of ``environ`` keys to
-            save/restore to the signed cookie.  By default is consists
-            only of ``REMOTE_USER`` and ``REMOTE_SESSION``; any
-            space-separated list of environment keys will work.
-            However, be careful, as the total saved size is limited to
-            around 3k.
-
-        ``secret``
-
-            The secret that will be used to sign the cookies.  If you
-            don't provide one (and none is set globally) then a random
-            secret will be created.  Each time the server is restarted
-            a new secret will then be created and all cookies will
-            become invalid!  This can be any string value.
-
-        ``timeout``
-
-            The time to keep the cookie, expressed in minutes.  This
-            is handled server-side, so a new cookie with a new timeout
-            is added to every response.
-
-        ``maxlen``
-
-            The maximum length of the cookie that is sent (default 4k,
-            which is a typical browser maximum)
-        
-    """
-    if isinstance(scanlist, basestring):
-        scanlist = scanlist.split()
-    if secret is None and global_conf.get('secret'):
-        secret = global_conf['secret']
-    try:
-        timeout = int(timeout)
-    except ValueError:
-        raise ValueError('Bad value for timeout (must be int): %r'
-                         % timeout)
-    try:
-        maxlen = int(maxlen)
-    except ValueError:
-        raise ValueError('Bad value for maxlen (must be int): %r'
-                         % maxlen)
-    return AuthCookieHandler(
-        app, cookie_name=cookie_name, scanlist=scanlist,
-        secret=secret, timeout=timeout, maxlen=maxlen)
-
-__all__ = ['AuthCookieHandler', 'AuthCookieSigner', 'AuthCookieEnviron']
-
-if "__main__" == __name__:
-    import doctest
-    doctest.testmod(optionflags=doctest.ELLIPSIS)
-

+ 0 - 213
desktop/core/ext-py/Paste-1.7.2/paste/auth/digest.py

@@ -1,213 +0,0 @@
-# (c) 2005 Clark C. Evans
-# This module is part of the Python Paste Project and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
-# This code was written with funding by http://prometheusresearch.com
-"""
-Digest HTTP/1.1 Authentication
-
-This module implements ``Digest`` authentication as described by
-RFC 2617 [1]_ .
-
-Basically, you just put this module before your application, and it
-takes care of requesting and handling authentication requests.  This
-module has been tested with several common browsers "out-in-the-wild".
-
->>> from paste.wsgilib import dump_environ
->>> from paste.httpserver import serve
->>> # from paste.auth.digest import digest_password, AuthDigestHandler
->>> realm = 'Test Realm'
->>> def authfunc(environ, realm, username):
-...     return digest_password(realm, username, username)
->>> serve(AuthDigestHandler(dump_environ, realm, authfunc))
-serving on...
-
-This code has not been audited by a security expert, please use with
-caution (or better yet, report security holes). At this time, this
-implementation does not provide for further challenges, nor does it
-support Authentication-Info header.  It also uses md5, and an option
-to use sha would be a good thing.
-
-.. [1] http://www.faqs.org/rfcs/rfc2617.html
-"""
-from paste.httpexceptions import HTTPUnauthorized
-from paste.httpheaders import *
-try:
-    from hashlib import md5
-except ImportError:
-    from md5 import md5
-import time, random
-
-def digest_password(realm, username, password):
-    """ construct the appropriate hashcode needed for HTTP digest """
-    return md5("%s:%s:%s" % (username, realm, password)).hexdigest()
-
-class AuthDigestAuthenticator(object):
-    """ implementation of RFC 2617 - HTTP Digest Authentication """
-    def __init__(self, realm, authfunc):
-        self.nonce    = {} # list to prevent replay attacks
-        self.authfunc = authfunc
-        self.realm    = realm
-
-    def build_authentication(self, stale = ''):
-        """ builds the authentication error """
-        nonce  = md5(
-            "%s:%s" % (time.time(), random.random())).hexdigest()
-        opaque = md5(
-            "%s:%s" % (time.time(), random.random())).hexdigest()
-        self.nonce[nonce] = None
-        parts = {'realm': self.realm, 'qop': 'auth',
-                 'nonce': nonce, 'opaque': opaque }
-        if stale:
-            parts['stale'] = 'true'
-        head = ", ".join(['%s="%s"' % (k, v) for (k, v) in parts.items()])
-        head = [("WWW-Authenticate", 'Digest %s' % head)]
-        return HTTPUnauthorized(headers=head)
-
-    def compute(self, ha1, username, response, method,
-                      path, nonce, nc, cnonce, qop):
-        """ computes the authentication, raises error if unsuccessful """
-        if not ha1:
-            return self.build_authentication()
-        ha2 = md5('%s:%s' % (method, path)).hexdigest()
-        if qop:
-            chk = "%s:%s:%s:%s:%s:%s" % (ha1, nonce, nc, cnonce, qop, ha2)
-        else:
-            chk = "%s:%s:%s" % (ha1, nonce, ha2)
-        if response != md5(chk).hexdigest():
-            if nonce in self.nonce:
-                del self.nonce[nonce]
-            return self.build_authentication()
-        pnc = self.nonce.get(nonce,'00000000')
-        if nc <= pnc:
-            if nonce in self.nonce:
-                del self.nonce[nonce]
-            return self.build_authentication(stale = True)
-        self.nonce[nonce] = nc
-        return username
-
-    def authenticate(self, environ):
-        """ This function takes a WSGI environment and authenticates
-            the request returning authenticated user or error.
-        """
-        method = REQUEST_METHOD(environ)
-        fullpath = SCRIPT_NAME(environ) + PATH_INFO(environ)
-        authorization = AUTHORIZATION(environ)
-        if not authorization:
-            return self.build_authentication()
-        (authmeth, auth) = authorization.split(" ", 1)
-        if 'digest' != authmeth.lower():
-            return self.build_authentication()
-        amap = {}
-        for itm in auth.split(", "):
-            (k,v) = [s.strip() for s in itm.split("=", 1)]
-            amap[k] = v.replace('"', '')
-        try:
-            username = amap['username']
-            authpath = amap['uri']
-            nonce    = amap['nonce']
-            realm    = amap['realm']
-            response = amap['response']
-            assert authpath.split("?", 1)[0] in fullpath
-            assert realm == self.realm
-            qop      = amap.get('qop', '')
-            cnonce   = amap.get('cnonce', '')
-            nc       = amap.get('nc', '00000000')
-            if qop:
-                assert 'auth' == qop
-                assert nonce and nc
-        except:
-            return self.build_authentication()
-        ha1 = self.authfunc(environ, realm, username)
-        return self.compute(ha1, username, response, method, authpath,
-                            nonce, nc, cnonce, qop)
-
-    __call__ = authenticate
-
-class AuthDigestHandler(object):
-    """
-    middleware for HTTP Digest authentication (RFC 2617)
-
-    This component follows the procedure below:
-
-        0. If the REMOTE_USER environment variable is already populated;
-           then this middleware is a no-op, and the request is passed
-           along to the application.
-
-        1. If the HTTP_AUTHORIZATION header was not provided or specifies
-           an algorithem other than ``digest``, then a HTTPUnauthorized
-           response is generated with the challenge.
-
-        2. If the response is malformed or or if the user's credientials
-           do not pass muster, another HTTPUnauthorized is raised.
-
-        3. If all goes well, and the user's credintials pass; then
-           REMOTE_USER environment variable is filled in and the
-           AUTH_TYPE is listed as 'digest'.
-
-    Parameters:
-
-        ``application``
-
-            The application object is called only upon successful
-            authentication, and can assume ``environ['REMOTE_USER']``
-            is set.  If the ``REMOTE_USER`` is already set, this
-            middleware is simply pass-through.
-
-        ``realm``
-
-            This is a identifier for the authority that is requesting
-            authorization.  It is shown to the user and should be unique
-            within the domain it is being used.
-
-        ``authfunc``
-
-            This is a callback function which performs the actual
-            authentication; the signature of this callback is:
-
-              authfunc(environ, realm, username) -> hashcode
-
-            This module provides a 'digest_password' helper function
-            which can help construct the hashcode; it is recommended
-            that the hashcode is stored in a database, not the user's
-            actual password (since you only need the hashcode).
-    """
-    def __init__(self, application, realm, authfunc):
-        self.authenticate = AuthDigestAuthenticator(realm, authfunc)
-        self.application = application
-
-    def __call__(self, environ, start_response):
-        username = REMOTE_USER(environ)
-        if not username:
-            result = self.authenticate(environ)
-            if isinstance(result, str):
-                AUTH_TYPE.update(environ,'digest')
-                REMOTE_USER.update(environ, result)
-            else:
-                return result.wsgi_application(environ, start_response)
-        return self.application(environ, start_response)
-
-middleware = AuthDigestHandler
-
-__all__ = ['digest_password', 'AuthDigestHandler' ]
-
-def make_digest(app, global_conf, realm, authfunc, **kw):
-    """
-    Grant access via digest authentication
-
-    Config looks like this::
-
-      [filter:grant]
-      use = egg:Paste#auth_digest
-      realm=myrealm
-      authfunc=somepackage.somemodule:somefunction
-      
-    """
-    from paste.util.import_string import eval_import
-    import types
-    authfunc = eval_import(authfunc)
-    assert isinstance(authfunc, types.FunctionType), "authfunc must resolve to a function"
-    return AuthDigestHandler(app, realm, authfunc)
-
-if "__main__" == __name__:
-    import doctest
-    doctest.testmod(optionflags=doctest.ELLIPSIS)

+ 0 - 149
desktop/core/ext-py/Paste-1.7.2/paste/auth/form.py

@@ -1,149 +0,0 @@
-# (c) 2005 Clark C. Evans
-# This module is part of the Python Paste Project and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
-# This code was written with funding by http://prometheusresearch.com
-"""
-Authentication via HTML Form
-
-This is a very simple HTML form login screen that asks for the username
-and password.  This middleware component requires that an authorization
-function taking the name and passsword and that it be placed in your
-application stack. This class does not include any session management
-code or way to save the user's authorization; however, it is easy enough
-to put ``paste.auth.cookie`` in your application stack.
-
->>> from paste.wsgilib import dump_environ
->>> from paste.httpserver import serve
->>> from paste.auth.cookie import AuthCookieHandler
->>> from paste.auth.form import AuthFormHandler
->>> def authfunc(environ, username, password):
-...    return username == password
->>> serve(AuthCookieHandler(
-...           AuthFormHandler(dump_environ, authfunc)))
-serving on...
-
-"""
-from paste.request import construct_url, parse_formvars
-
-TEMPLATE = """\
-<html>
-  <head><title>Please Login!</title></head>
-  <body>
-    <h1>Please Login</h1>
-    <form action="%s" method="post">
-      <dl>
-        <dt>Username:</dt>
-        <dd><input type="text" name="username"></dd>
-        <dt>Password:</dt>
-        <dd><input type="password" name="password"></dd>
-      </dl>
-      <input type="submit" name="authform" />
-      <hr />
-    </form>
-  </body>
-</html>
-"""
-
-class AuthFormHandler(object):
-    """
-    HTML-based login middleware
-
-    This causes a HTML form to be returned if ``REMOTE_USER`` is
-    not found in the ``environ``.  If the form is returned, the
-    ``username`` and ``password`` combination are given to a
-    user-supplied authentication function, ``authfunc``.  If this
-    is successful, then application processing continues.
-
-    Parameters:
-
-        ``application``
-
-            The application object is called only upon successful
-            authentication, and can assume ``environ['REMOTE_USER']``
-            is set.  If the ``REMOTE_USER`` is already set, this
-            middleware is simply pass-through.
-
-        ``authfunc``
-
-            This is a mandatory user-defined function which takes a
-            ``environ``, ``username`` and ``password`` for its first
-            three arguments.  It should return ``True`` if the user is
-            authenticated.
-
-        ``template``
-
-            This is an optional (a default is provided) HTML
-            fragment that takes exactly one ``%s`` substution
-            argument; which *must* be used for the form's ``action``
-            to ensure that this middleware component does not alter
-            the current path.  The HTML form must use ``POST`` and
-            have two input names:  ``username`` and ``password``.
-
-    Since the authentication form is submitted (via ``POST``)
-    neither the ``PATH_INFO`` nor the ``QUERY_STRING`` are accessed,
-    and hence the current path remains _unaltered_ through the
-    entire authentication process. If authentication succeeds, the
-    ``REQUEST_METHOD`` is converted from a ``POST`` to a ``GET``,
-    so that a redirect is unnecessary (unlike most form auth
-    implementations)
-    """
-
-    def __init__(self, application, authfunc, template=None):
-        self.application = application
-        self.authfunc = authfunc
-        self.template = template or TEMPLATE
-
-    def __call__(self, environ, start_response):
-        username = environ.get('REMOTE_USER','')
-        if username:
-            return self.application(environ, start_response)
-
-        if 'POST' == environ['REQUEST_METHOD']:
-            formvars = parse_formvars(environ, include_get_vars=False)
-            username = formvars.get('username')
-            password = formvars.get('password')
-            if username and password:
-                if self.authfunc(environ, username, password):
-                    environ['AUTH_TYPE'] = 'form'
-                    environ['REMOTE_USER'] = username
-                    environ['REQUEST_METHOD'] = 'GET'
-                    environ['CONTENT_LENGTH'] = ''
-                    environ['CONTENT_TYPE'] = ''
-                    del environ['paste.parsed_formvars']
-                    return self.application(environ, start_response)
-
-        content = self.template % construct_url(environ)
-        start_response("200 OK", [('Content-Type', 'text/html'),
-                                  ('Content-Length', str(len(content)))])
-        return [content]
-
-middleware = AuthFormHandler
-
-__all__ = ['AuthFormHandler']
-
-def make_form(app, global_conf, realm, authfunc, **kw):
-    """
-    Grant access via form authentication
-
-    Config looks like this::
-
-      [filter:grant]
-      use = egg:Paste#auth_form
-      realm=myrealm
-      authfunc=somepackage.somemodule:somefunction
-      
-    """
-    from paste.util.import_string import eval_import
-    import types
-    authfunc = eval_import(authfunc)
-    assert isinstance(authfunc, types.FunctionType), "authfunc must resolve to a function"
-    template = kw.get('template')
-    if template is not None:
-        template = eval_import(template)
-        assert isinstance(template, str), "template must resolve to a string"
-
-    return AuthFormHandler(app, authfunc, template)
-
-if "__main__" == __name__:
-    import doctest
-    doctest.testmod(optionflags=doctest.ELLIPSIS)

+ 0 - 113
desktop/core/ext-py/Paste-1.7.2/paste/auth/grantip.py

@@ -1,113 +0,0 @@
-# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
-# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
-"""
-Grant roles and logins based on IP address.
-"""
-from paste.util import ip4
-
-class GrantIPMiddleware(object):
-
-    """
-    On each request, ``ip_map`` is checked against ``REMOTE_ADDR``
-    and logins and roles are assigned based on that.
-
-    ``ip_map`` is a map of {ip_mask: (username, roles)}.  Either
-    ``username`` or ``roles`` may be None.  Roles may also be prefixed
-    with ``-``, like ``'-system'`` meaning that role should be
-    revoked.  ``'__remove__'`` for a username will remove the username.
-
-    If ``clobber_username`` is true (default) then any user
-    specification will override the current value of ``REMOTE_USER``.
-    ``'__remove__'`` will always clobber the username.
-
-    ``ip_mask`` is something that `paste.util.ip4:IP4Range
-    <class-paste.util.ip4.IP4Range.html>`_ can parse.  Simple IP
-    addresses, IP/mask, ip<->ip ranges, and hostnames are allowed.
-    """
-
-    def __init__(self, app, ip_map, clobber_username=True):
-        self.app = app
-        self.ip_map = []
-        for key, value in ip_map.items():
-            self.ip_map.append((ip4.IP4Range(key),
-                                self._convert_user_role(value[0], value[1])))
-        self.clobber_username = clobber_username
-
-    def _convert_user_role(self, username, roles):
-        if roles and isinstance(roles, basestring):
-            roles = roles.split(',')
-        return (username, roles)
-        
-    def __call__(self, environ, start_response):
-        addr = ip4.ip2int(environ['REMOTE_ADDR'], False)
-        remove_user = False
-        add_roles = []
-        for range, (username, roles) in self.ip_map:
-            if addr in range:
-                if roles:
-                    add_roles.extend(roles)
-                if username == '__remove__':
-                    remove_user = True
-                elif username:
-                    if (not environ.get('REMOTE_USER')
-                        or self.clobber_username):
-                        environ['REMOTE_USER'] = username
-        if (remove_user and 'REMOTE_USER' in environ):
-            del environ['REMOTE_USER']
-        if roles:
-            self._set_roles(environ, add_roles)
-        return self.app(environ, start_response)
-
-    def _set_roles(self, environ, roles):
-        cur_roles = environ.get('REMOTE_USER_TOKENS', '').split(',')
-        # Get rid of empty roles:
-        cur_roles = filter(None, cur_roles)
-        remove_roles = []
-        for role in roles:
-            if role.startswith('-'):
-                remove_roles.append(role[1:])
-            else:
-                if role not in cur_roles:
-                    cur_roles.append(role)
-        for role in remove_roles:
-            if role in cur_roles:
-                cur_roles.remove(role)
-        environ['REMOTE_USER_TOKENS'] = ','.join(cur_roles)
-        
-                
-def make_grantip(app, global_conf, clobber_username=False, **kw):
-    """
-    Grant roles or usernames based on IP addresses.
-
-    Config looks like this::
-
-      [filter:grant]
-      use = egg:Paste#grantip
-      clobber_username = true
-      # Give localhost system role (no username):
-      127.0.0.1 = -:system
-      # Give everyone in 192.168.0.* editor role:
-      192.168.0.0/24 = -:editor
-      # Give one IP the username joe:
-      192.168.0.7 = joe
-      # And one IP is should not be logged in:
-      192.168.0.10 = __remove__:-editor
-      
-    """
-    from paste.deploy.converters import asbool
-    clobber_username = asbool(clobber_username)
-    ip_map = {}
-    for key, value in kw.items():
-        if ':' in value:
-            username, role = value.split(':', 1)
-        else:
-            username = value
-            role = ''
-        if username == '-':
-            username = ''
-        if role == '-':
-            role = ''
-        ip_map[key] = value
-    return GrantIPMiddleware(app, ip_map, clobber_username)
-    
-    

+ 0 - 79
desktop/core/ext-py/Paste-1.7.2/paste/auth/multi.py

@@ -1,79 +0,0 @@
-# (c) 2005 Clark C. Evans
-# This module is part of the Python Paste Project and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
-# This code was written with funding by http://prometheusresearch.com
-"""
-Authentication via Multiple Methods
-
-In some environments, the choice of authentication method to be used
-depends upon the environment and is not "fixed".  This middleware allows
-N authentication methods to be registered along with a goodness function
-which determines which method should be used. The following example
-demonstrates how to use both form and digest authentication in a server
-stack; by default it uses form-based authentication unless
-``*authmeth=digest`` is specified as a query argument.
-
->>> from paste.auth import form, cookie, digest, multi
->>> from paste.wsgilib import dump_environ
->>> from paste.httpserver import serve
->>>
->>> multi = multi.MultiHandler(dump_environ)
->>> def authfunc(environ, realm, user):
-...     return digest.digest_password(realm, user, user)
->>> multi.add_method('digest', digest.middleware, "Test Realm", authfunc)
->>> multi.set_query_argument('digest')
->>>
->>> def authfunc(environ, username, password):
-...     return username == password
->>> multi.add_method('form', form.middleware, authfunc)
->>> multi.set_default('form')
->>> serve(cookie.middleware(multi))
-serving on...
-
-"""
-
-class MultiHandler(object):
-    """
-    Multiple Authentication Handler
-
-    This middleware provides two othogonal facilities:
-
-      - a manner to register any number of authentication middlewares
-
-      - a mechanism to register predicates which cause one of the
-        registered middlewares to be used depending upon the request
-
-    If none of the predicates returns True, then the application is
-    invoked directly without middleware
-    """
-    def __init__(self, application):
-        self.application = application
-        self.default = application
-        self.binding = {}
-        self.predicate = []
-    def add_method(self, name, factory, *args, **kwargs):
-        self.binding[name] = factory(self.application, *args, **kwargs)
-    def add_predicate(self, name, checker):
-        self.predicate.append((checker, self.binding[name]))
-    def set_default(self, name):
-        """ set default authentication method """
-        self.default = self.binding[name]
-    def set_query_argument(self, name, key = '*authmeth', value = None):
-        """ choose authentication method based on a query argument """
-        lookfor = "%s=%s" % (key, value or name)
-        self.add_predicate(name,
-            lambda environ: lookfor in environ.get('QUERY_STRING',''))
-    def __call__(self, environ, start_response):
-        for (checker, binding) in self.predicate:
-            if checker(environ):
-                return binding(environ, start_response)
-        return self.default(environ, start_response)
-
-middleware = MultiHandler
-
-__all__ = ['MultiHandler']
-
-if "__main__" == __name__:
-    import doctest
-    doctest.testmod(optionflags=doctest.ELLIPSIS)
-

+ 0 - 412
desktop/core/ext-py/Paste-1.7.2/paste/auth/open_id.py

@@ -1,412 +0,0 @@
-# (c) 2005 Ben Bangert
-# This module is part of the Python Paste Project and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
-"""
-OpenID Authentication (Consumer)
-
-OpenID is a distributed authentication system for single sign-on originally
-developed at/for LiveJournal.com.
-
-    http://openid.net/
-
-URL. You can have multiple identities in the same way you can have multiple
-URLs. All OpenID does is provide a way to prove that you own a URL (identity).
-And it does this without passing around your password, your email address, or
-anything you don't want it to. There's no profile exchange component at all:
-your profiile is your identity URL, but recipients of your identity can then
-learn more about you from any public, semantically interesting documents
-linked thereunder (FOAF, RSS, Atom, vCARD, etc.).
-
-``Note``: paste.auth.openid requires installation of the Python-OpenID
-libraries::
-
-    http://www.openidenabled.com/
-
-This module is based highly off the consumer.py that Python OpenID comes with.
-
-Using the OpenID Middleware
-===========================
-
-Using the OpenID middleware is fairly easy, the most minimal example using the
-basic login form thats included::
-
-    # Add to your wsgi app creation
-    from paste.auth import open_id
-
-    wsgi_app = open_id.middleware(wsgi_app, '/somewhere/to/store/openid/data')
-
-You will now have the OpenID form available at /oid on your site. Logging in will
-verify that the login worked.
-
-A more complete login should involve having the OpenID middleware load your own
-login page after verifying the OpenID URL so that you can retain the login
-information in your webapp (session, cookies, etc.)::
-
-    wsgi_app = open_id.middleware(wsgi_app, '/somewhere/to/store/openid/data',
-                                  login_redirect='/your/login/code')
-
-Your login code should then be configured to retrieve 'paste.auth.open_id' for
-the users OpenID URL. If this key does not exist, the user has not logged in.
-
-Once the login is retrieved, it should be saved in your webapp, and the user
-should be redirected to wherever they would normally go after a successful
-login.
-"""
-
-__all__ = ['AuthOpenIDHandler']
-
-import cgi
-import urlparse
-import re
-
-import paste.request
-from paste import httpexceptions
-
-def quoteattr(s):
-    qs = cgi.escape(s, 1)
-    return '"%s"' % (qs,)
-
-# You may need to manually add the openid package into your
-# python path if you don't have it installed with your system python.
-# If so, uncomment the line below, and change the path where you have
-# Python-OpenID.
-# sys.path.append('/path/to/openid/')
-
-from openid.store import filestore
-from openid.consumer import consumer
-from openid.oidutil import appendArgs
-
-class AuthOpenIDHandler(object):
-    """
-    This middleware implements OpenID Consumer behavior to authenticate a
-    URL against an OpenID Server.
-    """
-
-    def __init__(self, app, data_store_path, auth_prefix='/oid',
-                 login_redirect=None, catch_401=False,
-                 url_to_username=None):
-        """
-        Initialize the OpenID middleware
-
-        ``app``
-            Your WSGI app to call
-            
-        ``data_store_path``
-            Directory to store crypto data in for use with OpenID servers.
-            
-        ``auth_prefix``
-            Location for authentication process/verification
-            
-        ``login_redirect``
-            Location to load after successful process of login
-            
-        ``catch_401``
-            If true, then any 401 responses will turn into open ID login
-            requirements.
-            
-        ``url_to_username``
-            A function called like ``url_to_username(environ, url)``, which should
-            return a string username.  If not given, the URL will be the username.
-        """
-        store = filestore.FileOpenIDStore(data_store_path)
-        self.oidconsumer = consumer.OpenIDConsumer(store)
-
-        self.app = app
-        self.auth_prefix = auth_prefix
-        self.data_store_path = data_store_path
-        self.login_redirect = login_redirect
-        self.catch_401 = catch_401
-        self.url_to_username = url_to_username
-
-    def __call__(self, environ, start_response):
-        if environ['PATH_INFO'].startswith(self.auth_prefix):
-            # Let's load everything into a request dict to pass around easier
-            request = dict(environ=environ, start=start_response, body=[])
-            request['base_url'] = paste.request.construct_url(environ, with_path_info=False,
-                                                              with_query_string=False)
-
-            path = re.sub(self.auth_prefix, '', environ['PATH_INFO'])
-            request['parsed_uri'] = urlparse.urlparse(path)
-            request['query'] = dict(paste.request.parse_querystring(environ))
-
-            path = request['parsed_uri'][2]
-            if path == '/' or not path:
-                return self.render(request)
-            elif path == '/verify':
-                return self.do_verify(request)
-            elif path == '/process':
-                return self.do_process(request)
-            else:
-                return self.not_found(request)
-        else:
-            if self.catch_401:
-                return self.catch_401_app_call(environ, start_response)
-            return self.app(environ, start_response)
-
-    def catch_401_app_call(self, environ, start_response):
-        """
-        Call the application, and redirect if the app returns a 401 response
-        """
-        was_401 = []
-        def replacement_start_response(status, headers, exc_info=None):
-            if int(status.split(None, 1)) == 401:
-                # @@: Do I need to append something to go back to where we
-                # came from?
-                was_401.append(1)
-                def dummy_writer(v):
-                    pass
-                return dummy_writer
-            else:
-                return start_response(status, headers, exc_info)
-        app_iter = self.app(environ, replacement_start_response)
-        if was_401:
-            try:
-                list(app_iter)
-            finally:
-                if hasattr(app_iter, 'close'):
-                    app_iter.close()
-            redir_url = paste.request.construct_url(environ, with_path_info=False,
-                                                    with_query_string=False)
-            exc = httpexceptions.HTTPTemporaryRedirect(redir_url)
-            return exc.wsgi_application(environ, start_response)
-        else:
-            return app_iter
-
-    def do_verify(self, request):
-        """Process the form submission, initating OpenID verification.
-        """
-
-        # First, make sure that the user entered something
-        openid_url = request['query'].get('openid_url')
-        if not openid_url:
-            return self.render(request, 'Enter an identity URL to verify.',
-                        css_class='error', form_contents=openid_url)
-
-        oidconsumer = self.oidconsumer
-
-        # Then, ask the library to begin the authorization.
-        # Here we find out the identity server that will verify the
-        # user's identity, and get a token that allows us to
-        # communicate securely with the identity server.
-        status, info = oidconsumer.beginAuth(openid_url)
-
-        # If the URL was unusable (either because of network
-        # conditions, a server error, or that the response returned
-        # was not an OpenID identity page), the library will return
-        # an error code. Let the user know that that URL is unusable.
-        if status in [consumer.HTTP_FAILURE, consumer.PARSE_ERROR]:
-            if status == consumer.HTTP_FAILURE:
-                fmt = 'Failed to retrieve <q>%s</q>'
-            else:
-                fmt = 'Could not find OpenID information in <q>%s</q>'
-
-            message = fmt % (cgi.escape(openid_url),)
-            return self.render(request, message, css_class='error', form_contents=openid_url)
-        elif status == consumer.SUCCESS:
-            # The URL was a valid identity URL. Now we construct a URL
-            # that will get us to process the server response. We will
-            # need the token from the beginAuth call when processing
-            # the response. A cookie or a session object could be used
-            # to accomplish this, but for simplicity here we just add
-            # it as a query parameter of the return-to URL.
-            return_to = self.build_url(request, 'process', token=info.token)
-
-            # Now ask the library for the URL to redirect the user to
-            # his OpenID server. It is required for security that the
-            # return_to URL must be under the specified trust_root. We
-            # just use the base_url for this server as a trust root.
-            redirect_url = oidconsumer.constructRedirect(
-                info, return_to, trust_root=request['base_url'])
-
-            # Send the redirect response
-            return self.redirect(request, redirect_url)
-        else:
-            assert False, 'Not reached'
-
-    def do_process(self, request):
-        """Handle the redirect from the OpenID server.
-        """
-        oidconsumer = self.oidconsumer
-
-        # retrieve the token from the environment (in this case, the URL)
-        token = request['query'].get('token', '')
-
-        # Ask the library to check the response that the server sent
-        # us.  Status is a code indicating the response type. info is
-        # either None or a string containing more information about
-        # the return type.
-        status, info = oidconsumer.completeAuth(token, request['query'])
-
-        css_class = 'error'
-        openid_url = None
-        if status == consumer.FAILURE and info:
-            # In the case of failure, if info is non-None, it is the
-            # URL that we were verifying. We include it in the error
-            # message to help the user figure out what happened.
-            openid_url = info
-            fmt = "Verification of %s failed."
-            message = fmt % (cgi.escape(openid_url),)
-        elif status == consumer.SUCCESS:
-            # Success means that the transaction completed without
-            # error. If info is None, it means that the user cancelled
-            # the verification.
-            css_class = 'alert'
-            if info:
-                # This is a successful verification attempt. If this
-                # was a real application, we would do our login,
-                # comment posting, etc. here.
-                openid_url = info
-                if self.url_to_username:
-                    username = self.url_to_username(request['environ'], openid_url)
-                else:
-                    username = openid_url
-                if 'paste.auth_tkt.set_user' in request['environ']:
-                    request['environ']['paste.auth_tkt.set_user'](username)
-                if not self.login_redirect:
-                    fmt = ("If you had supplied a login redirect path, you would have "
-                           "been redirected there.  "
-                           "You have successfully verified %s as your identity.")
-                    message = fmt % (cgi.escape(openid_url),)
-                else:
-                    # @@: This stuff doesn't make sense to me; why not a remote redirect?
-                    request['environ']['paste.auth.open_id'] = openid_url
-                    request['environ']['PATH_INFO'] = self.login_redirect
-                    return self.app(request['environ'], request['start'])
-                    #exc = httpexceptions.HTTPTemporaryRedirect(self.login_redirect)
-                    #return exc.wsgi_application(request['environ'], request['start'])
-            else:
-                # cancelled
-                message = 'Verification cancelled'
-        else:
-            # Either we don't understand the code or there is no
-            # openid_url included with the error. Give a generic
-            # failure message. The library should supply debug
-            # information in a log.
-            message = 'Verification failed.'
-
-        return self.render(request, message, css_class, openid_url)
-
-    def build_url(self, request, action, **query):
-        """Build a URL relative to the server base_url, with the given
-        query parameters added."""
-        base = urlparse.urljoin(request['base_url'], self.auth_prefix + '/' + action)
-        return appendArgs(base, query)
-
-    def redirect(self, request, redirect_url):
-        """Send a redirect response to the given URL to the browser."""
-        response_headers = [('Content-type', 'text/plain'),
-                            ('Location', redirect_url)]
-        request['start']('302 REDIRECT', response_headers)
-        return ["Redirecting to %s" % redirect_url]
-
-    def not_found(self, request):
-        """Render a page with a 404 return code and a message."""
-        fmt = 'The path <q>%s</q> was not understood by this server.'
-        msg = fmt % (request['parsed_uri'],)
-        openid_url = request['query'].get('openid_url')
-        return self.render(request, msg, 'error', openid_url, status='404 Not Found')
-
-    def render(self, request, message=None, css_class='alert', form_contents=None,
-               status='200 OK', title="Python OpenID Consumer"):
-        """Render a page."""
-        response_headers = [('Content-type', 'text/html')]
-        request['start'](str(status), response_headers)
-
-        self.page_header(request, title)
-        if message:
-            request['body'].append("<div class='%s'>" % (css_class,))
-            request['body'].append(message)
-            request['body'].append("</div>")
-        self.page_footer(request, form_contents)
-        return request['body']
-
-    def page_header(self, request, title):
-        """Render the page header"""
-        request['body'].append('''\
-<html>
-  <head><title>%s</title></head>
-  <style type="text/css">
-      * {
-        font-family: verdana,sans-serif;
-      }
-      body {
-        width: 50em;
-        margin: 1em;
-      }
-      div {
-        padding: .5em;
-      }
-      table {
-        margin: none;
-        padding: none;
-      }
-      .alert {
-        border: 1px solid #e7dc2b;
-        background: #fff888;
-      }
-      .error {
-        border: 1px solid #ff0000;
-        background: #ffaaaa;
-      }
-      #verify-form {
-        border: 1px solid #777777;
-        background: #dddddd;
-        margin-top: 1em;
-        padding-bottom: 0em;
-      }
-  </style>
-  <body>
-    <h1>%s</h1>
-    <p>
-      This example consumer uses the <a
-      href="http://openid.schtuff.com/">Python OpenID</a> library. It
-      just verifies that the URL that you enter is your identity URL.
-    </p>
-''' % (title, title))
-
-    def page_footer(self, request, form_contents):
-        """Render the page footer"""
-        if not form_contents:
-            form_contents = ''
-
-        request['body'].append('''\
-    <div id="verify-form">
-      <form method="get" action=%s>
-        Identity&nbsp;URL:
-        <input type="text" name="openid_url" value=%s />
-        <input type="submit" value="Verify" />
-      </form>
-    </div>
-  </body>
-</html>
-''' % (quoteattr(self.build_url(request, 'verify')), quoteattr(form_contents)))
-
-
-middleware = AuthOpenIDHandler
-
-def make_open_id_middleware(
-    app,
-    global_conf,
-    # Should this default to something, or inherit something from global_conf?:
-    data_store_path,
-    auth_prefix='/oid',
-    login_redirect=None,
-    catch_401=False,
-    url_to_username=None,
-    apply_auth_tkt=False,
-    auth_tkt_logout_path=None):
-    from paste.deploy.converters import asbool
-    from paste.util import import_string
-    catch_401 = asbool(catch_401)
-    if url_to_username and isinstance(url_to_username, basestring):
-        url_to_username = import_string.eval_import(url_to_username)
-    apply_auth_tkt = asbool(apply_auth_tkt)
-    new_app = AuthOpenIDHandler(
-        app, data_store_path=data_store_path, auth_prefix=auth_prefix,
-        login_redirect=login_redirect, catch_401=catch_401,
-        url_to_username=url_to_username or None)
-    if apply_auth_tkt:
-        from paste.auth import auth_tkt
-        new_app = auth_tkt.make_auth_tkt_middleware(
-            new_app, global_conf, logout_path=auth_tkt_logout_path)
-    return new_app

+ 0 - 133
desktop/core/ext-py/Paste-1.7.2/paste/cascade.py

@@ -1,133 +0,0 @@
-# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
-# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
-
-"""
-Cascades through several applications, so long as applications
-return ``404 Not Found``.
-"""
-from paste import httpexceptions
-from paste.util import converters
-import tempfile
-from cStringIO import StringIO
-
-__all__ = ['Cascade']
-
-def make_cascade(loader, global_conf, catch='404', **local_conf):
-    """
-    Entry point for Paste Deploy configuration
-    
-    Expects configuration like::
-
-        [composit:cascade]
-        use = egg:Paste#cascade
-        # all start with 'app' and are sorted alphabetically
-        app1 = foo
-        app2 = bar
-        ...
-        catch = 404 500 ...
-    """
-    catch = map(int, converters.aslist(catch))
-    apps = []
-    for name, value in local_conf.items():
-        if not name.startswith('app'):
-            raise ValueError(
-                "Bad configuration key %r (=%r); all configuration keys "
-                "must start with 'app'"
-                % (name, value))
-        app = loader.get_app(value, global_conf=global_conf)
-        apps.append((name, app))
-    apps.sort()
-    apps = [app for name, app in apps]
-    return Cascade(apps, catch=catch)
-    
-class Cascade(object):
-
-    """
-    Passed a list of applications, ``Cascade`` will try each of them
-    in turn.  If one returns a status code listed in ``catch`` (by
-    default just ``404 Not Found``) then the next application is
-    tried.
-
-    If all applications fail, then the last application's failure
-    response is used.
-
-    Instances of this class are WSGI applications.
-    """
-
-    def __init__(self, applications, catch=(404,)):
-        self.apps = applications
-        self.catch_codes = {}
-        self.catch_exceptions = []
-        for error in catch:
-            if isinstance(error, str):
-                error = int(error.split(None, 1)[0])
-            if isinstance(error, httpexceptions.HTTPException):
-                exc = error
-                code = error.code
-            else:
-                exc = httpexceptions.get_exception(error)
-                code = error
-            self.catch_codes[code] = exc
-            self.catch_exceptions.append(exc)
-        self.catch_exceptions = tuple(self.catch_exceptions)
-                
-    def __call__(self, environ, start_response):
-        """
-        WSGI application interface
-        """
-        failed = []
-        def repl_start_response(status, headers, exc_info=None):
-            code = int(status.split(None, 1)[0])
-            if code in self.catch_codes:
-                failed.append(None)
-                return _consuming_writer
-            return start_response(status, headers, exc_info)
-
-        try:
-            length = int(environ.get('CONTENT_LENGTH', 0) or 0)
-        except ValueError:
-            length = 0
-        if length > 0:
-            # We have to copy wsgi.input
-            copy_wsgi_input = True
-            if length > 4096 or length < 0:
-                f = tempfile.TemporaryFile()
-                if length < 0:
-                    f.write(environ['wsgi.input'].read())
-                else:
-                    copy_len = length
-                    while copy_len > 0:
-                        chunk = environ['wsgi.input'].read(min(copy_len, 4096))
-                        if not chunk:
-                            raise IOError("Request body truncated")
-                        f.write(chunk)
-                        copy_len -= len(chunk)
-                f.seek(0)
-            else:
-                f = StringIO(environ['wsgi.input'].read(length))
-            environ['wsgi.input'] = f
-        else:
-            copy_wsgi_input = False
-        for app in self.apps[:-1]:
-            environ_copy = environ.copy()
-            if copy_wsgi_input:
-                environ_copy['wsgi.input'].seek(0)
-            failed = []
-            try:
-                v = app(environ_copy, repl_start_response)
-                if not failed:
-                    return v
-                else:
-                    if hasattr(v, 'close'):
-                        # Exhaust the iterator first:
-                        list(v)
-                        # then close:
-                        v.close()
-            except self.catch_exceptions, e:
-                pass
-        if copy_wsgi_input:
-            environ['wsgi.input'].seek(0)
-        return self.apps[-1](environ, start_response)
-
-def _consuming_writer(s):
-    pass

+ 0 - 271
desktop/core/ext-py/Paste-1.7.2/paste/cgiapp.py

@@ -1,271 +0,0 @@
-# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
-# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
-
-"""
-Application that runs a CGI script.
-"""
-import os
-import subprocess
-try:
-    import select
-except ImportError:
-    select = None
-
-from paste.util import converters
-
-__all__ = ['CGIError', 'CGIApplication']
-
-class CGIError(Exception):
-    """
-    Raised when the CGI script can't be found or doesn't
-    act like a proper CGI script.
-    """
-
-class CGIApplication(object):
-
-    """
-    This object acts as a proxy to a CGI application.  You pass in the
-    script path (``script``), an optional path to search for the
-    script (if the name isn't absolute) (``path``).  If you don't give
-    a path, then ``$PATH`` will be used.
-    """
-
-    def __init__(self, 
-                 global_conf,
-                 script,
-                 path=None,
-                 include_os_environ=True,
-                 query_string=None):
-        if global_conf:
-            raise NotImplemented(
-                "global_conf is no longer supported for CGIApplication "
-                "(use make_cgi_application); please pass None instead")
-        self.script_filename = script
-        if path is None:
-            path = os.environ.get('PATH', '').split(':')
-        self.path = path
-        if '?' in script:
-            assert query_string is None, (
-                "You cannot have '?' in your script name (%r) and also "
-                "give a query_string (%r)" % (script, query_string))
-            script, query_string = script.split('?', 1)
-        if os.path.abspath(script) != script:
-            # relative path
-            for path_dir in self.path:
-                if os.path.exists(os.path.join(path_dir, script)):
-                    self.script = os.path.join(path_dir, script)
-                    break
-            else:
-                raise CGIError(
-                    "Script %r not found in path %r"
-                    % (script, self.path))
-        else:
-            self.script = script
-        self.include_os_environ = include_os_environ
-        self.query_string = query_string
-
-    def __call__(self, environ, start_response):
-        if 'REQUEST_URI' not in environ:
-            environ['REQUEST_URI'] = (
-                environ.get('SCRIPT_NAME', '')
-                + environ.get('PATH_INFO', ''))
-        if self.include_os_environ:
-            cgi_environ = os.environ.copy()
-        else:
-            cgi_environ = {}
-        for name in environ:
-            # Should unicode values be encoded?
-            if (name.upper() == name
-                and isinstance(environ[name], str)):
-                cgi_environ[name] = environ[name]
-        if self.query_string is not None:
-            old = cgi_environ.get('QUERY_STRING', '')
-            if old:
-                old += '&'
-            cgi_environ['QUERY_STRING'] = old + self.query_string
-        cgi_environ['SCRIPT_FILENAME'] = self.script
-        proc = subprocess.Popen(
-            [self.script],
-            stdin=subprocess.PIPE,
-            stdout=subprocess.PIPE,
-            stderr=subprocess.PIPE,
-            env=cgi_environ,
-            cwd=os.path.dirname(self.script),
-            )
-        writer = CGIWriter(environ, start_response)
-        if select:
-            proc_communicate(
-                proc,
-                stdin=StdinReader.from_environ(environ),
-                stdout=writer,
-                stderr=environ['wsgi.errors'])
-        else:
-            stdout, stderr = proc.communicate(StdinReader.from_environ(environ).read())
-            if stderr:
-                environ['wsgi.errors'].write(stderr)
-            writer(stdout)
-        if not writer.headers_finished:
-            start_response(writer.status, writer.headers)
-        return []
-
-class CGIWriter(object):
-
-    def __init__(self, environ, start_response):
-        self.environ = environ
-        self.start_response = start_response
-        self.status = '200 OK'
-        self.headers = []
-        self.headers_finished = False
-        self.writer = None
-        self.buffer = ''
-
-    def write(self, data):
-        if self.headers_finished:
-            self.writer(data)
-            return
-        self.buffer += data
-        while '\n' in self.buffer:
-            if '\r\n' in self.buffer:
-                line1, self.buffer = self.buffer.split('\r\n', 1)
-            else:
-                line1, self.buffer = self.buffer.split('\n', 1)
-            if not line1:
-                self.headers_finished = True
-                self.writer = self.start_response(
-                    self.status, self.headers)
-                self.writer(self.buffer)
-                del self.buffer
-                del self.headers
-                del self.status
-                break
-            elif ':' not in line1:
-                raise CGIError(
-                    "Bad header line: %r" % line1)
-            else:
-                name, value = line1.split(':', 1)
-                value = value.lstrip()
-                name = name.strip()
-                if name.lower() == 'status':
-                    self.status = value
-                else:
-                    self.headers.append((name, value))
-
-class StdinReader(object):
-
-    def __init__(self, stdin, content_length):
-        self.stdin = stdin
-        self.content_length = content_length
-
-    def from_environ(cls, environ):
-        length = environ.get('CONTENT_LENGTH')
-        if length:
-            length = int(length)
-        else:
-            length = 0
-        return cls(environ['wsgi.input'], length)
-
-    from_environ = classmethod(from_environ)
-
-    def read(self, size=None):
-        if not self.content_length:
-            return ''
-        if size is None:
-            text = self.stdin.read(self.content_length)
-        else:
-            text = self.stdin.read(min(self.content_length, size))
-        self.content_length -= len(text)
-        return text
-
-def proc_communicate(proc, stdin=None, stdout=None, stderr=None):
-    """
-    Run the given process, piping input/output/errors to the given
-    file-like objects (which need not be actual file objects, unlike
-    the arguments passed to Popen).  Wait for process to terminate.
-
-    Note: this is taken from the posix version of
-    subprocess.Popen.communicate, but made more general through the
-    use of file-like objects.
-    """
-    read_set = []
-    write_set = []
-    input_buffer = ''
-    trans_nl = proc.universal_newlines and hasattr(open, 'newlines')
-
-    if proc.stdin:
-        # Flush stdio buffer.  This might block, if the user has
-        # been writing to .stdin in an uncontrolled fashion.
-        proc.stdin.flush()
-        if input:
-            write_set.append(proc.stdin)
-        else:
-            proc.stdin.close()
-    else:
-        assert stdin is None
-    if proc.stdout:
-        read_set.append(proc.stdout)
-    else:
-        assert stdout is None
-    if proc.stderr:
-        read_set.append(proc.stderr)
-    else:
-        assert stderr is None
-
-    while read_set or write_set:
-        rlist, wlist, xlist = select.select(read_set, write_set, [])
-
-        if proc.stdin in wlist:
-            # When select has indicated that the file is writable,
-            # we can write up to PIPE_BUF bytes without risk
-            # blocking.  POSIX defines PIPE_BUF >= 512
-            next, input_buffer = input_buffer, ''
-            next_len = 512-len(next)
-            if next_len:
-                next += stdin.read(next_len)
-            if not next:
-                proc.stdin.close()
-                write_set.remove(proc.stdin)
-            else:
-                bytes_written = os.write(proc.stdin.fileno(), next)
-                if bytes_written < len(next):
-                    input_buffer = next[bytes_written:]
-
-        if proc.stdout in rlist:
-            data = os.read(proc.stdout.fileno(), 1024)
-            if data == "":
-                proc.stdout.close()
-                read_set.remove(proc.stdout)
-            if trans_nl:
-                data = proc._translate_newlines(data)
-            stdout.write(data)
-
-        if proc.stderr in rlist:
-            data = os.read(proc.stderr.fileno(), 1024)
-            if data == "":
-                proc.stderr.close()
-                read_set.remove(proc.stderr)
-            if trans_nl:
-                data = proc._translate_newlines(data)
-            stderr.write(data)
-
-    try:
-        proc.wait()
-    except OSError, e:
-        if e.errno != 10:
-            raise
-    
-def make_cgi_application(global_conf, script, path=None, include_os_environ=None,
-                         query_string=None):
-    """
-    Paste Deploy interface for :class:`CGIApplication`
-    
-    This object acts as a proxy to a CGI application.  You pass in the
-    script path (``script``), an optional path to search for the
-    script (if the name isn't absolute) (``path``).  If you don't give
-    a path, then ``$PATH`` will be used.
-    """
-    if path is None:
-        path = global_conf.get('path') or global_conf.get('PATH')
-    include_os_environ = converters.asbool(include_os_environ)
-    return CGIApplication(
-        script, path=path, include_os_environ=include_os_environ,
-        query_string=query_string)

+ 0 - 116
desktop/core/ext-py/Paste-1.7.2/paste/cgitb_catcher.py

@@ -1,116 +0,0 @@
-# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
-# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
-
-"""
-WSGI middleware
-
-Captures any exceptions and prints a pretty report.  See the `cgitb
-documentation <http://python.org/doc/current/lib/module-cgitb.html>`_
-for more.
-"""
-
-import cgitb
-from cStringIO import StringIO
-import sys
-
-from paste.util import converters
-
-class NoDefault(object):
-    pass
-
-class CgitbMiddleware(object):
-
-    def __init__(self, app,
-                 global_conf=None,
-                 display=NoDefault,
-                 logdir=None,
-                 context=5,
-                 format="html"):
-        self.app = app
-        if global_conf is None:
-            global_conf = {}
-        if display is NoDefault:
-            display = global_conf.get('debug')
-        if isinstance(display, basestring):
-            display = converters.asbool(display)
-        self.display = display
-        self.logdir = logdir
-        self.context = int(context)
-        self.format = format
-
-    def __call__(self, environ, start_response):
-        try:
-            app_iter = self.app(environ, start_response)
-            return self.catching_iter(app_iter, environ)
-        except:
-            exc_info = sys.exc_info()
-            start_response('500 Internal Server Error',
-                           [('content-type', 'text/html')],
-                           exc_info)
-            response = self.exception_handler(exc_info, environ)
-            return [response]
-
-    def catching_iter(self, app_iter, environ):
-        if not app_iter:
-            raise StopIteration
-        error_on_close = False
-        try:
-            for v in app_iter:
-                yield v
-            if hasattr(app_iter, 'close'):
-                error_on_close = True
-                app_iter.close()
-        except:
-            response = self.exception_handler(sys.exc_info(), environ)
-            if not error_on_close and hasattr(app_iter, 'close'):
-                try:
-                    app_iter.close()
-                except:
-                    close_response = self.exception_handler(
-                        sys.exc_info(), environ)
-                    response += (
-                        '<hr noshade>Error in .close():<br>%s'
-                        % close_response)
-            yield response
-
-    def exception_handler(self, exc_info, environ):
-        dummy_file = StringIO()
-        hook = cgitb.Hook(file=dummy_file,
-                          display=self.display,
-                          logdir=self.logdir,
-                          context=self.context,
-                          format=self.format)
-        hook(*exc_info)
-        return dummy_file.getvalue()
-        
-def make_cgitb_middleware(app, global_conf,
-                          display=NoDefault,
-                          logdir=None,
-                          context=5,
-                          format='html'):
-    """
-    Wraps the application in the ``cgitb`` (standard library)
-    error catcher.
-        
-      display:
-        If true (or debug is set in the global configuration)
-        then the traceback will be displayed in the browser
-
-      logdir:
-        Writes logs of all errors in that directory
-
-      context:
-        Number of lines of context to show around each line of
-        source code
-    """
-    from paste.deploy.converters import asbool
-    if display is not NoDefault:
-        display = asbool(display)
-    if 'debug' in global_conf:
-        global_conf['debug'] = asbool(global_conf['debug'])
-    return CgitbMiddleware(
-        app, global_conf=global_conf,
-        display=display,
-        logdir=logdir,
-        context=context,
-        format=format)

+ 0 - 120
desktop/core/ext-py/Paste-1.7.2/paste/config.py

@@ -1,120 +0,0 @@
-# (c) 2006 Ian Bicking, Philip Jenvey and contributors
-# Written for Paste (http://pythonpaste.org)
-# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
-"""Paste Configuration Middleware and Objects"""
-from paste.registry import RegistryManager, StackedObjectProxy
-
-__all__ = ['DispatchingConfig', 'CONFIG', 'ConfigMiddleware']
-
-class DispatchingConfig(StackedObjectProxy):
-    """
-    This is a configuration object that can be used globally,
-    imported, have references held onto.  The configuration may differ
-    by thread (or may not).
-
-    Specific configurations are registered (and deregistered) either
-    for the process or for threads.
-    """
-    # @@: What should happen when someone tries to add this
-    # configuration to itself?  Probably the conf should become
-    # resolved, and get rid of this delegation wrapper
-
-    def __init__(self, name='DispatchingConfig'):
-        super(DispatchingConfig, self).__init__(name=name)
-        self.__dict__['_process_configs'] = []
-
-    def push_thread_config(self, conf):
-        """
-        Make ``conf`` the active configuration for this thread.
-        Thread-local configuration always overrides process-wide
-        configuration.
-
-        This should be used like::
-
-            conf = make_conf()
-            dispatching_config.push_thread_config(conf)
-            try:
-                ... do stuff ...
-            finally:
-                dispatching_config.pop_thread_config(conf)
-        """
-        self._push_object(conf)
-
-    def pop_thread_config(self, conf=None):
-        """
-        Remove a thread-local configuration.  If ``conf`` is given,
-        it is checked against the popped configuration and an error
-        is emitted if they don't match.
-        """
-        self._pop_object(conf)
-
-    def push_process_config(self, conf):
-        """
-        Like push_thread_config, but applies the configuration to
-        the entire process.
-        """
-        self._process_configs.append(conf)
-
-    def pop_process_config(self, conf=None):
-        self._pop_from(self._process_configs, conf)
-
-    def _pop_from(self, lst, conf):
-        popped = lst.pop()
-        if conf is not None and popped is not conf:
-            raise AssertionError(
-                "The config popped (%s) is not the same as the config "
-                "expected (%s)"
-                % (popped, conf))
-
-    def _current_obj(self):
-        try:
-            return super(DispatchingConfig, self)._current_obj()
-        except TypeError:
-            if self._process_configs:
-                return self._process_configs[-1]
-            raise AttributeError(
-                "No configuration has been registered for this process "
-                "or thread")
-    current = current_conf = _current_obj
-
-CONFIG = DispatchingConfig()
-
-no_config = object()
-class ConfigMiddleware(RegistryManager):
-    """
-    A WSGI middleware that adds a ``paste.config`` key (by default)
-    to the request environment, as well as registering the
-    configuration temporarily (for the length of the request) with
-    ``paste.config.CONFIG`` (or any other ``DispatchingConfig``
-    object).
-    """
-
-    def __init__(self, application, config, dispatching_config=CONFIG,
-                 environ_key='paste.config'):
-        """
-        This delegates all requests to `application`, adding a *copy*
-        of the configuration `config`.
-        """
-        def register_config(environ, start_response):
-            popped_config = environ.get(environ_key, no_config)
-            current_config = environ[environ_key] = config.copy()
-            environ['paste.registry'].register(dispatching_config,
-                                               current_config)
-
-            try:
-                app_iter = application(environ, start_response)
-            finally:
-                if popped_config is no_config:
-                    environ.pop(environ_key, None)
-                else:
-                    environ[environ_key] = popped_config
-            return app_iter
-
-        super(self.__class__, self).__init__(register_config)
-
-def make_config_filter(app, global_conf, **local_conf):
-    conf = global_conf.copy()
-    conf.update(local_conf)
-    return ConfigMiddleware(app, conf)
-
-make_config_middleware = ConfigMiddleware.__doc__

+ 0 - 5
desktop/core/ext-py/Paste-1.7.2/paste/debug/__init__.py

@@ -1,5 +0,0 @@
-# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
-# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
-"""
-Package for debugging and development tools
-"""

+ 0 - 79
desktop/core/ext-py/Paste-1.7.2/paste/debug/debugapp.py

@@ -1,79 +0,0 @@
-# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
-# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
-# (c) 2005 Clark C. Evans
-# This module is part of the Python Paste Project and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
-# This code was written with funding by http://prometheusresearch.com
-"""
-Various Applications for Debugging/Testing Purposes
-"""
-
-import time
-__all__ = ['SimpleApplication', 'SlowConsumer']
-
-
-class SimpleApplication(object):
-    """
-    Produces a simple web page
-    """
-    def __call__(self, environ, start_response):
-        body = "<html><body>simple</body></html>"
-        start_response("200 OK", [('Content-Type', 'text/html'),
-                                  ('Content-Length', str(len(body)))])
-        return [body]
-
-class SlowConsumer(object):
-    """
-    Consumes an upload slowly...
-
-    NOTE: This should use the iterator form of ``wsgi.input``,
-          but it isn't implemented in paste.httpserver.
-    """
-    def __init__(self, chunk_size = 4096, delay = 1, progress = True):
-        self.chunk_size = chunk_size
-        self.delay = delay
-        self.progress = True
-
-    def __call__(self, environ, start_response):
-        size = 0
-        total  = environ.get('CONTENT_LENGTH')
-        if total:
-            remaining = int(total)
-            while remaining > 0:
-                if self.progress:
-                    print "%s of %s remaining" % (remaining, total)
-                if remaining > 4096:
-                    chunk = environ['wsgi.input'].read(4096)
-                else:
-                    chunk = environ['wsgi.input'].read(remaining)
-                if not chunk:
-                    break
-                size += len(chunk)
-                remaining -= len(chunk)
-                if self.delay:
-                    time.sleep(self.delay)
-            body = "<html><body>%d bytes</body></html>" % size
-        else:
-            body = ('<html><body>\n'
-                '<form method="post" enctype="multipart/form-data">\n'
-                '<input type="file" name="file">\n'
-                '<input type="submit" >\n'
-                '</form></body></html>\n')
-        print "bingles"
-        start_response("200 OK", [('Content-Type', 'text/html'),
-                                  ('Content-Length', len(body))])
-        return [body]
-
-def make_test_app(global_conf):
-    return SimpleApplication()
-
-make_test_app.__doc__ = SimpleApplication.__doc__
-
-def make_slow_app(global_conf, chunk_size=4096, delay=1, progress=True):
-    from paste.deploy.converters import asbool
-    return SlowConsumer(
-        chunk_size=int(chunk_size),
-        delay=int(delay),
-        progress=asbool(progress))
-
-make_slow_app.__doc__ = SlowConsumer.__doc__

+ 0 - 435
desktop/core/ext-py/Paste-1.7.2/paste/debug/doctest_webapp.py

@@ -1,435 +0,0 @@
-# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
-# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
-#!/usr/bin/env python2.4
-# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
-# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
-
-"""
-These are functions for use when doctest-testing a document.
-"""
-
-try:
-    import subprocess
-except ImportError:
-    from paste.util import subprocess24 as subprocess
-import doctest
-import os
-import sys
-import shutil
-import re
-import cgi
-import rfc822
-from cStringIO import StringIO
-from paste.util import PySourceColor
-
-
-here = os.path.abspath(__file__)
-paste_parent = os.path.dirname(
-    os.path.dirname(os.path.dirname(here)))
-
-def run(command):
-    data = run_raw(command)
-    if data:
-        print data
-
-def run_raw(command):
-    """
-    Runs the string command, returns any output.
-    """
-    proc = subprocess.Popen(command, shell=True,
-                            stderr=subprocess.STDOUT,
-                            stdout=subprocess.PIPE, env=_make_env())
-    data = proc.stdout.read()
-    proc.wait()
-    while data.endswith('\n') or data.endswith('\r'):
-        data = data[:-1]
-    if data:
-        data = '\n'.join(
-            [l for l in data.splitlines() if l])
-        return data
-    else:
-        return ''
-
-def run_command(command, name, and_print=False):
-    output = run_raw(command)
-    data = '$ %s\n%s' % (command, output)
-    show_file('shell-command', name, description='shell transcript',
-              data=data)
-    if and_print and output:
-        print output
-
-def _make_env():
-    env = os.environ.copy()
-    env['PATH'] = (env.get('PATH', '')
-                   + ':'
-                   + os.path.join(paste_parent, 'scripts')
-                   + ':'
-                   + os.path.join(paste_parent, 'paste', '3rd-party',
-                                  'sqlobject-files', 'scripts'))
-    env['PYTHONPATH'] = (env.get('PYTHONPATH', '')
-                         + ':'
-                         + paste_parent)
-    return env
-
-def clear_dir(dir):
-    """
-    Clears (deletes) the given directory
-    """
-    shutil.rmtree(dir, True)
-
-def ls(dir=None, recurse=False, indent=0):
-    """
-    Show a directory listing
-    """
-    dir = dir or os.getcwd()
-    fns = os.listdir(dir)
-    fns.sort()
-    for fn in fns:
-        full = os.path.join(dir, fn)
-        if os.path.isdir(full):
-            fn = fn + '/'
-        print ' '*indent + fn
-        if os.path.isdir(full) and recurse:
-            ls(dir=full, recurse=True, indent=indent+2)
-
-default_app = None
-default_url = None
-
-def set_default_app(app, url):
-    global default_app
-    global default_url
-    default_app = app
-    default_url = url
-
-def resource_filename(fn):
-    """
-    Returns the filename of the resource -- generally in the directory
-    resources/DocumentName/fn
-    """
-    return os.path.join(
-        os.path.dirname(sys.testing_document_filename),
-        'resources',
-        os.path.splitext(os.path.basename(sys.testing_document_filename))[0],
-        fn)
-
-def show(path_info, example_name):
-    fn = resource_filename(example_name + '.html')
-    out = StringIO()
-    assert default_app is not None, (
-        "No default_app set")
-    url = default_url + path_info
-    out.write('<span class="doctest-url"><a href="%s">%s</a></span><br>\n'
-              % (url, url))
-    out.write('<div class="doctest-example">\n')
-    proc = subprocess.Popen(
-        ['paster', 'serve' '--server=console', '--no-verbose',
-         '--url=' + path_info],
-        stderr=subprocess.PIPE,
-        stdout=subprocess.PIPE,
-        env=_make_env())
-    stdout, errors = proc.communicate()
-    stdout = StringIO(stdout)
-    headers = rfc822.Message(stdout)
-    content = stdout.read()
-    for header, value in headers.items():
-        if header.lower() == 'status' and int(value.split()[0]) == 200:
-            continue
-        if header.lower() in ('content-type', 'content-length'):
-            continue
-        if (header.lower() == 'set-cookie'
-            and value.startswith('_SID_')):
-            continue
-        out.write('<span class="doctest-header">%s: %s</span><br>\n'
-                  % (header, value))
-    lines = [l for l in content.splitlines() if l.strip()]
-    for line in lines:
-        out.write(line + '\n')
-    if errors:
-        out.write('<pre class="doctest-errors">%s</pre>'
-                  % errors)
-    out.write('</div>\n')
-    result = out.getvalue()
-    if not os.path.exists(fn):
-        f = open(fn, 'wb')
-        f.write(result)
-        f.close()
-    else:
-        f = open(fn, 'rb')
-        expected = f.read()
-        f.close()
-        if not html_matches(expected, result):
-            print 'Pages did not match.  Expected from %s:' % fn
-            print '-'*60
-            print expected
-            print '='*60
-            print 'Actual output:'
-            print '-'*60
-            print result
-
-def html_matches(pattern, text):
-    regex = re.escape(pattern)
-    regex = regex.replace(r'\.\.\.', '.*')
-    regex = re.sub(r'0x[0-9a-f]+', '.*', regex)
-    regex = '^%s$' % regex
-    return re.search(regex, text)
-
-def convert_docstring_string(data):
-    if data.startswith('\n'):
-        data = data[1:]
-    lines = data.splitlines()
-    new_lines = []
-    for line in lines:
-        if line.rstrip() == '.':
-            new_lines.append('')
-        else:
-            new_lines.append(line)
-    data = '\n'.join(new_lines) + '\n'
-    return data
-
-def create_file(path, version, data):
-    data = convert_docstring_string(data)
-    write_data(path, data)
-    show_file(path, version)
-
-def append_to_file(path, version, data):
-    data = convert_docstring_string(data)
-    f = open(path, 'a')
-    f.write(data)
-    f.close()
-    # I think these appends can happen so quickly (in less than a second)
-    # that the .pyc file doesn't appear to be expired, even though it
-    # is after we've made this change; so we have to get rid of the .pyc
-    # file:
-    if path.endswith('.py'):
-        pyc_file = path + 'c'
-        if os.path.exists(pyc_file):
-            os.unlink(pyc_file)
-    show_file(path, version, description='added to %s' % path,
-              data=data)
-
-def show_file(path, version, description=None, data=None):
-    ext = os.path.splitext(path)[1]
-    if data is None:
-        f = open(path, 'rb')
-        data = f.read()
-        f.close()
-    if ext == '.py':
-        html = ('<div class="source-code">%s</div>' 
-                % PySourceColor.str2html(data, PySourceColor.dark))
-    else:
-        html = '<pre class="source-code">%s</pre>' % cgi.escape(data, 1)
-    html = '<span class="source-filename">%s</span><br>%s' % (
-        description or path, html)
-    write_data(resource_filename('%s.%s.gen.html' % (path, version)),
-               html)
-
-def call_source_highlight(input, format):
-    proc = subprocess.Popen(['source-highlight', '--out-format=html',
-                             '--no-doc', '--css=none',
-                             '--src-lang=%s' % format], shell=False,
-                            stdout=subprocess.PIPE)
-    stdout, stderr = proc.communicate(input)
-    result = stdout
-    proc.wait()
-    return result
-
-
-def write_data(path, data):
-    dir = os.path.dirname(os.path.abspath(path))
-    if not os.path.exists(dir):
-        os.makedirs(dir)
-    f = open(path, 'wb')
-    f.write(data)
-    f.close()
-    
-
-def change_file(path, changes):
-    f = open(os.path.abspath(path), 'rb')
-    lines = f.readlines()
-    f.close()
-    for change_type, line, text in changes:
-        if change_type == 'insert':
-            lines[line:line] = [text]
-        elif change_type == 'delete':
-            lines[line:text] = []
-        else:
-            assert 0, (
-                "Unknown change_type: %r" % change_type)
-    f = open(path, 'wb')
-    f.write(''.join(lines))
-    f.close()
-
-class LongFormDocTestParser(doctest.DocTestParser):
-
-    """
-    This parser recognizes some reST comments as commands, without
-    prompts or expected output, like:
-
-    .. run:
-
-        do_this(...
-        ...)
-    """
-
-    _EXAMPLE_RE = re.compile(r"""
-        # Source consists of a PS1 line followed by zero or more PS2 lines.
-        (?: (?P<source>
-                (?:^(?P<indent> [ ]*) >>>    .*)    # PS1 line
-                (?:\n           [ ]*  \.\.\. .*)*)  # PS2 lines
-            \n?
-            # Want consists of any non-blank lines that do not start with PS1.
-            (?P<want> (?:(?![ ]*$)    # Not a blank line
-                         (?![ ]*>>>)  # Not a line starting with PS1
-                         .*$\n?       # But any other line
-                      )*))
-        | 
-        (?: # This is for longer commands that are prefixed with a reST
-            # comment like '.. run:' (two colons makes that a directive).
-            # These commands cannot have any output.
-
-            (?:^\.\.[ ]*(?P<run>run):[ ]*\n) # Leading command/command
-            (?:[ ]*\n)?         # Blank line following
-            (?P<runsource>
-                (?:(?P<runindent> [ ]+)[^ ].*$)
-                (?:\n [ ]+ .*)*)
-            )
-        |
-        (?: # This is for shell commands
-
-            (?P<shellsource>
-                (?:^(P<shellindent> [ ]*) [$] .*)   # Shell line
-                (?:\n               [ ]*  [>] .*)*) # Continuation
-            \n?
-            # Want consists of any non-blank lines that do not start with $
-            (?P<shellwant> (?:(?![ ]*$)
-                              (?![ ]*[$]$)
-                              .*$\n?
-                           )*))
-        """, re.MULTILINE | re.VERBOSE)
-
-    def _parse_example(self, m, name, lineno):
-        r"""
-        Given a regular expression match from `_EXAMPLE_RE` (`m`),
-        return a pair `(source, want)`, where `source` is the matched
-        example's source code (with prompts and indentation stripped);
-        and `want` is the example's expected output (with indentation
-        stripped).
-
-        `name` is the string's name, and `lineno` is the line number
-        where the example starts; both are used for error messages.
-
-        >>> def parseit(s):
-        ...     p = LongFormDocTestParser()
-        ...     return p._parse_example(p._EXAMPLE_RE.search(s), '<string>', 1)
-        >>> parseit('>>> 1\n1')
-        ('1', {}, '1', None)
-        >>> parseit('>>> (1\n... +1)\n2')
-        ('(1\n+1)', {}, '2', None)
-        >>> parseit('.. run:\n\n    test1\n    test2\n')
-        ('test1\ntest2', {}, '', None)
-        """
-        # Get the example's indentation level.
-        runner = m.group('run') or ''
-        indent = len(m.group('%sindent' % runner))
-        
-        # Divide source into lines; check that they're properly
-        # indented; and then strip their indentation & prompts.
-        source_lines = m.group('%ssource' % runner).split('\n')
-        if runner:
-            self._check_prefix(source_lines[1:], ' '*indent, name, lineno)
-        else:
-            self._check_prompt_blank(source_lines, indent, name, lineno)
-            self._check_prefix(source_lines[2:], ' '*indent + '.', name, lineno)
-        if runner:
-            source = '\n'.join([sl[indent:] for sl in source_lines])
-        else:
-            source = '\n'.join([sl[indent+4:] for sl in source_lines])
-
-        if runner:
-            want = ''
-            exc_msg = None
-        else:
-            # Divide want into lines; check that it's properly indented; and
-            # then strip the indentation.  Spaces before the last newline should
-            # be preserved, so plain rstrip() isn't good enough.
-            want = m.group('want')
-            want_lines = want.split('\n')
-            if len(want_lines) > 1 and re.match(r' *$', want_lines[-1]):
-                del want_lines[-1]  # forget final newline & spaces after it
-            self._check_prefix(want_lines, ' '*indent, name,
-                               lineno + len(source_lines))
-            want = '\n'.join([wl[indent:] for wl in want_lines])
-
-            # If `want` contains a traceback message, then extract it.
-            m = self._EXCEPTION_RE.match(want)
-            if m:
-                exc_msg = m.group('msg')
-            else:
-                exc_msg = None
-
-        # Extract options from the source.
-        options = self._find_options(source, name, lineno)
-
-        return source, options, want, exc_msg
-
-
-    def parse(self, string, name='<string>'):
-        """
-        Divide the given string into examples and intervening text,
-        and return them as a list of alternating Examples and strings.
-        Line numbers for the Examples are 0-based.  The optional
-        argument `name` is a name identifying this string, and is only
-        used for error messages.
-        """
-        string = string.expandtabs()
-        # If all lines begin with the same indentation, then strip it.
-        min_indent = self._min_indent(string)
-        if min_indent > 0:
-            string = '\n'.join([l[min_indent:] for l in string.split('\n')])
-
-        output = []
-        charno, lineno = 0, 0
-        # Find all doctest examples in the string:
-        for m in self._EXAMPLE_RE.finditer(string):
-            # Add the pre-example text to `output`.
-            output.append(string[charno:m.start()])
-            # Update lineno (lines before this example)
-            lineno += string.count('\n', charno, m.start())
-            # Extract info from the regexp match.
-            (source, options, want, exc_msg) = \
-                     self._parse_example(m, name, lineno)
-            # Create an Example, and add it to the list.
-            if not self._IS_BLANK_OR_COMMENT(source):
-                # @@: Erg, this is the only line I need to change...
-                output.append(doctest.Example(
-                    source, want, exc_msg,
-                    lineno=lineno,
-                    indent=min_indent+len(m.group('indent') or m.group('runindent')),
-                    options=options))
-            # Update lineno (lines inside this example)
-            lineno += string.count('\n', m.start(), m.end())
-            # Update charno.
-            charno = m.end()
-        # Add any remaining post-example text to `output`.
-        output.append(string[charno:])
-        return output
-
-
-
-if __name__ == '__main__':
-    if sys.argv[1:] and sys.argv[1] == 'doctest':
-        doctest.testmod()
-        sys.exit()
-    if not paste_parent in sys.path:
-        sys.path.append(paste_parent)
-    for fn in sys.argv[1:]:
-        fn = os.path.abspath(fn)
-        # @@: OK, ick; but this module gets loaded twice
-        sys.testing_document_filename = fn
-        doctest.testfile(
-            fn, module_relative=False,
-            optionflags=doctest.ELLIPSIS|doctest.REPORT_ONLY_FIRST_FAILURE,
-            parser=LongFormDocTestParser())
-        new = os.path.splitext(fn)[0] + '.html'
-        assert new != fn
-        os.system('rst2html.py %s > %s' % (fn, new))

+ 0 - 409
desktop/core/ext-py/Paste-1.7.2/paste/debug/fsdiff.py

@@ -1,409 +0,0 @@
-# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
-# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
-"""
-Module to find differences over time in a filesystem
-
-Basically this takes a snapshot of a directory, then sees what changes
-were made.  The contents of the files are not checked, so you can
-detect that the content was changed, but not what the old version of
-the file was.
-"""
-
-import os
-from fnmatch import fnmatch
-from datetime import datetime
-from paste.util.UserDict24 import IterableUserDict
-import operator
-import re
-
-__all__ = ['Diff', 'Snapshot', 'File', 'Dir', 'report_expected_diffs',
-           'show_diff']
-
-class Diff(object):
-
-    """
-    Represents the difference between two snapshots
-    """
-
-    def __init__(self, before, after):
-        self.before = before
-        self.after = after
-        self._calculate()
-
-    def _calculate(self):
-        before = self.before.data
-        after = self.after.data
-        self.deleted = {}
-        self.updated = {}
-        self.created = after.copy()
-        for path, f in before.items():
-            if path not in after:
-                self.deleted[path] = f
-                continue
-            del self.created[path]
-            if f.mtime < after[path].mtime:
-                self.updated[path] = after[path]
-
-    def __str__(self):
-        return self.report()
-
-    def report(self, header=True, dates=False):
-        s = []
-        if header:
-            s.append('Difference in %s from %s to %s:' %
-                     (self.before.base_path,
-                      self.before.calculated,
-                      self.after.calculated))
-        for name, files, show_size in [
-            ('created', self.created, True),
-            ('deleted', self.deleted, True),
-            ('updated', self.updated, True)]:
-            if files:
-                s.append('-- %s: -------------------' % name)
-                files = files.items()
-                files.sort()
-                last = ''
-                for path, f in files:
-                    t = '  %s' % _space_prefix(last, path, indent=4,
-                                               include_sep=False)
-                    last = path
-                    if show_size and f.size != 'N/A':
-                        t += '  (%s bytes)' % f.size
-                    if dates:
-                        parts = []
-                        if self.before.get(path):
-                            parts.append(self.before[path].mtime)
-                        if self.after.get(path):
-                            parts.append(self.after[path].mtime)
-                        t += ' (mtime: %s)' % ('->'.join(map(repr, parts)))
-                    s.append(t)
-        if len(s) == 1:
-            s.append('  (no changes)')
-        return '\n'.join(s)
-
-class Snapshot(IterableUserDict):
-
-    """
-    Represents a snapshot of a set of files.  Has a dictionary-like
-    interface, keyed relative to ``base_path``
-    """
-
-    def __init__(self, base_path, files=None, ignore_wildcards=(),
-                 ignore_paths=(), ignore_hidden=True):
-        self.base_path = base_path
-        self.ignore_wildcards = ignore_wildcards
-        self.ignore_hidden = ignore_hidden
-        self.ignore_paths = ignore_paths
-        self.calculated = None
-        self.data = files or {}
-        if files is None:
-            self.find_files()
-
-    ############################################################
-    ## File finding
-    ############################################################
-
-    def find_files(self):
-        """
-        Find all the files under the base path, and put them in
-        ``self.data``
-        """
-        self._find_traverse('', self.data)
-        self.calculated = datetime.now()
-
-    def _ignore_file(self, fn):
-        if fn in self.ignore_paths:
-            return True
-        if self.ignore_hidden and os.path.basename(fn).startswith('.'):
-            return True
-        for pat in self.ignore_wildcards:
-            if fnmatch(fn, pat):
-                return True
-        return False
-
-    def _ignore_file(self, fn):
-        if fn in self.ignore_paths:
-            return True
-        if self.ignore_hidden and os.path.basename(fn).startswith('.'):
-            return True
-        return False
-
-    def _find_traverse(self, path, result):
-        full = os.path.join(self.base_path, path)
-        if os.path.isdir(full):
-            if path:
-                # Don't actually include the base path
-                result[path] = Dir(self.base_path, path)
-            for fn in os.listdir(full):
-                fn = os.path.join(path, fn)
-                if self._ignore_file(fn):
-                    continue
-                self._find_traverse(fn, result)
-        else:
-            result[path] = File(self.base_path, path)
-
-    def __repr__(self):
-        return '<%s in %r from %r>' % (
-            self.__class__.__name__, self.base_path,
-            self.calculated or '(no calculation done)')
-
-    def compare_expected(self, expected, comparison=operator.eq,
-                         differ=None, not_found=None,
-                         include_success=False):
-        """
-        Compares a dictionary of ``path: content`` to the
-        found files.  Comparison is done by equality, or the
-        ``comparison(actual_content, expected_content)`` function given.
-
-        Returns dictionary of differences, keyed by path.  Each
-        difference is either noted, or the output of
-        ``differ(actual_content, expected_content)`` is given.
-
-        If a file does not exist and ``not_found`` is given, then
-        ``not_found(path)`` is put in.
-        """
-        result = {}
-        for path in expected:
-            orig_path = path
-            path = path.strip('/')
-            if path not in self.data:
-                if not_found:
-                    msg = not_found(path)
-                else:
-                    msg = 'not found'
-                result[path] = msg
-                continue
-            expected_content = expected[orig_path]
-            file = self.data[path]
-            actual_content = file.bytes
-            if not comparison(actual_content, expected_content):
-                if differ:
-                    msg = differ(actual_content, expected_content)
-                else:
-                    if len(actual_content) < len(expected_content):
-                        msg = 'differ (%i bytes smaller)' % (
-                            len(expected_content) - len(actual_content))
-                    elif len(actual_content) > len(expected_content):
-                        msg = 'differ (%i bytes larger)' % (
-                            len(actual_content) - len(expected_content))
-                    else:
-                        msg = 'diff (same size)'
-                result[path] = msg
-            elif include_success:
-                result[path] = 'same!'
-        return result
-
-    def diff_to_now(self):
-        return Diff(self, self.clone())
-
-    def clone(self):
-        return self.__class__(base_path=self.base_path,
-                              ignore_wildcards=self.ignore_wildcards,
-                              ignore_paths=self.ignore_paths,
-                              ignore_hidden=self.ignore_hidden)
-
-class File(object):
-
-    """
-    Represents a single file found as the result of a command.
-
-    Has attributes:
-
-    ``path``:
-        The path of the file, relative to the ``base_path``
-
-    ``full``:
-        The full path
-
-    ``stat``:
-        The results of ``os.stat``.  Also ``mtime`` and ``size``
-        contain the ``.st_mtime`` and ``st_size`` of the stat.
-
-    ``bytes``:
-        The contents of the file.
-
-    You may use the ``in`` operator with these objects (tested against
-    the contents of the file), and the ``.mustcontain()`` method.
-    """
-
-    file = True
-    dir = False
-
-    def __init__(self, base_path, path):
-        self.base_path = base_path
-        self.path = path
-        self.full = os.path.join(base_path, path)
-        self.stat = os.stat(self.full)
-        self.mtime = self.stat.st_mtime
-        self.size = self.stat.st_size
-        self._bytes = None
-
-    def bytes__get(self):
-        if self._bytes is None:
-            f = open(self.full, 'rb')
-            self._bytes = f.read()
-            f.close()
-        return self._bytes
-    bytes = property(bytes__get)
-
-    def __contains__(self, s):
-        return s in self.bytes
-
-    def mustcontain(self, s):
-        __tracebackhide__ = True
-        bytes = self.bytes
-        if s not in bytes:
-            print 'Could not find %r in:' % s
-            print bytes
-            assert s in bytes
-
-    def __repr__(self):
-        return '<%s %s:%s>' % (
-            self.__class__.__name__,
-            self.base_path, self.path)
-
-class Dir(File):
-
-    """
-    Represents a directory created by a command.
-    """
-
-    file = False
-    dir = True
-
-    def __init__(self, base_path, path):
-        self.base_path = base_path
-        self.path = path
-        self.full = os.path.join(base_path, path)
-        self.size = 'N/A'
-        self.mtime = 'N/A'
-
-    def __repr__(self):
-        return '<%s %s:%s>' % (
-            self.__class__.__name__,
-            self.base_path, self.path)
-
-    def bytes__get(self):
-        raise NotImplementedError(
-            "Directory %r doesn't have content" % self)
-
-    bytes = property(bytes__get)
-    
-
-def _space_prefix(pref, full, sep=None, indent=None, include_sep=True):
-    """
-    Anything shared by pref and full will be replaced with spaces
-    in full, and full returned.
-
-    Example::
-
-        >>> _space_prefix('/foo/bar', '/foo')
-        '    /bar'
-    """
-    if sep is None:
-        sep = os.path.sep
-    pref = pref.split(sep)
-    full = full.split(sep)
-    padding = []
-    while pref and full and pref[0] == full[0]:
-        if indent is None:
-            padding.append(' ' * (len(full[0]) + len(sep)))
-        else:
-            padding.append(' ' * indent)
-        full.pop(0)
-        pref.pop(0)
-    if padding:
-        if include_sep:
-            return ''.join(padding) + sep + sep.join(full)
-        else:
-            return ''.join(padding) + sep.join(full)
-    else:
-        return sep.join(full)
-
-def report_expected_diffs(diffs, colorize=False):
-    """
-    Takes the output of compare_expected, and returns a string
-    description of the differences.
-    """
-    if not diffs:
-        return 'No differences'
-    diffs = diffs.items()
-    diffs.sort()
-    s = []
-    last = ''
-    for path, desc in diffs:
-        t = _space_prefix(last, path, indent=4, include_sep=False)
-        if colorize:
-            t = color_line(t, 11)
-        last = path
-        if len(desc.splitlines()) > 1:
-            cur_indent = len(re.search(r'^[ ]*', t).group(0))
-            desc = indent(cur_indent+2, desc)
-            if colorize:
-                t += '\n'
-                for line in desc.splitlines():
-                    if line.strip().startswith('+'):
-                        line = color_line(line, 10)
-                    elif line.strip().startswith('-'):
-                        line = color_line(line, 9)
-                    else:
-                        line = color_line(line, 14)
-                    t += line+'\n'
-            else:
-                t += '\n' + desc
-        else:
-            t += ' '+desc
-        s.append(t)
-    s.append('Files with differences: %s' % len(diffs))
-    return '\n'.join(s)
-
-def color_code(foreground=None, background=None):
-    """
-    0  black
-    1  red
-    2  green
-    3  yellow
-    4  blue
-    5  magenta (purple)
-    6  cyan
-    7  white (gray)
-
-    Add 8 to get high-intensity
-    """
-    if foreground is None and background is None:
-        # Reset
-        return '\x1b[0m'
-    codes = []
-    if foreground is None:
-        codes.append('[39m')
-    elif foreground > 7:
-        codes.append('[1m')
-        codes.append('[%im' % (22+foreground))
-    else:
-        codes.append('[%im' % (30+foreground))
-    if background is None:
-        codes.append('[49m')
-    else:
-        codes.append('[%im' % (40+background))
-    return '\x1b' + '\x1b'.join(codes)
-
-def color_line(line, foreground=None, background=None):
-    match = re.search(r'^(\s*)', line)
-    return (match.group(1) + color_code(foreground, background)
-            + line[match.end():] + color_code())
-
-def indent(indent, text):
-    return '\n'.join(
-        [' '*indent + l for l in text.splitlines()])
-
-def show_diff(actual_content, expected_content):
-    actual_lines = [l.strip() for l in actual_content.splitlines()
-                    if l.strip()]
-    expected_lines = [l.strip() for l in expected_content.splitlines()
-                      if l.strip()]
-    if len(actual_lines) == len(expected_lines) == 1:
-        return '%r not %r' % (actual_lines[0], expected_lines[0])
-    if not actual_lines:
-        return 'Empty; should have:\n'+expected_content
-    import difflib
-    return '\n'.join(difflib.ndiff(actual_lines, expected_lines))

+ 0 - 148
desktop/core/ext-py/Paste-1.7.2/paste/debug/prints.py

@@ -1,148 +0,0 @@
-# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
-# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
-"""
-Middleware that displays everything that is printed inline in
-application pages.
-
-Anything printed during the request will get captured and included on
-the page.  It will usually be included as a floating element in the
-top right hand corner of the page.  If you want to override this
-you can include a tag in your template where it will be placed::
-
-  <pre id="paste-debug-prints"></pre>
-
-You might want to include ``style="white-space: normal"``, as all the
-whitespace will be quoted, and this allows the text to wrap if
-necessary.
-
-"""
-
-from cStringIO import StringIO
-import re
-import cgi
-from paste.util import threadedprint
-from paste import wsgilib
-from paste import response
-import sys
-
-_threadedprint_installed = False
-
-__all__ = ['PrintDebugMiddleware']
-
-class TeeFile(object):
-
-    def __init__(self, files):
-        self.files = files
-
-    def write(self, v):
-        if isinstance(v, unicode):
-            # WSGI is picky in this case
-            v = str(v)
-        for file in self.files:
-            file.write(v)
-
-class PrintDebugMiddleware(object):
-
-    """
-    This middleware captures all the printed statements, and inlines
-    them in HTML pages, so that you can see all the (debug-intended)
-    print statements in the page itself.
-
-    There are two keys added to the environment to control this:
-    ``environ['paste.printdebug_listeners']`` is a list of functions
-    that will be called everytime something is printed.
-
-    ``environ['paste.remove_printdebug']`` is a function that, if
-    called, will disable printing of output for that request.
-
-    If you have ``replace_stdout=True`` then stdout is replaced, not
-    captured.
-    """
-
-    log_template = (
-        '<pre style="width: 40%%; border: 2px solid #000; white-space: normal; '
-        'background-color: #ffd; color: #000; float: right;">'
-        '<b style="border-bottom: 1px solid #000">Log messages</b><br>'
-        '%s</pre>')
-
-    def __init__(self, app, global_conf=None, force_content_type=False,
-                 print_wsgi_errors=True, replace_stdout=False):
-        # @@: global_conf should be handled separately and only for
-        # the entry point
-        self.app = app
-        self.force_content_type = force_content_type
-        if isinstance(print_wsgi_errors, basestring):
-            from paste.deploy.converters import asbool
-            print_wsgi_errors = asbool(print_wsgi_errors)
-        self.print_wsgi_errors = print_wsgi_errors
-        self.replace_stdout = replace_stdout
-        self._threaded_print_stdout = None
-
-    def __call__(self, environ, start_response):
-        global _threadedprint_installed
-        if environ.get('paste.testing'):
-            # In a testing environment this interception isn't
-            # useful:
-            return self.app(environ, start_response)
-        if (not _threadedprint_installed
-            or self._threaded_print_stdout is not sys.stdout):
-            # @@: Not strictly threadsafe
-            _threadedprint_installed = True
-            threadedprint.install(leave_stdout=not self.replace_stdout)
-            self._threaded_print_stdout = sys.stdout
-        removed = []
-        def remove_printdebug():
-            removed.append(None)
-        environ['paste.remove_printdebug'] = remove_printdebug
-        logged = StringIO()
-        listeners = [logged]
-        environ['paste.printdebug_listeners'] = listeners
-        if self.print_wsgi_errors:
-            listeners.append(environ['wsgi.errors'])
-        replacement_stdout = TeeFile(listeners)
-        threadedprint.register(replacement_stdout)
-        try:
-            status, headers, body = wsgilib.intercept_output(
-                environ, self.app)
-            if status is None:
-                # Some error occurred
-                status = '500 Server Error'
-                headers = [('Content-type', 'text/html')]
-                start_response(status, headers)
-                if not body:
-                    body = 'An error occurred'
-            content_type = response.header_value(headers, 'content-type')
-            if (removed or
-                (not self.force_content_type and
-                 (not content_type
-                  or not content_type.startswith('text/html')))):
-                if replacement_stdout == logged:
-                    # Then the prints will be lost, unless...
-                    environ['wsgi.errors'].write(logged.getvalue())
-                start_response(status, headers)
-                return [body]
-            response.remove_header(headers, 'content-length')
-            body = self.add_log(body, logged.getvalue())
-            start_response(status, headers)
-            return [body]
-        finally:
-            threadedprint.deregister()
-
-    _body_re = re.compile(r'<body[^>]*>', re.I)
-    _explicit_re = re.compile(r'<pre\s*[^>]*id="paste-debug-prints".*?>',
-                              re.I+re.S)
-    
-    def add_log(self, html, log):
-        if not log:
-            return html
-        text = cgi.escape(log)
-        text = text.replace('\n', '<br>')
-        text = text.replace('  ', '&nbsp; ')
-        match = self._explicit_re.search(html)
-        if not match:
-            text = self.log_template % text
-            match = self._body_re.search(html)
-        if not match:
-            return text + html
-        else:
-            return html[:match.end()] + text + html[match.end():]

+ 0 - 227
desktop/core/ext-py/Paste-1.7.2/paste/debug/profile.py

@@ -1,227 +0,0 @@
-# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
-# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
-"""
-Middleware that profiles the request and displays profiling
-information at the bottom of each page.
-"""
-
-
-import sys
-import os
-import hotshot
-import hotshot.stats
-import threading
-import cgi
-import time
-from cStringIO import StringIO
-from paste import response
-
-__all__ = ['ProfileMiddleware', 'profile_decorator']
-
-class ProfileMiddleware(object):
-
-    """
-    Middleware that profiles all requests.
-
-    All HTML pages will have profiling information appended to them.
-    The data is isolated to that single request, and does not include
-    data from previous requests.
-
-    This uses the ``hotshot`` module, which affects performance of the
-    application.  It also runs in a single-threaded mode, so it is
-    only usable in development environments.
-    """
-
-    style = ('clear: both; background-color: #ff9; color: #000; '
-             'border: 2px solid #000; padding: 5px;')
-
-    def __init__(self, app, global_conf=None,
-                 log_filename='profile.log.tmp',
-                 limit=40):
-        self.app = app
-        self.lock = threading.Lock()
-        self.log_filename = log_filename
-        self.limit = limit
-
-    def __call__(self, environ, start_response):
-        catch_response = []
-        body = []
-        def replace_start_response(status, headers, exc_info=None):
-            catch_response.extend([status, headers])
-            start_response(status, headers, exc_info)
-            return body.append
-        def run_app():
-            app_iter = self.app(environ, replace_start_response)
-            try:
-                body.extend(app_iter)
-            finally:
-                if hasattr(app_iter, 'close'):
-                    app_iter.close()
-        self.lock.acquire()
-        try:
-            prof = hotshot.Profile(self.log_filename)
-            prof.addinfo('URL', environ.get('PATH_INFO', ''))
-            try:
-                prof.runcall(run_app)
-            finally:
-                prof.close()
-            body = ''.join(body)
-            headers = catch_response[1]
-            content_type = response.header_value(headers, 'content-type')
-            if content_type is None or not content_type.startswith('text/html'):
-                # We can't add info to non-HTML output
-                return [body]
-            stats = hotshot.stats.load(self.log_filename)
-            stats.strip_dirs()
-            stats.sort_stats('time', 'calls')
-            output = capture_output(stats.print_stats, self.limit)
-            output_callers = capture_output(
-                stats.print_callers, self.limit)
-            body += '<pre style="%s">%s\n%s</pre>' % (
-                self.style, cgi.escape(output), cgi.escape(output_callers))
-            return [body]
-        finally:
-            self.lock.release()
-
-def capture_output(func, *args, **kw):
-    # Not threadsafe! (that's okay when ProfileMiddleware uses it,
-    # though, since it synchronizes itself.)
-    out = StringIO()
-    old_stdout = sys.stdout
-    sys.stdout = out
-    try:
-        func(*args, **kw)
-    finally:
-        sys.stdout = old_stdout
-    return out.getvalue()
-
-def profile_decorator(**options):
-
-    """
-    Profile a single function call.
-    
-    Used around a function, like::
-
-        @profile_decorator(options...)
-        def ...
-
-    All calls to the function will be profiled.  The options are
-    all keywords, and are:
-
-        log_file:
-            The filename to log to (or ``'stdout'`` or ``'stderr'``).
-            Default: stderr.
-        display_limit:
-            Only show the top N items, default: 20.
-        sort_stats:
-            A list of string-attributes to sort on.  Default
-            ``('time', 'calls')``.
-        strip_dirs:
-            Strip directories/module names from files?  Default True.
-        add_info:
-            If given, this info will be added to the report (for your
-            own tracking).  Default: none.
-        log_filename:
-            The temporary filename to log profiling data to.  Default;
-            ``./profile_data.log.tmp``
-        no_profile:
-            If true, then don't actually profile anything.  Useful for
-            conditional profiling.
-    """
-
-    if options.get('no_profile'):
-        def decorator(func):
-            return func
-        return decorator
-    def decorator(func):
-        def replacement(*args, **kw):
-            return DecoratedProfile(func, **options)(*args, **kw)
-        return replacement
-    return decorator
-
-class DecoratedProfile(object):
-
-    lock = threading.Lock()
-
-    def __init__(self, func, **options):
-        self.func = func
-        self.options = options
-
-    def __call__(self, *args, **kw):
-        self.lock.acquire()
-        try:
-            return self.profile(self.func, *args, **kw)
-        finally:
-            self.lock.release()
-
-    def profile(self, func, *args, **kw):
-        ops = self.options
-        prof_filename = ops.get('log_filename', 'profile_data.log.tmp')
-        prof = hotshot.Profile(prof_filename)
-        prof.addinfo('Function Call',
-                     self.format_function(func, *args, **kw))
-        if ops.get('add_info'):
-            prof.addinfo('Extra info', ops['add_info'])
-        exc_info = None
-        try:
-            start_time = time.time()
-            try:
-                result = prof.runcall(func, *args, **kw)
-            except:
-                exc_info = sys.exc_info()
-            end_time = time.time()
-        finally:
-            prof.close()
-        stats = hotshot.stats.load(prof_filename)
-        os.unlink(prof_filename)
-        if ops.get('strip_dirs', True):
-            stats.strip_dirs()
-        stats.sort_stats(*ops.get('sort_stats', ('time', 'calls')))
-        display_limit = ops.get('display_limit', 20)
-        output = capture_output(stats.print_stats, display_limit)
-        output_callers = capture_output(
-            stats.print_callers, display_limit)
-        output_file = ops.get('log_file')
-        if output_file in (None, 'stderr'):
-            f = sys.stderr
-        elif output_file in ('-', 'stdout'):
-            f = sys.stdout
-        else:
-            f = open(output_file, 'a')
-            f.write('\n%s\n' % ('-'*60))
-            f.write('Date: %s\n' % time.strftime('%c'))
-        f.write('Function call: %s\n'
-                % self.format_function(func, *args, **kw))
-        f.write('Wall time: %0.2f seconds\n'
-                % (end_time - start_time))
-        f.write(output)
-        f.write(output_callers)
-        if output_file not in (None, '-', 'stdout', 'stderr'):
-            f.close()
-        if exc_info:
-            # We captured an exception earlier, now we re-raise it
-            raise exc_info[0], exc_info[1], exc_info[2]
-        return result
-        
-    def format_function(self, func, *args, **kw):
-        args = map(repr, args)
-        args.extend(
-            ['%s=%r' % (k, v) for k, v in kw.items()])
-        return '%s(%s)' % (func.__name__, ', '.join(args))
-            
-            
-def make_profile_middleware(
-    app, global_conf,
-    log_filename='profile.log.tmp',
-    limit=40):
-    """
-    Wrap the application in a component that will profile each
-    request.  The profiling data is then appended to the output
-    of each page.
-
-    Note that this serializes all requests (i.e., removing
-    concurrency).  Therefore never use this in production.
-    """
-    limit = int(limit)
-    return ProfileMiddleware(
-        app, log_filename=log_filename, limit=limit)

+ 0 - 93
desktop/core/ext-py/Paste-1.7.2/paste/debug/testserver.py

@@ -1,93 +0,0 @@
-# (c) 2005 Clark C. Evans
-# This module is part of the Python Paste Project and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
-# This code was written with funding by http://prometheusresearch.com
-"""
-WSGI Test Server
-
-This builds upon paste.util.baseserver to customize it for regressions
-where using raw_interactive won't do.
-
-
-"""
-import time
-from paste.httpserver import *
-
-class WSGIRegressionServer(WSGIServer):
-    """
-    A threaded WSGIServer for use in regression testing.  To use this
-    module, call serve(application, regression=True), and then call
-    server.accept() to let it handle one request.  When finished, use
-    server.stop() to shutdown the server. Note that all pending requests
-    are processed before the server shuts down.
-    """
-    defaulttimeout = 10
-    def __init__ (self, *args, **kwargs):
-        WSGIServer.__init__(self, *args, **kwargs)
-        self.stopping = []
-        self.pending = []
-        self.timeout = self.defaulttimeout
-        # this is a local connection, be quick
-        self.socket.settimeout(2) 
-    def serve_forever(self):
-        from threading import Thread
-        thread = Thread(target=self.serve_pending)
-        thread.start()
-    def reset_expires(self):
-        if self.timeout:
-            self.expires = time.time() + self.timeout
-    def close_request(self, *args, **kwargs):
-        WSGIServer.close_request(self, *args, **kwargs)
-        self.pending.pop()
-        self.reset_expires()
-    def serve_pending(self):
-        self.reset_expires()
-        while not self.stopping or self.pending:
-            now = time.time()
-            if now > self.expires and self.timeout:
-                # note regression test doesn't handle exceptions in
-                # threads very well; so we just print and exit
-                print "\nWARNING: WSGIRegressionServer timeout exceeded\n"
-                break
-            if self.pending:
-                self.handle_request()
-            time.sleep(.1)
-    def stop(self):
-        """ stop the server (called from tester's thread) """
-        self.stopping.append(True)
-    def accept(self, count = 1):
-        """ accept another request (called from tester's thread) """
-        assert not self.stopping
-        [self.pending.append(True) for x in range(count)]
-
-def serve(application, host=None, port=None, handler=None):
-    server = WSGIRegressionServer(application, host, port, handler)
-    print "serving on %s:%s" % server.server_address
-    server.serve_forever()
-    return server
-
-if __name__ == '__main__':
-    import urllib
-    from paste.wsgilib import dump_environ
-    server = serve(dump_environ)
-    baseuri = ("http://%s:%s" % server.server_address)
-
-    def fetch(path):
-        # tell the server to humor exactly one more request
-        server.accept(1)
-        # not needed; but this is what you do if the server 
-        # may not respond in a resonable time period
-        import socket
-        socket.setdefaulttimeout(5)
-        # build a uri, fetch and return
-        return urllib.urlopen(baseuri + path).read()
-      
-    assert "PATH_INFO: /foo" in fetch("/foo")
-    assert "PATH_INFO: /womble" in fetch("/womble")
-
-    # ok, let's make one more final request...
-    server.accept(1)
-    # and then schedule a stop()
-    server.stop()
-    # and then... fetch it...
-    urllib.urlopen(baseuri)

+ 0 - 347
desktop/core/ext-py/Paste-1.7.2/paste/debug/watchthreads.py

@@ -1,347 +0,0 @@
-"""
-Watches the key ``paste.httpserver.thread_pool`` to see how many
-threads there are and report on any wedged threads.
-"""
-import sys
-import cgi
-import time
-import traceback
-from cStringIO import StringIO
-from thread import get_ident
-from paste import httpexceptions
-from paste.request import construct_url, parse_formvars
-from paste.util.template import HTMLTemplate, bunch
-
-page_template = HTMLTemplate('''
-<html>
- <head>
-  <style type="text/css">
-   body {
-     font-family: sans-serif;
-   }
-   table.environ tr td {
-     border-bottom: #bbb 1px solid;
-   }
-   table.environ tr td.bottom {
-     border-bottom: none;
-   }
-   table.thread {
-     border: 1px solid #000;
-     margin-bottom: 1em;
-   }
-   table.thread tr td {
-     border-bottom: #999 1px solid;
-     padding-right: 1em;
-   }
-   table.thread tr td.bottom {
-     border-bottom: none;
-   }
-   table.thread tr.this_thread td {
-     background-color: #006;
-     color: #fff;
-   }
-   a.button {
-     background-color: #ddd;
-     border: #aaa outset 2px;
-     text-decoration: none;
-     margin-top: 10px;
-     font-size: 80%;
-     color: #000;
-   }
-   a.button:hover {
-     background-color: #eee;
-     border: #bbb outset 2px;
-   }
-   a.button:active {
-     border: #bbb inset 2px;
-   }
-  </style>
-  <title>{{title}}</title>
- </head>
- <body>
-  <h1>{{title}}</h1>
-  {{if kill_thread_id}}
-  <div style="background-color: #060; color: #fff;
-              border: 2px solid #000;">
-  Thread {{kill_thread_id}} killed
-  </div>
-  {{endif}}
-  <div>Pool size: {{nworkers}}
-       {{if actual_workers > nworkers}}
-         + {{actual_workers-nworkers}} extra
-       {{endif}}
-       ({{nworkers_used}} used including current request)<br>
-       idle: {{len(track_threads["idle"])}},
-       busy: {{len(track_threads["busy"])}},
-       hung: {{len(track_threads["hung"])}},
-       dying: {{len(track_threads["dying"])}},
-       zombie: {{len(track_threads["zombie"])}}</div>
-
-{{for thread in threads}}
-
-<table class="thread">
- <tr {{if thread.thread_id == this_thread_id}}class="this_thread"{{endif}}>
-  <td>
-   <b>Thread</b>
-   {{if thread.thread_id == this_thread_id}}
-   (<i>this</i> request)
-   {{endif}}</td>
-  <td>
-   <b>{{thread.thread_id}}
-    {{if allow_kill}}
-    <form action="{{script_name}}/kill" method="POST"
-          style="display: inline">
-      <input type="hidden" name="thread_id" value="{{thread.thread_id}}">
-      <input type="submit" value="kill">
-    </form>
-    {{endif}}
-   </b>
-  </td>
- </tr>
- <tr>
-  <td>Time processing request</td>
-  <td>{{thread.time_html|html}}</td>
- </tr>
- <tr>
-  <td>URI</td>
-  <td>{{if thread.uri == 'unknown'}}
-      unknown
-      {{else}}<a href="{{thread.uri}}">{{thread.uri_short}}</a>
-      {{endif}}
-  </td>
- <tr>
-  <td colspan="2" class="bottom">
-   <a href="#" class="button" style="width: 9em; display: block"
-      onclick="
-        var el = document.getElementById('environ-{{thread.thread_id}}');
-        if (el.style.display) {
-            el.style.display = '';
-            this.innerHTML = \'&#9662; Hide environ\';
-        } else {
-            el.style.display = 'none';
-            this.innerHTML = \'&#9656; Show environ\';
-        }
-        return false
-      ">&#9656; Show environ</a>
-   
-   <div id="environ-{{thread.thread_id}}" style="display: none">
-    {{if thread.environ:}}
-    <table class="environ">
-     {{for loop, item in looper(sorted(thread.environ.items()))}}
-     {{py:key, value=item}}
-     <tr>
-      <td {{if loop.last}}class="bottom"{{endif}}>{{key}}</td>
-      <td {{if loop.last}}class="bottom"{{endif}}>{{value}}</td>
-     </tr>
-     {{endfor}}
-    </table>
-    {{else}}
-    Thread is in process of starting
-    {{endif}}
-   </div>
-
-   {{if thread.traceback}}
-   <a href="#" class="button" style="width: 9em; display: block"
-      onclick="
-        var el = document.getElementById('traceback-{{thread.thread_id}}');
-        if (el.style.display) {
-            el.style.display = '';
-            this.innerHTML = \'&#9662; Hide traceback\';
-        } else {
-            el.style.display = 'none';
-            this.innerHTML = \'&#9656; Show traceback\';
-        }
-        return false
-      ">&#9656; Show traceback</a>
-
-    <div id="traceback-{{thread.thread_id}}" style="display: none">
-      <pre class="traceback">{{thread.traceback}}</pre>
-    </div>
-    {{endif}}
-
-  </td>
- </tr>
-</table>
-
-{{endfor}}
-
- </body>
-</html>
-''', name='watchthreads.page_template')
-
-class WatchThreads(object):
-
-    """
-    Application that watches the threads in ``paste.httpserver``,
-    showing the length each thread has been working on a request.
-
-    If allow_kill is true, then you can kill errant threads through
-    this application.
-
-    This application can expose private information (specifically in
-    the environment, like cookies), so it should be protected.
-    """
-
-    def __init__(self, allow_kill=False):
-        self.allow_kill = allow_kill
-
-    def __call__(self, environ, start_response):
-        if 'paste.httpserver.thread_pool' not in environ:
-            start_response('403 Forbidden', [('Content-type', 'text/plain')])
-            return ['You must use the threaded Paste HTTP server to use this application']
-        if environ.get('PATH_INFO') == '/kill':
-            return self.kill(environ, start_response)
-        else:
-            return self.show(environ, start_response)
-
-    def show(self, environ, start_response):
-        start_response('200 OK', [('Content-type', 'text/html')])
-        form = parse_formvars(environ)
-        if form.get('kill'):
-            kill_thread_id = form['kill']
-        else:
-            kill_thread_id = None
-        thread_pool = environ['paste.httpserver.thread_pool']
-        nworkers = thread_pool.nworkers
-        now = time.time()
-
-
-        workers = thread_pool.worker_tracker.items()
-        workers.sort(key=lambda v: v[1][0])
-        threads = []
-        for thread_id, (time_started, worker_environ) in workers:
-            thread = bunch()
-            threads.append(thread)
-            if worker_environ:
-                thread.uri = construct_url(worker_environ)
-            else:
-                thread.uri = 'unknown'
-            thread.thread_id = thread_id
-            thread.time_html = format_time(now-time_started)
-            thread.uri_short = shorten(thread.uri)
-            thread.environ = worker_environ
-            thread.traceback = traceback_thread(thread_id)
-            
-        page = page_template.substitute(
-            title="Thread Pool Worker Tracker",
-            nworkers=nworkers,
-            actual_workers=len(thread_pool.workers),
-            nworkers_used=len(workers),
-            script_name=environ['SCRIPT_NAME'],
-            kill_thread_id=kill_thread_id,
-            allow_kill=self.allow_kill,
-            threads=threads,
-            this_thread_id=get_ident(),
-            track_threads=thread_pool.track_threads())
-
-        return [page]
-
-    def kill(self, environ, start_response):
-        if not self.allow_kill:
-            exc = httpexceptions.HTTPForbidden(
-                'Killing threads has not been enabled.  Shame on you '
-                'for trying!')
-            return exc(environ, start_response)
-        vars = parse_formvars(environ)
-        thread_id = int(vars['thread_id'])
-        thread_pool = environ['paste.httpserver.thread_pool']
-        if thread_id not in thread_pool.worker_tracker:
-            exc = httpexceptions.PreconditionFailed(
-                'You tried to kill thread %s, but it is not working on '
-                'any requests' % thread_id)
-            return exc(environ, start_response)
-        thread_pool.kill_worker(thread_id)
-        script_name = environ['SCRIPT_NAME'] or '/'
-        exc = httpexceptions.HTTPFound(
-            headers=[('Location', script_name+'?kill=%s' % thread_id)])
-        return exc(environ, start_response)
-        
-def traceback_thread(thread_id):
-    """
-    Returns a plain-text traceback of the given thread, or None if it
-    can't get a traceback.
-    """
-    if not hasattr(sys, '_current_frames'):
-        # Only 2.5 has support for this, with this special function
-        return None
-    frames = sys._current_frames()
-    if not thread_id in frames:
-        return None
-    frame = frames[thread_id]
-    out = StringIO()
-    traceback.print_stack(frame, file=out)
-    return out.getvalue()
-
-hide_keys = ['paste.httpserver.thread_pool']
-
-def format_environ(environ):
-    if environ is None:
-        return environ_template.substitute(
-            key='---',
-            value='No environment registered for this thread yet')
-    environ_rows = []
-    for key, value in sorted(environ.items()):
-        if key in hide_keys:
-            continue
-        try:
-            if key.upper() != key:
-                value = repr(value)
-            environ_rows.append(
-                environ_template.substitute(
-                key=cgi.escape(str(key)),
-                value=cgi.escape(str(value))))
-        except Exception, e:
-            environ_rows.append(
-                environ_template.substitute(
-                key=cgi.escape(str(key)),
-                value='Error in <code>repr()</code>: %s' % e))
-    return ''.join(environ_rows)
-    
-def format_time(time_length):
-    if time_length >= 60*60:
-        # More than an hour
-        time_string = '%i:%02i:%02i' % (int(time_length/60/60),
-                                        int(time_length/60) % 60,
-                                        time_length % 60)
-    elif time_length >= 120:
-        time_string = '%i:%02i' % (int(time_length/60),
-                                   time_length % 60)
-    elif time_length > 60:
-        time_string = '%i sec' % time_length
-    elif time_length > 1:
-        time_string = '%0.1f sec' % time_length
-    else:
-        time_string = '%0.2f sec' % time_length
-    if time_length < 5:
-        return time_string
-    elif time_length < 120:
-        return '<span style="color: #900">%s</span>' % time_string
-    else:
-        return '<span style="background-color: #600; color: #fff">%s</span>' % time_string
-
-def shorten(s):
-    if len(s) > 60:
-        return s[:40]+'...'+s[-10:]
-    else:
-        return s
-
-def make_watch_threads(global_conf, allow_kill=False):
-    from paste.deploy.converters import asbool
-    return WatchThreads(allow_kill=asbool(allow_kill))
-make_watch_threads.__doc__ = WatchThreads.__doc__
-
-def make_bad_app(global_conf, pause=0):
-    pause = int(pause)
-    def bad_app(environ, start_response):
-        import thread
-        if pause:
-            time.sleep(pause)
-        else:
-            count = 0
-            while 1:
-                print "I'm alive %s (%s)" % (count, thread.get_ident())
-                time.sleep(10)
-                count += 1
-        start_response('200 OK', [('content-type', 'text/plain')])
-        return ['OK, paused %s seconds' % pause]
-    return bad_app

+ 0 - 117
desktop/core/ext-py/Paste-1.7.2/paste/debug/wdg_validate.py

@@ -1,117 +0,0 @@
-# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
-# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
-"""
-Middleware that tests the validity of all generated HTML using the
-`WDG HTML Validator <http://www.htmlhelp.com/tools/validator/>`_
-"""
-
-from cStringIO import StringIO
-try:
-    import subprocess
-except ImportError:
-    from paste.util import subprocess24 as subprocess
-from paste import wsgilib
-import re
-import cgi
-
-__all__ = ['WDGValidateMiddleware']
-
-class WDGValidateMiddleware(object):
-
-    """
-    Middleware that checks HTML and appends messages about the validity of
-    the HTML.  Uses: http://www.htmlhelp.com/tools/validator/ -- interacts
-    with the command line client.  Use the configuration ``wdg_path`` to
-    override the path (default: looks for ``validate`` in $PATH).
-
-    To install, in your web context's __init__.py::
-
-        def urlparser_wrap(environ, start_response, app):
-            return wdg_validate.WDGValidateMiddleware(app)(
-                environ, start_response)
-
-    Or in your configuration::
-
-        middleware.append('paste.wdg_validate.WDGValidateMiddleware')
-    """
-
-    _end_body_regex = re.compile(r'</body>', re.I)
-
-    def __init__(self, app, global_conf=None, wdg_path='validate'):
-        self.app = app
-        self.wdg_path = wdg_path
-
-    def __call__(self, environ, start_response):
-        output = StringIO()
-        response = []
-
-        def writer_start_response(status, headers, exc_info=None):
-            response.extend((status, headers))
-            start_response(status, headers, exc_info)
-            return output.write
-
-        app_iter = self.app(environ, writer_start_response)
-        try:
-            for s in app_iter:
-                output.write(s)
-        finally:
-            if hasattr(app_iter, 'close'):
-                app_iter.close()
-        page = output.getvalue()
-        status, headers = response
-        v = wsgilib.header_value(headers, 'content-type') or ''
-        if (not v.startswith('text/html')
-            and not v.startswith('text/xhtml')
-            and not v.startswith('application/xhtml')):
-            # Can't validate
-            # @@: Should validate CSS too... but using what?
-            return [page]
-        ops = []
-        if v.startswith('text/xhtml+xml'):
-            ops.append('--xml')
-        # @@: Should capture encoding too
-        html_errors = self.call_wdg_validate(
-            self.wdg_path, ops, page)
-        if not html_errors:
-            return [page]
-        return self.add_error(page, html_errors)
-    
-    def call_wdg_validate(self, wdg_path, ops, page):
-        if subprocess is None:
-            raise ValueError(
-                "This middleware requires the subprocess module from "
-                "Python 2.4")
-        proc = subprocess.Popen([wdg_path] + ops,
-                                shell=False,
-                                close_fds=True,
-                                stdout=subprocess.PIPE,
-                                stdin=subprocess.PIPE,
-                                stderr=subprocess.STDOUT)
-        stdout = proc.communicate(page)[0]
-        proc.wait()
-        return stdout
-            
-    def add_error(self, html_page, html_errors):
-        add_text = ('<pre style="background-color: #ffd; color: #600; '
-                    'border: 1px solid #000;">%s</pre>'
-                    % cgi.escape(html_errors))
-        match = self._end_body_regex.search(html_page)
-        if match:
-            return [html_page[:match.start()]
-                    + add_text
-                    + html_page[match.end():]]
-        else:
-            return [html_page + add_text]
-
-def make_wdg_validate_middleware(
-    app, global_conf, wdg_path='validate'):
-    """
-    Wraps the application in the WDG validator from
-    http://www.htmlhelp.com/tools/validator/
-
-    Validation errors are appended to the text of each page.
-    You can configure this by giving the path to the validate
-    executable (by default picked up from $PATH)
-    """
-    return WDGValidateMiddleware(
-        app, global_conf, wdg_path=wdg_path)

+ 0 - 372
desktop/core/ext-py/Paste-1.7.2/paste/errordocument.py

@@ -1,372 +0,0 @@
-# (c) 2005-2006 James Gardner <james@pythonweb.org>
-# This module is part of the Python Paste Project and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
-"""
-Middleware to display error documents for certain status codes
-
-The middleware in this module can be used to intercept responses with
-specified status codes and internally forward the request to an appropriate
-URL where the content can be displayed to the user as an error document.
-"""
-
-import warnings
-from urlparse import urlparse
-from paste.recursive import ForwardRequestException, RecursiveMiddleware
-from paste.util import converters
-from paste.response import replace_header
-
-def forward(app, codes):
-    """
-    Intercepts a response with a particular status code and returns the 
-    content from a specified URL instead.
-    
-    The arguments are:
-    
-    ``app``
-        The WSGI application or middleware chain.
-
-    ``codes``
-        A dictionary of integer status codes and the URL to be displayed
-        if the response uses that code.
-        
-    For example, you might want to create a static file to display a 
-    "File Not Found" message at the URL ``/error404.html`` and then use
-    ``forward`` middleware to catch all 404 status codes and display the page
-    you created. In this example ``app`` is your exisiting WSGI 
-    applicaiton::
-
-        from paste.errordocument import forward
-        app = forward(app, codes={404:'/error404.html'})
-
-    """
-    for code in codes:
-        if not isinstance(code, int):
-            raise TypeError('All status codes should be type int. '
-                '%s is not valid'%repr(code))
-                
-    def error_codes_mapper(code, message, environ, global_conf, codes):
-        if codes.has_key(code):
-            return codes[code]
-        else:
-            return None
-
-    #return _StatusBasedRedirect(app, error_codes_mapper, codes=codes)
-    return RecursiveMiddleware(
-        StatusBasedForward(
-            app, 
-            error_codes_mapper, 
-            codes=codes,
-        )
-    )
-
-class StatusKeeper(object):
-    def __init__(self, app, status, url, headers):
-        self.app = app
-        self.status = status
-        self.url = url
-        self.headers = headers
-
-    def __call__(self, environ, start_response):
-        def keep_status_start_response(status, headers, exc_info=None):
-            for header, value in headers:
-                if header.lower() == 'set-cookie':
-                    self.headers.append((header, value))
-                else:
-                    replace_header(self.headers, header, value)
-            return start_response(self.status, self.headers, exc_info)
-        parts = self.url.split('?')
-        environ['PATH_INFO'] = parts[0]
-        if len(parts) > 1:
-            environ['QUERY_STRING'] = parts[1]
-        else:
-            environ['QUERY_STRING'] = ''
-        #raise Exception(self.url, self.status)
-        return self.app(environ, keep_status_start_response)
-        
-class StatusBasedForward(object):
-    """
-    Middleware that lets you test a response against a custom mapper object to
-    programatically determine whether to internally forward to another URL and
-    if so, which URL to forward to.
-    
-    If you don't need the full power of this middleware you might choose to use
-    the simpler ``forward`` middleware instead.
-
-    The arguments are:
-    
-    ``app``
-        The WSGI application or middleware chain.
-        
-    ``mapper`` 
-        A callable that takes a status code as the
-        first parameter, a message as the second, and accepts optional environ,
-        global_conf and named argments afterwards. It should return a
-        URL to forward to or ``None`` if the code is not to be intercepted.
-
-    ``global_conf``
-        Optional default configuration from your config file. If ``debug`` is
-        set to ``true`` a message will be written to ``wsgi.errors`` on each
-        internal forward stating the URL forwarded to.
-    
-    ``**params`` 
-        Optional, any other configuration and extra arguments you wish to 
-        pass which will in turn be passed back to the custom mapper object.
-
-    Here is an example where a ``404 File Not Found`` status response would be
-    redirected to the URL ``/error?code=404&message=File%20Not%20Found``. This 
-    could be useful for passing the status code and message into another 
-    application to display an error document:
-    
-    .. code-block:: python
-    
-        from paste.errordocument import StatusBasedForward
-        from paste.recursive import RecursiveMiddleware
-        from urllib import urlencode
-        
-        def error_mapper(code, message, environ, global_conf, kw)
-            if code in [404, 500]:
-                params = urlencode({'message':message, 'code':code})
-                url = '/error?'%(params)
-                return url
-            else:
-                return None
-    
-        app = RecursiveMiddleware(
-            StatusBasedForward(app, mapper=error_mapper),
-        )
-
-    """
-
-    def __init__(self, app, mapper, global_conf=None, **params):
-        if global_conf is None:
-            global_conf = {}
-        # @@: global_conf shouldn't really come in here, only in a
-        # separate make_status_based_forward function
-        if global_conf:
-            self.debug = converters.asbool(global_conf.get('debug', False))
-        else:
-            self.debug = False
-        self.application = app
-        self.mapper = mapper
-        self.global_conf = global_conf
-        self.params = params
-
-    def __call__(self, environ, start_response):
-        url = []
-        
-        def change_response(status, headers, exc_info=None):
-            status_code = status.split(' ')
-            try:
-                code = int(status_code[0])
-            except (ValueError, TypeError):
-                raise Exception(
-                    'StatusBasedForward middleware '
-                    'received an invalid status code %s'%repr(status_code[0])
-                )
-            message = ' '.join(status_code[1:])
-            new_url = self.mapper(
-                code, 
-                message, 
-                environ, 
-                self.global_conf, 
-                **self.params
-            )
-            if not (new_url == None or isinstance(new_url, str)):
-                raise TypeError(
-                    'Expected the url to internally '
-                    'redirect to in the StatusBasedForward mapper'
-                    'to be a string or None, not %s'%repr(new_url)
-                )
-            if new_url:
-                url.append([new_url, status, headers])
-            else:
-                return start_response(status, headers, exc_info)
-
-        app_iter = self.application(environ, change_response)
-        if url:
-            if hasattr(app_iter, 'close'):
-                app_iter.close()
-
-            def factory(app):
-                return StatusKeeper(app, status=url[0][1], url=url[0][0],
-                                    headers=url[0][2])
-            raise ForwardRequestException(factory=factory)
-        else:
-            return app_iter
-
-def make_errordocument(app, global_conf, **kw):
-    """
-    Paste Deploy entry point to create a error document wrapper. 
-    
-    Use like::
-
-        [filter-app:main]
-        use = egg:Paste#errordocument
-        next = real-app
-        500 = /lib/msg/500.html
-        404 = /lib/msg/404.html
-    """
-    map = {}
-    for status, redir_loc in kw.items():
-        try:
-            status = int(status)
-        except ValueError:
-            raise ValueError('Bad status code: %r' % status)
-        map[status] = redir_loc
-    forwarder = forward(app, map)
-    return forwarder
-
-__pudge_all__ = [
-    'forward',
-    'make_errordocument',
-    'empty_error',
-    'make_empty_error',
-    'StatusBasedForward',
-]
-
-
-###############################################################################
-## Deprecated
-###############################################################################
-
-def custom_forward(app, mapper, global_conf=None, **kw):
-    """
-    Deprectated; use StatusBasedForward instead.
-    """
-    warnings.warn(
-        "errordocuments.custom_forward has been deprecated; please "
-        "use errordocuments.StatusBasedForward",
-        DeprecationWarning, 2)
-    if global_conf is None:
-        global_conf = {}
-    return _StatusBasedRedirect(app, mapper, global_conf, **kw)
-
-class _StatusBasedRedirect(object):
-    """
-    Deprectated; use StatusBasedForward instead.
-    """
-    def __init__(self, app, mapper, global_conf=None, **kw):
-
-        warnings.warn(
-            "errordocuments._StatusBasedRedirect has been deprecated; please "
-            "use errordocuments.StatusBasedForward",
-            DeprecationWarning, 2)
-
-        if global_conf is None:
-            global_conf = {}
-        self.application = app
-        self.mapper = mapper
-        self.global_conf = global_conf
-        self.kw = kw
-        self.fallback_template = """
-            <html>
-            <head>
-            <title>Error %(code)s</title>
-            </html>
-            <body>
-            <h1>Error %(code)s</h1>
-            <p>%(message)s</p>
-            <hr>
-            <p>
-                Additionally an error occurred trying to produce an 
-                error document.  A description of the error was logged
-                to <tt>wsgi.errors</tt>.
-            </p>
-            </body>
-            </html>                
-        """
-        
-    def __call__(self, environ, start_response):
-        url = []
-        code_message = []
-        try:
-            def change_response(status, headers, exc_info=None):
-                new_url = None
-                parts = status.split(' ')
-                try:
-                    code = int(parts[0])
-                except ValueError, TypeError:
-                    raise Exception(
-                        '_StatusBasedRedirect middleware '
-                        'received an invalid status code %s'%repr(parts[0])
-                    )
-                message = ' '.join(parts[1:])
-                new_url = self.mapper(
-                    code, 
-                    message, 
-                    environ, 
-                    self.global_conf, 
-                    self.kw
-                )
-                if not (new_url == None or isinstance(new_url, str)):
-                    raise TypeError(
-                        'Expected the url to internally '
-                        'redirect to in the _StatusBasedRedirect error_mapper'
-                        'to be a string or None, not %s'%repr(new_url)
-                    )
-                if new_url:
-                    url.append(new_url)
-                code_message.append([code, message])
-                return start_response(status, headers, exc_info)
-            app_iter = self.application(environ, change_response)
-        except:
-            try:
-                import sys
-                error = str(sys.exc_info()[1])
-            except:
-                error = ''
-            try:
-                code, message = code_message[0]
-            except:
-                code, message = ['', '']
-            environ['wsgi.errors'].write(
-                'Error occurred in _StatusBasedRedirect '
-                'intercepting the response: '+str(error)
-            )
-            return [self.fallback_template
-                    % {'message': message, 'code': code}]
-        else:
-            if url:
-                url_ = url[0]
-                new_environ = {}
-                for k, v in environ.items():
-                    if k != 'QUERY_STRING':
-                        new_environ['QUERY_STRING'] = urlparse(url_)[4]
-                    else:
-                        new_environ[k] = v
-                class InvalidForward(Exception):
-                    pass
-                def eat_start_response(status, headers, exc_info=None):
-                    """
-                    We don't want start_response to do anything since it
-                    has already been called
-                    """
-                    if status[:3] != '200':
-                        raise InvalidForward(
-                            "The URL %s to internally forward "
-                            "to in order to create an error document did not "
-                            "return a '200' status code." % url_
-                        )
-                forward = environ['paste.recursive.forward']
-                old_start_response = forward.start_response
-                forward.start_response = eat_start_response
-                try:
-                    app_iter = forward(url_, new_environ)
-                except InvalidForward, e:
-                    code, message = code_message[0]
-                    environ['wsgi.errors'].write(
-                        'Error occurred in '
-                        '_StatusBasedRedirect redirecting '
-                        'to new URL: '+str(url[0])
-                    )
-                    return [
-                        self.fallback_template%{
-                            'message':message,
-                            'code':code,
-                        }
-                    ]
-                else:
-                    forward.start_response = old_start_response
-                    return app_iter
-            else:
-                return app_iter

+ 0 - 7
desktop/core/ext-py/Paste-1.7.2/paste/evalexception/__init__.py

@@ -1,7 +0,0 @@
-# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
-# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
-"""
-An exception handler for interactive debugging
-"""
-from paste.evalexception.middleware import EvalException
-

+ 0 - 68
desktop/core/ext-py/Paste-1.7.2/paste/evalexception/evalcontext.py

@@ -1,68 +0,0 @@
-# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
-# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
-from cStringIO import StringIO
-import traceback
-import threading
-import pdb
-import sys
-
-exec_lock = threading.Lock()
-
-class EvalContext(object):
-
-    """
-    Class that represents a interactive interface.  It has its own
-    namespace.  Use eval_context.exec_expr(expr) to run commands; the
-    output of those commands is returned, as are print statements.
-
-    This is essentially what doctest does, and is taken directly from
-    doctest.
-    """
-
-    def __init__(self, namespace, globs):
-        self.namespace = namespace
-        self.globs = globs
-
-    def exec_expr(self, s):
-        out = StringIO()
-        exec_lock.acquire()
-        save_stdout = sys.stdout
-        try:
-            debugger = _OutputRedirectingPdb(save_stdout)
-            debugger.reset()
-            pdb.set_trace = debugger.set_trace
-            sys.stdout = out
-            try:
-                code = compile(s, '<web>', "single", 0, 1)
-                exec code in self.namespace, self.globs
-                debugger.set_continue()
-            except KeyboardInterrupt:
-                raise
-            except:
-                traceback.print_exc(file=out)
-                debugger.set_continue()
-        finally:
-            sys.stdout = save_stdout
-            exec_lock.release()
-        return out.getvalue()
-
-# From doctest
-class _OutputRedirectingPdb(pdb.Pdb):
-    """
-    A specialized version of the python debugger that redirects stdout
-    to a given stream when interacting with the user.  Stdout is *not*
-    redirected when traced code is executed.
-    """
-    def __init__(self, out):
-        self.__out = out
-        pdb.Pdb.__init__(self)
-
-    def trace_dispatch(self, *args):
-        # Redirect stdout to the given stream.
-        save_stdout = sys.stdout
-        sys.stdout = self.__out
-        # Call Pdb's trace dispatch method.
-        try:
-            return pdb.Pdb.trace_dispatch(self, *args)
-        finally:
-            sys.stdout = save_stdout

+ 0 - 161
desktop/core/ext-py/Paste-1.7.2/paste/evalexception/media/debug.js

@@ -1,161 +0,0 @@
-function showFrame(anchor) {
-    var tbid = anchor.getAttribute('tbid');
-    var expanded = anchor.expanded;
-    if (expanded) {
-        MochiKit.DOM.hideElement(anchor.expandedElement);
-        anchor.expanded = false;
-        _swapImage(anchor);
-        return false;
-    }
-    anchor.expanded = true;
-    if (anchor.expandedElement) {
-        MochiKit.DOM.showElement(anchor.expandedElement);
-        _swapImage(anchor);
-        $('debug_input_'+tbid).focus();
-        return false;
-    }
-    var url = debug_base
-        + '/show_frame?tbid=' + tbid
-        + '&debugcount=' + debug_count;
-    var d = MochiKit.Async.doSimpleXMLHttpRequest(url);
-    d.addCallbacks(function (data) {
-        var el = MochiKit.DOM.DIV({});
-        anchor.parentNode.insertBefore(el, anchor.nextSibling);
-        el.innerHTML = data.responseText;
-        anchor.expandedElement = el;
-        _swapImage(anchor);
-        $('debug_input_'+tbid).focus();
-    }, function (error) {
-        showError(error.req.responseText);
-    });
-    return false;
-}
-
-function _swapImage(anchor) {
-    var el = anchor.getElementsByTagName('IMG')[0];
-    if (anchor.expanded) {
-        var img = 'minus.jpg';
-    } else {
-        var img = 'plus.jpg';
-    }
-    el.src = debug_base + '/media/' + img;
-}
-
-function submitInput(button, tbid) {
-    var input = $(button.getAttribute('input-from'));
-    var output = $(button.getAttribute('output-to'));
-    var url = debug_base
-        + '/exec_input';
-    var history = input.form.history;
-    input.historyPosition = 0;
-    if (! history) {
-        history = input.form.history = [];
-    }
-    history.push(input.value);
-    var vars = {
-        tbid: tbid,
-        debugcount: debug_count,
-        input: input.value
-    };
-    MochiKit.DOM.showElement(output);
-    var d = MochiKit.Async.doSimpleXMLHttpRequest(url, vars);
-    d.addCallbacks(function (data) {
-        var result = data.responseText;
-        output.innerHTML += result;
-        input.value = '';
-        input.focus();
-    }, function (error) {
-        showError(error.req.responseText);
-    });
-    return false;
-}
-
-function showError(msg) {
-    var el = $('error-container');
-    if (el.innerHTML) {
-        el.innerHTML += '<hr noshade>\n' + msg;
-    } else {
-        el.innerHTML = msg;
-    }
-    MochiKit.DOM.showElement('error-area');
-}
-
-function clearError() {
-    var el = $('error-container');
-    el.innerHTML = '';
-    MochiKit.DOM.hideElement('error-area');
-}
-
-function expandInput(button) {
-    var input = button.form.elements.input;
-    stdops = {
-        name: 'input',
-        style: 'width: 100%',
-        autocomplete: 'off'
-    };
-    if (input.tagName == 'INPUT') {
-        var newEl = MochiKit.DOM.TEXTAREA(stdops);
-        var text = 'Contract';
-    } else {
-        stdops['type'] = 'text';
-        stdops['onkeypress'] = 'upArrow(this)';
-        var newEl = MochiKit.DOM.INPUT(stdops);
-        var text = 'Expand';
-    }
-    newEl.value = input.value;
-    newEl.id = input.id;
-    MochiKit.DOM.swapDOM(input, newEl);
-    newEl.focus();
-    button.value = text;
-    return false;
-}
-
-function upArrow(input, event) {
-    if (window.event) {
-        event = window.event;
-    }
-    if (event.keyCode != 38 && event.keyCode != 40) {
-        // not an up- or down-arrow
-        return true;
-    }
-    var dir = event.keyCode == 38 ? 1 : -1;
-    var history = input.form.history;
-    if (! history) {
-        history = input.form.history = [];
-    }
-    var pos = input.historyPosition || 0;
-    if (! pos && dir == -1) {
-        return true;
-    }
-    if (! pos && input.value) {
-        history.push(input.value);
-        pos = 1;
-    }
-    pos += dir;
-    if (history.length-pos < 0) {
-        pos = 1;
-    }
-    if (history.length-pos > history.length-1) {
-        input.value = '';
-        return true;
-    }
-    input.historyPosition = pos;
-    var line = history[history.length-pos];
-    input.value = line;
-}
-
-function expandLong(anchor) {
-    var span = anchor;
-    while (span) {
-        if (span.style && span.style.display == 'none') {
-            break;
-        }
-        span = span.nextSibling;
-    }
-    if (! span) {
-        return false;
-    }
-    MochiKit.DOM.showElement(span);
-    MochiKit.DOM.hideElement(anchor);
-    return false;
-}

Някои файлове не бяха показани, защото твърде много файлове са промени