Showing preview only (2,163K chars total). Download the full file or copy to clipboard to get everything.
Repository: GoogleCloudPlatform/appengine-flask-skeleton
Branch: master
Commit: 8c25461d003a
Files: 194
Total size: 2.0 MB
Directory structure:
gitextract_vdmaijab/
├── .gitignore
├── .playground
├── CONTRIB.md
├── LICENSE
├── README.md
├── app.yaml
├── appengine_config.py
├── lib/
│ ├── Flask-0.10.dist-info/
│ │ ├── DESCRIPTION.rst
│ │ ├── METADATA
│ │ ├── RECORD
│ │ ├── WHEEL
│ │ ├── metadata.json
│ │ └── top_level.txt
│ ├── Jinja2-2.8.dist-info/
│ │ ├── DESCRIPTION.rst
│ │ ├── METADATA
│ │ ├── RECORD
│ │ ├── WHEEL
│ │ ├── entry_points.txt
│ │ ├── metadata.json
│ │ └── top_level.txt
│ ├── MarkupSafe-0.23.dist-info/
│ │ ├── DESCRIPTION.rst
│ │ ├── METADATA
│ │ ├── RECORD
│ │ ├── WHEEL
│ │ ├── metadata.json
│ │ └── top_level.txt
│ ├── README.md
│ ├── Werkzeug-0.11.dist-info/
│ │ ├── DESCRIPTION.rst
│ │ ├── METADATA
│ │ ├── RECORD
│ │ ├── WHEEL
│ │ ├── metadata.json
│ │ └── top_level.txt
│ ├── flask/
│ │ ├── __init__.py
│ │ ├── _compat.py
│ │ ├── app.py
│ │ ├── blueprints.py
│ │ ├── config.py
│ │ ├── ctx.py
│ │ ├── debughelpers.py
│ │ ├── ext/
│ │ │ └── __init__.py
│ │ ├── exthook.py
│ │ ├── globals.py
│ │ ├── helpers.py
│ │ ├── json.py
│ │ ├── logging.py
│ │ ├── module.py
│ │ ├── sessions.py
│ │ ├── signals.py
│ │ ├── templating.py
│ │ ├── testing.py
│ │ ├── testsuite/
│ │ │ ├── __init__.py
│ │ │ ├── appctx.py
│ │ │ ├── basic.py
│ │ │ ├── blueprints.py
│ │ │ ├── config.py
│ │ │ ├── deprecations.py
│ │ │ ├── examples.py
│ │ │ ├── ext.py
│ │ │ ├── helpers.py
│ │ │ ├── regression.py
│ │ │ ├── reqctx.py
│ │ │ ├── signals.py
│ │ │ ├── static/
│ │ │ │ └── index.html
│ │ │ ├── subclassing.py
│ │ │ ├── templates/
│ │ │ │ ├── _macro.html
│ │ │ │ ├── context_template.html
│ │ │ │ ├── escaping_template.html
│ │ │ │ ├── mail.txt
│ │ │ │ ├── nested/
│ │ │ │ │ └── nested.txt
│ │ │ │ ├── simple_template.html
│ │ │ │ ├── template_filter.html
│ │ │ │ └── template_test.html
│ │ │ ├── templating.py
│ │ │ ├── test_apps/
│ │ │ │ ├── blueprintapp/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ └── apps/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── admin/
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ ├── static/
│ │ │ │ │ │ │ ├── css/
│ │ │ │ │ │ │ │ └── test.css
│ │ │ │ │ │ │ └── test.txt
│ │ │ │ │ │ └── templates/
│ │ │ │ │ │ └── admin/
│ │ │ │ │ │ └── index.html
│ │ │ │ │ └── frontend/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ └── templates/
│ │ │ │ │ └── frontend/
│ │ │ │ │ └── index.html
│ │ │ │ ├── config_module_app.py
│ │ │ │ ├── config_package_app/
│ │ │ │ │ └── __init__.py
│ │ │ │ ├── flask_broken/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ └── b.py
│ │ │ │ ├── flask_newext_package/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ └── submodule.py
│ │ │ │ ├── flask_newext_simple.py
│ │ │ │ ├── flaskext/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── oldext_package/
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ └── submodule.py
│ │ │ │ │ └── oldext_simple.py
│ │ │ │ ├── importerror.py
│ │ │ │ ├── lib/
│ │ │ │ │ └── python2.5/
│ │ │ │ │ └── site-packages/
│ │ │ │ │ ├── SiteEgg.egg
│ │ │ │ │ ├── site_app.py
│ │ │ │ │ └── site_package/
│ │ │ │ │ └── __init__.py
│ │ │ │ ├── main_app.py
│ │ │ │ ├── moduleapp/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ └── apps/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ ├── admin/
│ │ │ │ │ │ ├── __init__.py
│ │ │ │ │ │ ├── static/
│ │ │ │ │ │ │ ├── css/
│ │ │ │ │ │ │ │ └── test.css
│ │ │ │ │ │ │ └── test.txt
│ │ │ │ │ │ └── templates/
│ │ │ │ │ │ └── index.html
│ │ │ │ │ └── frontend/
│ │ │ │ │ ├── __init__.py
│ │ │ │ │ └── templates/
│ │ │ │ │ └── index.html
│ │ │ │ ├── path/
│ │ │ │ │ └── installed_package/
│ │ │ │ │ └── __init__.py
│ │ │ │ └── subdomaintestmodule/
│ │ │ │ ├── __init__.py
│ │ │ │ └── static/
│ │ │ │ └── hello.txt
│ │ │ ├── testing.py
│ │ │ └── views.py
│ │ ├── views.py
│ │ └── wrappers.py
│ ├── itsdangerous-0.24.dist-info/
│ │ ├── DESCRIPTION.rst
│ │ ├── METADATA
│ │ ├── RECORD
│ │ ├── WHEEL
│ │ ├── metadata.json
│ │ └── top_level.txt
│ ├── itsdangerous.py
│ ├── jinja2/
│ │ ├── __init__.py
│ │ ├── _compat.py
│ │ ├── _stringdefs.py
│ │ ├── bccache.py
│ │ ├── compiler.py
│ │ ├── constants.py
│ │ ├── debug.py
│ │ ├── defaults.py
│ │ ├── environment.py
│ │ ├── exceptions.py
│ │ ├── ext.py
│ │ ├── filters.py
│ │ ├── lexer.py
│ │ ├── loaders.py
│ │ ├── meta.py
│ │ ├── nodes.py
│ │ ├── optimizer.py
│ │ ├── parser.py
│ │ ├── runtime.py
│ │ ├── sandbox.py
│ │ ├── tests.py
│ │ ├── utils.py
│ │ └── visitor.py
│ ├── markupsafe/
│ │ ├── __init__.py
│ │ ├── _compat.py
│ │ ├── _constants.py
│ │ ├── _native.py
│ │ ├── _speedups.c
│ │ └── tests.py
│ └── werkzeug/
│ ├── __init__.py
│ ├── _compat.py
│ ├── _internal.py
│ ├── _reloader.py
│ ├── contrib/
│ │ ├── __init__.py
│ │ ├── atom.py
│ │ ├── cache.py
│ │ ├── fixers.py
│ │ ├── iterio.py
│ │ ├── jsrouting.py
│ │ ├── limiter.py
│ │ ├── lint.py
│ │ ├── profiler.py
│ │ ├── securecookie.py
│ │ ├── sessions.py
│ │ ├── testtools.py
│ │ └── wrappers.py
│ ├── datastructures.py
│ ├── debug/
│ │ ├── __init__.py
│ │ ├── console.py
│ │ ├── repr.py
│ │ ├── shared/
│ │ │ ├── FONT_LICENSE
│ │ │ ├── debugger.js
│ │ │ ├── jquery.js
│ │ │ └── style.css
│ │ └── tbtools.py
│ ├── exceptions.py
│ ├── filesystem.py
│ ├── formparser.py
│ ├── http.py
│ ├── local.py
│ ├── posixemulation.py
│ ├── routing.py
│ ├── script.py
│ ├── security.py
│ ├── serving.py
│ ├── test.py
│ ├── testapp.py
│ ├── urls.py
│ ├── useragents.py
│ ├── utils.py
│ ├── wrappers.py
│ └── wsgi.py
├── main.py
└── requirements.txt
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
*.pyc
# don't include third-party dependencies.
!lib/README.md
.DS_Store
================================================
FILE: .playground
================================================
{
"template_name" : "Flask web framework",
"template_description" : "Skeleton app based on Flask microframework (http://flask.pocoo.org/)",
"open_files": ["main.py"]
}
================================================
FILE: CONTRIB.md
================================================
# How to become a contributor and submit your own code
## Contributor License Agreements
We'd love to accept your sample apps and patches! Before we can take them, we have to jump a couple of legal hurdles.
Please fill out either the individual or corporate Contributor License Agreement (CLA).
* If you are an individual writing original source code and you're sure you own the intellectual property, then you'll need to sign an [individual CLA](http://code.google.com/legal/individual-cla-v1.0.html).
* If you work for a company that wants to allow you to contribute your work, then you'll need to sign a [corporate CLA](http://code.google.com/legal/corporate-cla-v1.0.html).
Follow either of the two links above to access the appropriate CLA and instructions for how to sign and return it. Once we receive it, we'll be able to accept your pull requests.
## Contributing A Patch
1. Submit an issue describing your proposed change to the repo in question.
1. The repo owner will respond to your issue promptly.
1. If your proposed change is accepted, and you haven't already done so, sign a Contributor License Agreement (see details above).
1. Fork the desired repo, develop and test your code changes.
1. Ensure that your code adheres to the existing style in the sample to which you are contributing. Refer to the [Google Cloud Platform Samples Style Guide](https://github.com/GoogleCloudPlatform/Template/wiki/style.html) for the recommended coding standards for this organization.
1. Ensure that your code has an appropriate set of unit tests which all pass.
1. Submit a pull request.
## Contributing A New Sample App
1. Submit an issue to the GoogleCloudPlatform/Template repo describing your proposed sample app.
1. The Template repo owner will respond to your enhancement issue promptly. Instructional value is the top priority when evaluating new app proposals for this collection of repos.
1. If your proposal is accepted, and you haven't already done so, sign a Contributor License Agreement (see details above).
1. Create your own repo for your app following this naming convention:
* {product}-{app-name}-{language}
* products: appengine, compute, storage, bigquery, prediction, cloudsql
* example: appengine-guestbook-python
* For multi-product apps, concatenate the primary products, like this: compute-appengine-demo-suite-python.
* For multi-language apps, concatenate the primary languages like this: appengine-sockets-python-java-go.
1. Clone the README.md, CONTRIB.md and LICENSE files from the GoogleCloudPlatform/Template repo.
1. Ensure that your code adheres to the existing style in the sample to which you are contributing. Refer to the [Google Cloud Platform Samples Style Guide](https://github.com/GoogleCloudPlatform/Template/wiki/style.html) for the recommended coding standards for this organization.
1. Ensure that your code has an appropriate set of unit tests which all pass.
1. Submit a request to fork your repo in GoogleCloudPlatform organizationt via your proposal issue.
================================================
FILE: LICENSE
================================================
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
================================================
FILE: README.md
================================================

This project is no longer actively developed or maintained.
For new work on this check out [flask Hello World](https://github.com/GoogleCloudPlatform/python-docs-samples/tree/master/appengine/standard/flask/hello_world).
## Python Flask Skeleton for Google App Engine
A skeleton for building Python applications on Google App Engine with the
[Flask micro framework](http://flask.pocoo.org).
See our other [Google Cloud Platform github
repos](https://github.com/GoogleCloudPlatform) for sample applications and
scaffolding for other python frameworks and use cases.
## Run Locally
1. Install the [App Engine Python SDK](https://developers.google.com/appengine/downloads).
See the README file for directions. You'll need python 2.7 and [pip 1.4 or later](http://www.pip-installer.org/en/latest/installing.html) installed too.
2. Clone this repo with
```
git clone https://github.com/GoogleCloudPlatform/appengine-flask-skeleton.git
```
3. Install dependencies in the project's lib directory.
Note: App Engine can only import libraries from inside your project directory.
```
cd appengine-flask-skeleton
pip install -r requirements.txt -t lib
```
4. Run this project locally from the command line:
```
dev_appserver.py .
```
Visit the application [http://localhost:8080](http://localhost:8080)
See [the development server documentation](https://developers.google.com/appengine/docs/python/tools/devserver)
for options when running dev_appserver.
## Deploy
To deploy the application:
1. Use the [Admin Console](https://appengine.google.com) to create a
project/app id. (App id and project id are identical)
1. [Deploy the
application](https://developers.google.com/appengine/docs/python/tools/uploadinganapp) with
```
appcfg.py update -A <your-project-id> -V v1 .
```
If this isn't your first deployment, you will need to set the new version as the default version with
```
appcfg.py set_default_version -V v1 -A <your-project-id>
```
1. Congratulations! Your application is now live at your-app-id.appspot.com
## Next Steps
This skeleton includes `TODO` markers to help you find basic areas you will want
to customize.
### Relational Databases and Datastore
To add persistence to your models, use
[NDB](https://developers.google.com/appengine/docs/python/ndb/) for
scale. Consider
[CloudSQL](https://developers.google.com/appengine/docs/python/cloud-sql)
if you need a relational database.
### Installing Libraries
See the [Third party
libraries](https://developers.google.com/appengine/docs/python/tools/libraries27)
page for libraries that are already included in the SDK. To include SDK
libraries, add them in your app.yaml file. Other than libraries included in
the SDK, only pure python libraries may be added to an App Engine project.
### Feedback
Star this repo if you found it useful. Use the github issue tracker to give
feedback on this repo.
## Contributing changes
See [CONTRIB.md](CONTRIB.md)
## Licensing
See [LICENSE](LICENSE)
## Author
Logan Henriquez and Johan Euphrosine
================================================
FILE: app.yaml
================================================
# This file specifies your Python application's runtime configuration
# including URL routing, versions, static file uploads, etc. See
# https://developers.google.com/appengine/docs/python/config/appconfig
# for details.
runtime: python27
api_version: 1
threadsafe: yes
# Handlers define how to route requests to your application.
handlers:
# App Engine serves and caches static files contained in the listed directories
# (and subdirectories). Uncomment and set the directory as needed.
#- url: /client
# static_dir: client
# This handler tells app engine how to route requests to a WSGI application.
# The script value is in the format <path.to.module>.<wsgi_application>
# where <wsgi_application> is a WSGI application object.
- url: .* # This regex directs all routes to main.app
script: main.app
# Third party libraries that are included in the App Engine SDK must be listed
# here if you want to use them. See
# https://developers.google.com/appengine/docs/python/tools/libraries27 for
# a list of libraries included in the SDK. Third party libs that are *not* part
# of the App Engine SDK don't need to be listed here, instead add them to your
# project directory, either as a git submodule or as a plain subdirectory.
# TODO: List any other App Engine SDK libs you may need here.
#libraries:
#- name: jinja2
# version: latest
================================================
FILE: appengine_config.py
================================================
"""
`appengine_config.py` is automatically loaded when Google App Engine
starts a new instance of your application. This runs before any
WSGI applications specified in app.yaml are loaded.
"""
from google.appengine.ext import vendor
# Third-party libraries are stored in "lib", vendoring will make
# sure that they are importable by the application.
vendor.add('lib')
================================================
FILE: lib/Flask-0.10.dist-info/DESCRIPTION.rst
================================================
Flask
-----
Flask is a microframework for Python based on Werkzeug, Jinja 2 and good
intentions. And before you ask: It's BSD licensed!
Flask is Fun
````````````
.. code:: python
from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello World!"
if __name__ == "__main__":
app.run()
And Easy to Setup
`````````````````
.. code:: bash
$ pip install Flask
$ python hello.py
* Running on http://localhost:5000/
Links
`````
* `website <http://flask.pocoo.org/>`_
* `documentation <http://flask.pocoo.org/docs/>`_
* `development version
<http://github.com/mitsuhiko/flask/zipball/master#egg=Flask-dev>`_
================================================
FILE: lib/Flask-0.10.dist-info/METADATA
================================================
Metadata-Version: 2.0
Name: Flask
Version: 0.10
Summary: A microframework based on Werkzeug, Jinja2 and good intentions
Home-page: http://github.com/mitsuhiko/flask/
Author: Armin Ronacher
Author-email: armin.ronacher@active-4.com
License: BSD
Platform: any
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Dist: Werkzeug (>=0.7)
Requires-Dist: Jinja2 (>=2.4)
Requires-Dist: itsdangerous (>=0.21)
Flask
-----
Flask is a microframework for Python based on Werkzeug, Jinja 2 and good
intentions. And before you ask: It's BSD licensed!
Flask is Fun
````````````
.. code:: python
from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello World!"
if __name__ == "__main__":
app.run()
And Easy to Setup
`````````````````
.. code:: bash
$ pip install Flask
$ python hello.py
* Running on http://localhost:5000/
Links
`````
* `website <http://flask.pocoo.org/>`_
* `documentation <http://flask.pocoo.org/docs/>`_
* `development version
<http://github.com/mitsuhiko/flask/zipball/master#egg=Flask-dev>`_
================================================
FILE: lib/Flask-0.10.dist-info/RECORD
================================================
flask/__init__.py,sha256=Hmok7MXSW0QTF-6TCFPfRqpHlVq1zOihqSMnHfXysvo,1672
flask/_compat.py,sha256=ug9fCmzhMFE1ecCpZLvbHSTXluYCcLXt3_8SNwGNZyg,2164
flask/app.py,sha256=U7K6oLEhv59ZrIJEzfVfVcB33PYKRQQN2CYLalOaNSA,76786
flask/blueprints.py,sha256=OBo5Mkl_y54l0xPuLptXz54CDvvRX5tApMKIXyvykTk,16320
flask/config.py,sha256=NhTkQX2yFgPDZD-t3phxcS2kw6i2kA7RHgX0fDoHXbQ,6234
flask/ctx.py,sha256=Ka_Ql-ZgRU7z9aVkET0_WwwTKguaUozg3ezDcm-tUKY,14266
flask/debughelpers.py,sha256=iyJC--eX8ANvci4MsFbtwc_PkwVlbCrZGHCOnQsOHFs,3508
flask/exthook.py,sha256=dfW3DBBI8LyPrwacwZN8q0u0Q8gBBCXtocJ7wBnvgAs,5087
flask/globals.py,sha256=kNGf5b05C8AjTzZJhBUbbtgufgumOnAPk9g_LYh0Rv0,1137
flask/helpers.py,sha256=roTv_nwOjhAhUWvW-Uz_Ex9SLA32mEx_7vfZagZjizA,33793
flask/json.py,sha256=qPIc18Pd2jj3EDJMan1BmkYxhJKYKpBw4oPp8Z6b2uo,7530
flask/logging.py,sha256=EkiNIJbQyeUb8nipAURO8CQJwC4BESjkM_snQIRCeIc,1398
flask/module.py,sha256=2J_pmW7jaFye1FtNTn5jfX-HxBqMc9EZzSLUXxiV-7c,1363
flask/sessions.py,sha256=X0yDRq4cpKluFlDupBDFAouQxJWP09sSES8pKnXpcPg,12882
flask/signals.py,sha256=DmcQfKzlPdLoY00fxf2BsH3SsDFiFSppCbX9Yfdv_ng,2140
flask/templating.py,sha256=joMsvkTasZUJxdipA0BnrbfIMidzzBzPug-dIaW0Tzo,4707
flask/testing.py,sha256=C8b-44Ro9hsFH5-eBksgjBWLrPznESmX9rdMFBkIbp4,5003
flask/views.py,sha256=S2fRXcRsyy6FUKJ9tZh39LLH22vOeZvYMLZQKT1pc6Y,5642
flask/wrappers.py,sha256=67pssdNN3I4dKSVUVru5HNUteAeF2V6_7qpLZoVwmiI,6709
flask/ext/__init__.py,sha256=M97BrvCtJFgcWpt8Jo1qg2nLkQaGd-4whLkdHfi-rE8,842
flask/testsuite/__init__.py,sha256=zCtem4AVtj6_GSTxCFUHElbH3g6LYY9ApIr7NVUWmGU,7022
flask/testsuite/appctx.py,sha256=vt0c0gfqcUYXfJ7t2IRd3Gg0BzSaLKO2bx9d5Id7m6M,3116
flask/testsuite/basic.py,sha256=EX66aNjBKOt5I8PWcpstzTCsy2O1M29kSDxAwLeySPg,42765
flask/testsuite/blueprints.py,sha256=uLsqDu1AyTPeQJ6Ab1RHKPcYbo5s-7adSW5XSE1Fa0o,28089
flask/testsuite/config.py,sha256=h64-JdPdlU6a7O8YfwAEriYZ30yAD1c_vjjYgyJ-JzA,11820
flask/testsuite/deprecations.py,sha256=tsvmOrjcG1tV6vV4ySL5a7V4o77Tnf4wd_-yqVhUXIc,511
flask/testsuite/examples.py,sha256=KyCnXuKNFfBEAyPl12a-etPF_PRufrJGwP09zTvl714,942
flask/testsuite/ext.py,sha256=5jOofZijgqi5OmRV7YxB7RS-RY7HuSj3L90316yH_IY,5156
flask/testsuite/helpers.py,sha256=nSZ1xuJeOJWcK6_wSv_L3tl8OAe_zcaRT_IoPpZPcvg,21657
flask/testsuite/regression.py,sha256=QDMe2hkgu3lV8RaUhHsICciKWhSC6L2TaYe9qITlyL8,3198
flask/testsuite/reqctx.py,sha256=EriP7GP23zt3zWKabTvEzldvp0EqRe--v8W-ZKwCz9k,5960
flask/testsuite/signals.py,sha256=jclEzgHqRhPgM3uoxRbgmXIiFm_HWlrkqT5M0hBv5xw,4807
flask/testsuite/subclassing.py,sha256=TT-nltJBy1Xi1BxcdztGZ3hmMq9h_nk1CVeSy9qBrXQ,1214
flask/testsuite/templating.py,sha256=2lg2-MPMGkmlKap9M711uVXC08iZU8w3EtmTI2la_N8,11237
flask/testsuite/testing.py,sha256=ihNMpcAxZ3wArSjUvFuCaHSREgjQNV5UAS2W1vYSNt4,7411
flask/testsuite/views.py,sha256=2ThDMtk1zoMvuXzRuP1Wh3e_hgDwPtyu76TXycVyhqc,5068
flask/testsuite/static/index.html,sha256=f28C_muYEAWoHyfaubxti-TLB0wMjFZHII3e9TRsmsI,22
flask/testsuite/templates/_macro.html,sha256=XA2qnwpJpO3auSjZlKXODzeU4Fcnim12ie5lMXeL8ms,55
flask/testsuite/templates/context_template.html,sha256=hXvHzdggsqqO2eXRlb6EhGDTTzPIQicaMk2EibzagDQ,36
flask/testsuite/templates/escaping_template.html,sha256=ORPM3QIOIu_lWv9M101bPHZt-bmy8Biu2663aAoO50g,147
flask/testsuite/templates/mail.txt,sha256=8f9j1PxUo_deGbrpJuDdrii16qE-xtV9RU6mYPVE_64,14
flask/testsuite/templates/simple_template.html,sha256=d0akkxWQ1UQkDiL45b8nUvCE0KpL579DhioYlv713bE,23
flask/testsuite/templates/template_filter.html,sha256=ZIk3H4Oa8fDn62Ij6jDzdHukLj3RXGtmBnkEtgTUmQ0,25
flask/testsuite/templates/template_test.html,sha256=g3ZgUQN0PaOiz289_AxNeP3ICfR29ogzbQl3fCvxK_8,51
flask/testsuite/templates/nested/nested.txt,sha256=76PlNDtwDVWjZMPHRlBqSX95jY52e_RWZCJKZfRWkAU,11
flask/testsuite/test_apps/config_module_app.py,sha256=BaBJCCI4TcOc9Kc5OvlgmaCtfQH8D31xVZMLZ3FmyRE,101
flask/testsuite/test_apps/flask_newext_simple.py,sha256=IIsV29nQ37pV2Z3O8GQ5a33YkIlII8B0rbOqz5k4ZxQ,25
flask/testsuite/test_apps/importerror.py,sha256=gA8IjK673B4Rit7pYYnkspF2k9_zpztPmiMYgrwgzdk,46
flask/testsuite/test_apps/main_app.py,sha256=mah5bd5ObZV6bl4YbnJEEdQcr5NqgMFmZqcaAITIReE,90
flask/testsuite/test_apps/blueprintapp/__init__.py,sha256=OeOuAvS6IghuIekcXqfgPuoACL6JSxKw_xOpvgTx7lE,200
flask/testsuite/test_apps/blueprintapp/apps/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
flask/testsuite/test_apps/blueprintapp/apps/admin/__init__.py,sha256=L5kSKkfOewREXLveDLogxtGyF2UrkIczxo4PZrjYCl8,362
flask/testsuite/test_apps/blueprintapp/apps/admin/static/test.txt,sha256=lcPiuni6LR_rw5mxyjRmz8iMcifiSSNqPFlIrmLKzjY,11
flask/testsuite/test_apps/blueprintapp/apps/admin/static/css/test.css,sha256=F1DG-ABW3o6yAD9Nc6IzV9iYefZeOHhn59009LMJboY,18
flask/testsuite/test_apps/blueprintapp/apps/admin/templates/admin/index.html,sha256=2OWS6QYqxaarnZAWkLvam0P2QSodRNkA6M05eEOVLw4,21
flask/testsuite/test_apps/blueprintapp/apps/frontend/__init__.py,sha256=djItvU0fqQg-MOlVoJR3--6cYf4VT1SI0WFsQyjQk4o,204
flask/testsuite/test_apps/blueprintapp/apps/frontend/templates/frontend/index.html,sha256=hcC7DORSYxGNK5DAICVx1BeFVlzaanxcIhODQwm9rwg,24
flask/testsuite/test_apps/config_package_app/__init__.py,sha256=BaBJCCI4TcOc9Kc5OvlgmaCtfQH8D31xVZMLZ3FmyRE,101
flask/testsuite/test_apps/flask_broken/__init__.py,sha256=CDC0TTkjrjeLs7ZXzLwdjS0yFiE2DM9uZ65q927Xx-c,48
flask/testsuite/test_apps/flask_broken/b.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
flask/testsuite/test_apps/flask_newext_package/__init__.py,sha256=UX_8L5rL7scxeUhXbUklOXDzE16eQ0eSdykHJvCe9O4,26
flask/testsuite/test_apps/flask_newext_package/submodule.py,sha256=VBKM2Msdeq6F7ziaPiwTbcu9c4wAH4kKZH6FDUPi6zg,35
flask/testsuite/test_apps/flaskext/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
flask/testsuite/test_apps/flaskext/oldext_simple.py,sha256=fuHRIiStUQIS-JoiE_Vwkc_nRX3qkMETN1yBtEDQyck,25
flask/testsuite/test_apps/flaskext/oldext_package/__init__.py,sha256=u6W0k3--q15e2nTlDWvTA0gvu1EuvaJQGIb-y9gPe8A,26
flask/testsuite/test_apps/flaskext/oldext_package/submodule.py,sha256=VBKM2Msdeq6F7ziaPiwTbcu9c4wAH4kKZH6FDUPi6zg,35
flask/testsuite/test_apps/lib/python2.5/site-packages/site_app.py,sha256=yObUTJgzGrSHwp-eLsE-bMbGmKLogUdE6bCn7jQPR6A,42
flask/testsuite/test_apps/lib/python2.5/site-packages/SiteEgg.egg,sha256=fVBqIK3Yab7f_mM6B5dZO2zN1N9abqQKS1xRIbKNsgc,1218
flask/testsuite/test_apps/lib/python2.5/site-packages/site_package/__init__.py,sha256=yObUTJgzGrSHwp-eLsE-bMbGmKLogUdE6bCn7jQPR6A,42
flask/testsuite/test_apps/moduleapp/__init__.py,sha256=x5mMfvASdMFFNFp0tq2Fwpp_-9DxNlRwHIFxj_bhbnQ,188
flask/testsuite/test_apps/moduleapp/apps/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
flask/testsuite/test_apps/moduleapp/apps/admin/__init__.py,sha256=ESnyU_sz54kX22RJUOyciuHlGz0_c9d1qGxrzke9V7E,259
flask/testsuite/test_apps/moduleapp/apps/admin/static/test.txt,sha256=lcPiuni6LR_rw5mxyjRmz8iMcifiSSNqPFlIrmLKzjY,11
flask/testsuite/test_apps/moduleapp/apps/admin/static/css/test.css,sha256=F1DG-ABW3o6yAD9Nc6IzV9iYefZeOHhn59009LMJboY,18
flask/testsuite/test_apps/moduleapp/apps/admin/templates/index.html,sha256=2OWS6QYqxaarnZAWkLvam0P2QSodRNkA6M05eEOVLw4,21
flask/testsuite/test_apps/moduleapp/apps/frontend/__init__.py,sha256=qtVGS_XzTw3uxAyEcOi49uXB4o-u4ZEZLQrhwIUkEME,158
flask/testsuite/test_apps/moduleapp/apps/frontend/templates/index.html,sha256=hcC7DORSYxGNK5DAICVx1BeFVlzaanxcIhODQwm9rwg,24
flask/testsuite/test_apps/path/installed_package/__init__.py,sha256=yObUTJgzGrSHwp-eLsE-bMbGmKLogUdE6bCn7jQPR6A,42
flask/testsuite/test_apps/subdomaintestmodule/__init__.py,sha256=o7W5jKRXGVqfjwYKWjI3QX8WUztGxuVnGiZ-wSGd1Fk,74
flask/testsuite/test_apps/subdomaintestmodule/static/hello.txt,sha256=5PvE5WQoKT9dXkOTZ63vfG9F0iAysyTmSTX0dA4uiQI,16
Flask-0.10.dist-info/DESCRIPTION.rst,sha256=YsWE_jM8p5TWeiY2cuesAHH5JUW95FFaHKvruzGCg5o,694
Flask-0.10.dist-info/METADATA,sha256=pqbqQzdvCFKHyFRIFyxq9hyctjcYvH9MGStkHlbfBqk,1557
Flask-0.10.dist-info/metadata.json,sha256=nWJBE8_HRpsHM1zLFJsfFrxuzec2njoS7UDgZMpCiFE,1011
Flask-0.10.dist-info/RECORD,,
Flask-0.10.dist-info/top_level.txt,sha256=dvi65F6AeGWVU0TBpYiC04yM60-FX1gJFkK31IKQr5c,6
Flask-0.10.dist-info/WHEEL,sha256=54bVun1KfEBTJ68SHUmbxNPj80VxlQ0sHi4gZdGZXEY,92
flask/config.pyc,,
flask/testsuite/deprecations.pyc,,
flask/testsuite/test_apps/flaskext/oldext_package/__init__.pyc,,
flask/testsuite/test_apps/blueprintapp/__init__.pyc,,
flask/testsuite/regression.pyc,,
flask/module.pyc,,
flask/debughelpers.pyc,,
flask/testsuite/signals.pyc,,
flask/testsuite/examples.pyc,,
flask/testsuite/test_apps/blueprintapp/apps/frontend/__init__.pyc,,
flask/testsuite/test_apps/moduleapp/apps/__init__.pyc,,
flask/sessions.pyc,,
flask/logging.pyc,,
flask/testsuite/test_apps/path/installed_package/__init__.pyc,,
flask/testsuite/test_apps/flask_broken/__init__.pyc,,
flask/__init__.pyc,,
flask/testsuite/config.pyc,,
flask/testsuite/test_apps/importerror.pyc,,
flask/testsuite/test_apps/flaskext/oldext_simple.pyc,,
flask/testsuite/subclassing.pyc,,
flask/testsuite/__init__.pyc,,
flask/testsuite/test_apps/lib/python2.5/site-packages/site_package/__init__.pyc,,
flask/globals.pyc,,
flask/testsuite/test_apps/lib/python2.5/site-packages/site_app.pyc,,
flask/testsuite/test_apps/subdomaintestmodule/__init__.pyc,,
flask/views.pyc,,
flask/json.pyc,,
flask/testsuite/test_apps/flask_newext_simple.pyc,,
flask/testsuite/test_apps/flask_broken/b.pyc,,
flask/testsuite/test_apps/flask_newext_package/__init__.pyc,,
flask/testsuite/test_apps/config_module_app.pyc,,
flask/testsuite/blueprints.pyc,,
flask/testsuite/test_apps/flaskext/oldext_package/submodule.pyc,,
flask/blueprints.pyc,,
flask/testsuite/test_apps/flaskext/__init__.pyc,,
flask/exthook.pyc,,
flask/testsuite/test_apps/blueprintapp/apps/__init__.pyc,,
flask/testsuite/templating.pyc,,
flask/testsuite/test_apps/main_app.pyc,,
flask/testsuite/testing.pyc,,
flask/_compat.pyc,,
flask/ctx.pyc,,
flask/testsuite/test_apps/moduleapp/apps/admin/__init__.pyc,,
flask/testsuite/test_apps/moduleapp/__init__.pyc,,
flask/testsuite/appctx.pyc,,
flask/app.pyc,,
flask/ext/__init__.pyc,,
flask/testing.pyc,,
flask/wrappers.pyc,,
flask/testsuite/helpers.pyc,,
flask/helpers.pyc,,
flask/testsuite/test_apps/moduleapp/apps/frontend/__init__.pyc,,
flask/testsuite/views.pyc,,
flask/signals.pyc,,
flask/testsuite/test_apps/flask_newext_package/submodule.pyc,,
flask/testsuite/basic.pyc,,
flask/templating.pyc,,
flask/testsuite/test_apps/blueprintapp/apps/admin/__init__.pyc,,
flask/testsuite/reqctx.pyc,,
flask/testsuite/ext.pyc,,
flask/testsuite/test_apps/config_package_app/__init__.pyc,,
================================================
FILE: lib/Flask-0.10.dist-info/WHEEL
================================================
Wheel-Version: 1.0
Generator: bdist_wheel (0.24.0)
Root-Is-Purelib: true
Tag: py2-none-any
================================================
FILE: lib/Flask-0.10.dist-info/metadata.json
================================================
{"license": "BSD", "name": "Flask", "metadata_version": "2.0", "generator": "bdist_wheel (0.24.0)", "summary": "A microframework based on Werkzeug, Jinja2 and good intentions", "platform": "any", "run_requires": [{"requires": ["Werkzeug (>=0.7)", "Jinja2 (>=2.4)", "itsdangerous (>=0.21)"]}], "version": "0.10", "extensions": {"python.details": {"project_urls": {"Home": "http://github.com/mitsuhiko/flask/"}, "document_names": {"description": "DESCRIPTION.rst"}, "contacts": [{"role": "author", "email": "armin.ronacher@active-4.com", "name": "Armin Ronacher"}]}}, "classifiers": ["Development Status :: 4 - Beta", "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Software Development :: Libraries :: Python Modules"], "extras": []}
================================================
FILE: lib/Flask-0.10.dist-info/top_level.txt
================================================
flask
================================================
FILE: lib/Jinja2-2.8.dist-info/DESCRIPTION.rst
================================================
Jinja2
~~~~~~
Jinja2 is a template engine written in pure Python. It provides a
`Django`_ inspired non-XML syntax but supports inline expressions and
an optional `sandboxed`_ environment.
Nutshell
--------
Here a small example of a Jinja template::
{% extends 'base.html' %}
{% block title %}Memberlist{% endblock %}
{% block content %}
<ul>
{% for user in users %}
<li><a href="{{ user.url }}">{{ user.username }}</a></li>
{% endfor %}
</ul>
{% endblock %}
Philosophy
----------
Application logic is for the controller but don't try to make the life
for the template designer too hard by giving him too few functionality.
For more informations visit the new `Jinja2 webpage`_ and `documentation`_.
.. _sandboxed: http://en.wikipedia.org/wiki/Sandbox_(computer_security)
.. _Django: http://www.djangoproject.com/
.. _Jinja2 webpage: http://jinja.pocoo.org/
.. _documentation: http://jinja.pocoo.org/2/documentation/
================================================
FILE: lib/Jinja2-2.8.dist-info/METADATA
================================================
Metadata-Version: 2.0
Name: Jinja2
Version: 2.8
Summary: A small but fast and easy to use stand-alone template engine written in pure python.
Home-page: http://jinja.pocoo.org/
Author: Armin Ronacher
Author-email: armin.ronacher@active-4.com
License: BSD
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.3
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Text Processing :: Markup :: HTML
Requires-Dist: MarkupSafe
Provides-Extra: i18n
Requires-Dist: Babel (>=0.8); extra == 'i18n'
Jinja2
~~~~~~
Jinja2 is a template engine written in pure Python. It provides a
`Django`_ inspired non-XML syntax but supports inline expressions and
an optional `sandboxed`_ environment.
Nutshell
--------
Here a small example of a Jinja template::
{% extends 'base.html' %}
{% block title %}Memberlist{% endblock %}
{% block content %}
<ul>
{% for user in users %}
<li><a href="{{ user.url }}">{{ user.username }}</a></li>
{% endfor %}
</ul>
{% endblock %}
Philosophy
----------
Application logic is for the controller but don't try to make the life
for the template designer too hard by giving him too few functionality.
For more informations visit the new `Jinja2 webpage`_ and `documentation`_.
.. _sandboxed: http://en.wikipedia.org/wiki/Sandbox_(computer_security)
.. _Django: http://www.djangoproject.com/
.. _Jinja2 webpage: http://jinja.pocoo.org/
.. _documentation: http://jinja.pocoo.org/2/documentation/
================================================
FILE: lib/Jinja2-2.8.dist-info/RECORD
================================================
jinja2/__init__.py,sha256=c59bnaAFo63I7lYUZlO2UKHj8LPG3JACKnCrwWgvjGY,2326
jinja2/_compat.py,sha256=O4FnYOMi4HRBfoCKkX137tt3sR6HvpnQNcwqg8ARYog,3109
jinja2/_stringdefs.py,sha256=SFObWX5vSMeGNc_aSO3_B2EEmScCstFWtjS4K0YFBXk,404291
jinja2/bccache.py,sha256=EMN9fsvOpwK3DfxQ9F1lmWoxU2Qlo6AnNhPXTsMrw84,12793
jinja2/compiler.py,sha256=nQmoS6HpGwgDIC8UXkSdjPYiAjbVqZ-Gf4odO-SAR6E,63846
jinja2/constants.py,sha256=DCr-oKC2xQO-fkOQO3kXRJW7rEYgmcsMRNpPnM66YSU,1626
jinja2/debug.py,sha256=GEGHM8vFsNFF-kGc0_fwyj1ftMtuyaH4r0nyG-XA9Z8,11553
jinja2/defaults.py,sha256=eLMOE7JC52QwZBu5Gz4TPZqzoJy9IgV5EynL_pW7MUw,1057
jinja2/environment.py,sha256=jzJmujSFtxb1HvITO4TdUCOOA-hSZx0gHrxeDZ2VE-M,48120
jinja2/exceptions.py,sha256=Q9yZOUif-lhVj5BRw0ELjfBvEdBsB7xZobgOvC2qGy4,4428
jinja2/ext.py,sha256=X-1zCiut1cuxIteKPkJr3jb6odlVE1jciO8RnrMniPE,25072
jinja2/filters.py,sha256=R4x2flPfyzIjrtItzpGpK4LzBvx-NOlEXH9wD-ZBWtU,30115
jinja2/lexer.py,sha256=QyiQwAQVEE2YREZJLcA04F3yqv0XOwBbSlWaFW4xJ20,28425
jinja2/loaders.py,sha256=BgDCvmiB0gH_zPMf-6TMemqtJdrck3IyJ8g0kWUvFa0,17380
jinja2/meta.py,sha256=cxAOtMuSWWSQX2H8zhYsAtjNwRcNB8Zvs06Y-JlWnbk,4198
jinja2/nodes.py,sha256=YN6hfFa0WlfToG2r-Q-yhUkAUp0O9l8KulK53mOAVUo,28954
jinja2/optimizer.py,sha256=bNNKbo5SC5FBUm9dvP-I3GkiXZYBYIER7_g9hK77ZVI,2302
jinja2/parser.py,sha256=pjLfkZDg2IKJKt_ixNosV-RzwAja5GWYuVeBQumIRns,35442
jinja2/runtime.py,sha256=Ct36Q9-gVmKer45syS4j3thQ15T_DnLDh6CqvTcnPwQ,22530
jinja2/sandbox.py,sha256=qgH4CoBsF5NwGj0krqsCOw8sg2mXmfpZKnvmZEE-da4,13327
jinja2/tests.py,sha256=znB0L_k6wdKp_lQJvxboXwUXDy1HhFe5SSA888tHt_w,4131
jinja2/utils.py,sha256=pjbOhQJ5NYexu2MbjA66nBibudUkYcQRZbxvbYE0tFk,16560
jinja2/visitor.py,sha256=3hEAYD26xS_JiJBf4RfcqYPpiuR6efOH8Hh6om59eU8,3316
Jinja2-2.8.dist-info/DESCRIPTION.rst,sha256=CXIS1UnPSk5_lZBS6Lb8ko-3lqGfjsiUwNBLXCTj2lc,975
Jinja2-2.8.dist-info/entry_points.txt,sha256=NdzVcOrqyNyKDxD09aERj__3bFx2paZhizFDsKmVhiA,72
Jinja2-2.8.dist-info/METADATA,sha256=Vio5F8qaEVcGzaCV1rl8tIWEKsHUFSSSAfL0u9oMmGk,2061
Jinja2-2.8.dist-info/metadata.json,sha256=4TsqsSBwGwy0C2xF_uRZHYsRn2W5Lv4NUMBjTnXPldM,1275
Jinja2-2.8.dist-info/RECORD,,
Jinja2-2.8.dist-info/top_level.txt,sha256=PkeVWtLb3-CqjWi1fO29OCbj55EhX_chhKrCdrVe_zs,7
Jinja2-2.8.dist-info/WHEEL,sha256=AvR0WeTpDaxT645bl5FQxUK6NPsTls2ttpcGJg3j1Xg,110
jinja2/_compat.pyc,,
jinja2/sandbox.pyc,,
jinja2/_stringdefs.pyc,,
jinja2/bccache.pyc,,
jinja2/runtime.pyc,,
jinja2/utils.pyc,,
jinja2/debug.pyc,,
jinja2/parser.pyc,,
jinja2/defaults.pyc,,
jinja2/visitor.pyc,,
jinja2/ext.pyc,,
jinja2/lexer.pyc,,
jinja2/nodes.pyc,,
jinja2/environment.pyc,,
jinja2/compiler.pyc,,
jinja2/exceptions.pyc,,
jinja2/__init__.pyc,,
jinja2/meta.pyc,,
jinja2/loaders.pyc,,
jinja2/optimizer.pyc,,
jinja2/filters.pyc,,
jinja2/tests.pyc,,
jinja2/constants.pyc,,
================================================
FILE: lib/Jinja2-2.8.dist-info/WHEEL
================================================
Wheel-Version: 1.0
Generator: bdist_wheel (0.24.0)
Root-Is-Purelib: true
Tag: py2-none-any
Tag: py3-none-any
================================================
FILE: lib/Jinja2-2.8.dist-info/entry_points.txt
================================================
[babel.extractors]
jinja2 = jinja2.ext:babel_extract[i18n]
================================================
FILE: lib/Jinja2-2.8.dist-info/metadata.json
================================================
{"license": "BSD", "name": "Jinja2", "metadata_version": "2.0", "generator": "bdist_wheel (0.24.0)", "summary": "A small but fast and easy to use stand-alone template engine written in pure python.", "run_requires": [{"requires": ["Babel (>=0.8)"], "extra": "i18n"}, {"requires": ["MarkupSafe"]}], "version": "2.8", "extensions": {"python.details": {"project_urls": {"Home": "http://jinja.pocoo.org/"}, "document_names": {"description": "DESCRIPTION.rst"}, "contacts": [{"role": "author", "email": "armin.ronacher@active-4.com", "name": "Armin Ronacher"}]}, "python.exports": {"babel.extractors": {"jinja2": "jinja2.ext:babel_extract [i18n]"}}}, "classifiers": ["Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Text Processing :: Markup :: HTML"], "extras": ["i18n"]}
================================================
FILE: lib/Jinja2-2.8.dist-info/top_level.txt
================================================
jinja2
================================================
FILE: lib/MarkupSafe-0.23.dist-info/DESCRIPTION.rst
================================================
MarkupSafe
==========
Implements a unicode subclass that supports HTML strings:
>>> from markupsafe import Markup, escape
>>> escape("<script>alert(document.cookie);</script>")
Markup(u'<script>alert(document.cookie);</script>')
>>> tmpl = Markup("<em>%s</em>")
>>> tmpl % "Peter > Lustig"
Markup(u'<em>Peter > Lustig</em>')
If you want to make an object unicode that is not yet unicode
but don't want to lose the taint information, you can use the
`soft_unicode` function. (On Python 3 you can also use `soft_str` which
is a different name for the same function).
>>> from markupsafe import soft_unicode
>>> soft_unicode(42)
u'42'
>>> soft_unicode(Markup('foo'))
Markup(u'foo')
HTML Representations
--------------------
Objects can customize their HTML markup equivalent by overriding
the `__html__` function:
>>> class Foo(object):
... def __html__(self):
... return '<strong>Nice</strong>'
...
>>> escape(Foo())
Markup(u'<strong>Nice</strong>')
>>> Markup(Foo())
Markup(u'<strong>Nice</strong>')
Silent Escapes
--------------
Since MarkupSafe 0.10 there is now also a separate escape function
called `escape_silent` that returns an empty string for `None` for
consistency with other systems that return empty strings for `None`
when escaping (for instance Pylons' webhelpers).
If you also want to use this for the escape method of the Markup
object, you can create your own subclass that does that::
from markupsafe import Markup, escape_silent as escape
class SilentMarkup(Markup):
__slots__ = ()
@classmethod
def escape(cls, s):
return cls(escape(s))
New-Style String Formatting
---------------------------
Starting with MarkupSafe 0.21 new style string formats from Python 2.6 and
3.x are now fully supported. Previously the escape behavior of those
functions was spotty at best. The new implementations operates under the
following algorithm:
1. if an object has an ``__html_format__`` method it is called as
replacement for ``__format__`` with the format specifier. It either
has to return a string or markup object.
2. if an object has an ``__html__`` method it is called.
3. otherwise the default format system of Python kicks in and the result
is HTML escaped.
Here is how you can implement your own formatting::
class User(object):
def __init__(self, id, username):
self.id = id
self.username = username
def __html_format__(self, format_spec):
if format_spec == 'link':
return Markup('<a href="/user/{0}">{1}</a>').format(
self.id,
self.__html__(),
)
elif format_spec:
raise ValueError('Invalid format spec')
return self.__html__()
def __html__(self):
return Markup('<span class=user>{0}</span>').format(self.username)
And to format that user:
>>> user = User(1, 'foo')
>>> Markup('<p>User: {0:link}').format(user)
Markup(u'<p>User: <a href="/user/1"><span class=user>foo</span></a>')
================================================
FILE: lib/MarkupSafe-0.23.dist-info/METADATA
================================================
Metadata-Version: 2.0
Name: MarkupSafe
Version: 0.23
Summary: Implements a XML/HTML/XHTML Markup safe string for Python
Home-page: http://github.com/mitsuhiko/markupsafe
Author: Armin Ronacher
Author-email: armin.ronacher@active-4.com
License: BSD
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Text Processing :: Markup :: HTML
MarkupSafe
==========
Implements a unicode subclass that supports HTML strings:
>>> from markupsafe import Markup, escape
>>> escape("<script>alert(document.cookie);</script>")
Markup(u'<script>alert(document.cookie);</script>')
>>> tmpl = Markup("<em>%s</em>")
>>> tmpl % "Peter > Lustig"
Markup(u'<em>Peter > Lustig</em>')
If you want to make an object unicode that is not yet unicode
but don't want to lose the taint information, you can use the
`soft_unicode` function. (On Python 3 you can also use `soft_str` which
is a different name for the same function).
>>> from markupsafe import soft_unicode
>>> soft_unicode(42)
u'42'
>>> soft_unicode(Markup('foo'))
Markup(u'foo')
HTML Representations
--------------------
Objects can customize their HTML markup equivalent by overriding
the `__html__` function:
>>> class Foo(object):
... def __html__(self):
... return '<strong>Nice</strong>'
...
>>> escape(Foo())
Markup(u'<strong>Nice</strong>')
>>> Markup(Foo())
Markup(u'<strong>Nice</strong>')
Silent Escapes
--------------
Since MarkupSafe 0.10 there is now also a separate escape function
called `escape_silent` that returns an empty string for `None` for
consistency with other systems that return empty strings for `None`
when escaping (for instance Pylons' webhelpers).
If you also want to use this for the escape method of the Markup
object, you can create your own subclass that does that::
from markupsafe import Markup, escape_silent as escape
class SilentMarkup(Markup):
__slots__ = ()
@classmethod
def escape(cls, s):
return cls(escape(s))
New-Style String Formatting
---------------------------
Starting with MarkupSafe 0.21 new style string formats from Python 2.6 and
3.x are now fully supported. Previously the escape behavior of those
functions was spotty at best. The new implementations operates under the
following algorithm:
1. if an object has an ``__html_format__`` method it is called as
replacement for ``__format__`` with the format specifier. It either
has to return a string or markup object.
2. if an object has an ``__html__`` method it is called.
3. otherwise the default format system of Python kicks in and the result
is HTML escaped.
Here is how you can implement your own formatting::
class User(object):
def __init__(self, id, username):
self.id = id
self.username = username
def __html_format__(self, format_spec):
if format_spec == 'link':
return Markup('<a href="/user/{0}">{1}</a>').format(
self.id,
self.__html__(),
)
elif format_spec:
raise ValueError('Invalid format spec')
return self.__html__()
def __html__(self):
return Markup('<span class=user>{0}</span>').format(self.username)
And to format that user:
>>> user = User(1, 'foo')
>>> Markup('<p>User: {0:link}').format(user)
Markup(u'<p>User: <a href="/user/1"><span class=user>foo</span></a>')
================================================
FILE: lib/MarkupSafe-0.23.dist-info/RECORD
================================================
markupsafe/__init__.py,sha256=zFQpANILi3mCCALiPd6ZJdlW6ibu_hTKzikMXKXVtaM,10338
markupsafe/_compat.py,sha256=r1HE0CpcAZeb-AiTV9wITR91PeLHn0CzZ_XHkYoozpI,565
markupsafe/_constants.py,sha256=U_xybFQsyXKCgHSfranJnFzo-z9nn9fuBeSk243sE5Q,4795
markupsafe/_native.py,sha256=E2Un1ysOf-w45d18YCj8UelT5UP7Vt__IuFPYJ7YRIs,1187
markupsafe/_speedups.c,sha256=gZwPEM_0zcbAzJjPuPYXk97R67QR1uUGtDvOPsvirCA,5939
markupsafe/_speedups.so,sha256=5LwzbsIbi6XRYL1cFO-TEF5szplVD406i-FXsWCgcPU,26724
markupsafe/tests.py,sha256=RLI4eYI0ICNZwkoN638VHXf_fDu4d_jnvbGr22j58Ng,6107
MarkupSafe-0.23.dist-info/DESCRIPTION.rst,sha256=VnEbwPneiOkqh-nzxb0DUiGlcVGHuaDQjsNBLi-yNYw,3091
MarkupSafe-0.23.dist-info/METADATA,sha256=g-KikeSr9J7vagkJoCt0ViT2ORy9O4NYV7XtRu1Pni8,3879
MarkupSafe-0.23.dist-info/metadata.json,sha256=jNrdilCdPfPmCPCQj9EVQSAebHgG8jCtlhqsPMggI4s,901
MarkupSafe-0.23.dist-info/RECORD,,
MarkupSafe-0.23.dist-info/top_level.txt,sha256=qy0Plje5IJuvsCBjejJyhDCjEAdcDLK_2agVcex8Z6U,11
MarkupSafe-0.23.dist-info/WHEEL,sha256=xNbhRJkOYpM8X1K1ysQX8xjULvydXjcUxM96PNX_KQ8,109
markupsafe/_native.pyc,,
markupsafe/_constants.pyc,,
markupsafe/_compat.pyc,,
markupsafe/tests.pyc,,
markupsafe/__init__.pyc,,
================================================
FILE: lib/MarkupSafe-0.23.dist-info/WHEEL
================================================
Wheel-Version: 1.0
Generator: bdist_wheel (0.24.0)
Root-Is-Purelib: false
Tag: cp27-none-macosx_10_10_intel
================================================
FILE: lib/MarkupSafe-0.23.dist-info/metadata.json
================================================
{"summary": "Implements a XML/HTML/XHTML Markup safe string for Python", "metadata_version": "2.0", "license": "BSD", "extensions": {"python.details": {"project_urls": {"Home": "http://github.com/mitsuhiko/markupsafe"}, "contacts": [{"role": "author", "email": "armin.ronacher@active-4.com", "name": "Armin Ronacher"}], "document_names": {"description": "DESCRIPTION.rst"}}}, "generator": "bdist_wheel (0.24.0)", "classifiers": ["Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Text Processing :: Markup :: HTML"], "version": "0.23", "name": "MarkupSafe"}
================================================
FILE: lib/MarkupSafe-0.23.dist-info/top_level.txt
================================================
markupsafe
================================================
FILE: lib/README.md
================================================
This directory contains third-party dependencies installed with `pip`.
================================================
FILE: lib/Werkzeug-0.11.dist-info/DESCRIPTION.rst
================================================
Werkzeug
========
Werkzeug started as simple collection of various utilities for WSGI
applications and has become one of the most advanced WSGI utility
modules. It includes a powerful debugger, full featured request and
response objects, HTTP utilities to handle entity tags, cache control
headers, HTTP dates, cookie handling, file uploads, a powerful URL
routing system and a bunch of community contributed addon modules.
Werkzeug is unicode aware and doesn't enforce a specific template
engine, database adapter or anything else. It doesn't even enforce
a specific way of handling requests and leaves all that up to the
developer. It's most useful for end user applications which should work
on as many server environments as possible (such as blogs, wikis,
bulletin boards, etc.).
Details and example applications are available on the
`Werkzeug website <http://werkzeug.pocoo.org/>`_.
Features
--------
- unicode awareness
- request and response objects
- various utility functions for dealing with HTTP headers such as
`Accept` and `Cache-Control` headers.
- thread local objects with proper cleanup at request end
- an interactive debugger
- A simple WSGI server with support for threading and forking
with an automatic reloader.
- a flexible URL routing system with REST support.
- fully WSGI compatible
Development Version
-------------------
The Werkzeug development version can be installed by cloning the git
repository from `github`_::
git clone git@github.com:mitsuhiko/werkzeug.git
.. _github: http://github.com/mitsuhiko/werkzeug
================================================
FILE: lib/Werkzeug-0.11.dist-info/METADATA
================================================
Metadata-Version: 2.0
Name: Werkzeug
Version: 0.11
Summary: The Swiss Army knife of Python web development
Home-page: http://werkzeug.pocoo.org/
Author: Armin Ronacher
Author-email: armin.ronacher@active-4.com
License: BSD
Platform: any
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Werkzeug
========
Werkzeug started as simple collection of various utilities for WSGI
applications and has become one of the most advanced WSGI utility
modules. It includes a powerful debugger, full featured request and
response objects, HTTP utilities to handle entity tags, cache control
headers, HTTP dates, cookie handling, file uploads, a powerful URL
routing system and a bunch of community contributed addon modules.
Werkzeug is unicode aware and doesn't enforce a specific template
engine, database adapter or anything else. It doesn't even enforce
a specific way of handling requests and leaves all that up to the
developer. It's most useful for end user applications which should work
on as many server environments as possible (such as blogs, wikis,
bulletin boards, etc.).
Details and example applications are available on the
`Werkzeug website <http://werkzeug.pocoo.org/>`_.
Features
--------
- unicode awareness
- request and response objects
- various utility functions for dealing with HTTP headers such as
`Accept` and `Cache-Control` headers.
- thread local objects with proper cleanup at request end
- an interactive debugger
- A simple WSGI server with support for threading and forking
with an automatic reloader.
- a flexible URL routing system with REST support.
- fully WSGI compatible
Development Version
-------------------
The Werkzeug development version can be installed by cloning the git
repository from `github`_::
git clone git@github.com:mitsuhiko/werkzeug.git
.. _github: http://github.com/mitsuhiko/werkzeug
================================================
FILE: lib/Werkzeug-0.11.dist-info/RECORD
================================================
Werkzeug-0.11.dist-info/DESCRIPTION.rst,sha256=5sTwZ_Sj5aeEN8mlcOdNJ_ng40HiGazGmILLyTMX8o0,1595
Werkzeug-0.11.dist-info/METADATA,sha256=QX9osuhRKD2M0jRKGyVmOASL5y3INKSLtA4d0GSpsbM,2597
Werkzeug-0.11.dist-info/RECORD,,
Werkzeug-0.11.dist-info/WHEEL,sha256=GrqQvamwgBV4nLoJe0vhYRSWzWsx7xjlt74FT0SWYfE,110
Werkzeug-0.11.dist-info/metadata.json,sha256=3rlxBTLVZ6cqm8wuS4n6ZgpoywLEfrpXWVahLNaFoVM,1093
Werkzeug-0.11.dist-info/top_level.txt,sha256=QRyj2VjwJoQkrwjwFIOlB8Xg3r9un0NtqVHQF-15xaw,9
werkzeug/__init__.py,sha256=Nf_xs5zUQajNujPuiuiFWoGok3W9fmC-7BHJy8-2pok,6917
werkzeug/_compat.py,sha256=8c4U9o6A_TR9nKCcTbpZNxpqCXcXDVIbFawwKM2s92c,6311
werkzeug/_internal.py,sha256=IEScSoFtQ8KqFH_2ubdfscNAdQ2RIysyVupI5BR9W2U,13709
werkzeug/_reloader.py,sha256=glTJPAR6qz3hLYw7xsANeNlEvgEf_WeU2cTz66rUqK8,8548
werkzeug/datastructures.py,sha256=iQ4TqWXdHSXtL5srpP8t-6bEJEiKDkfiI8lHOl_A_kU,87447
werkzeug/exceptions.py,sha256=X7D6bNqLmXfftc-6kuifVGFaxngHbMm8QD4DSZ7K5vA,18609
werkzeug/filesystem.py,sha256=0_gjAftvnRBxoD6ZCssJDJztUjprsLC97eC_k4YRdXs,2174
werkzeug/formparser.py,sha256=ndLQxfmq-IeNUlee30WHfxq1YggzSO1l7QGeeFVr99M,21207
werkzeug/http.py,sha256=I4yzJHGnsaMW7kZQcWzNW9H7ijXT_iPR16jbN3jejVY,35031
werkzeug/local.py,sha256=vWF4ECvkbXoOWM4BThsU5qEzC2LwdiEn7WA-qEt8pvg,14123
werkzeug/posixemulation.py,sha256=xEF2Bxc-vUCPkiu4IbfWVd3LW7DROYAT-ExW6THqyzw,3519
werkzeug/routing.py,sha256=U6d5l9iRrntZXkhr-GFQUmz9KBM_YKSr1oVSB9Ppv5k,66260
werkzeug/script.py,sha256=DwaVDcXdaOTffdNvlBdLitxWXjKaRVT32VbhDtljFPY,11365
werkzeug/security.py,sha256=tuVc22OqoHV5K-TrYJmynCJJa12aUt9BQ3wR_vEPQ34,8971
werkzeug/serving.py,sha256=Jf2GLYlXLkVBShH4x3rHKdNBGNjT2pZHStSP0-1wF5Y,27228
werkzeug/test.py,sha256=nan0aDi3g5hyUzWCtaN3XL9HrbIsNNNgMNjwpfM6qMc,34152
werkzeug/testapp.py,sha256=3HQRW1sHZKXuAjCvFMet4KXtQG3loYTFnvn6LWt-4zI,9396
werkzeug/urls.py,sha256=xhJoL81fOOWH2W0MReJKW2-KoR0b3p4zYkcvqylw254,36634
werkzeug/useragents.py,sha256=uqpgPcJ5BfcCVh9nPIIl2r3duIrIuENmrbRqbAMmPDk,5418
werkzeug/utils.py,sha256=lkybtv_mq35zV1qhelvEcILTzrMUwZ9yon6E8XwapJE,22972
werkzeug/wrappers.py,sha256=lKYevpKD1-quk9Cop7bsFxt1eWJxU3h33HCnOI_YzSU,77011
werkzeug/wsgi.py,sha256=CP-hCwH8te4cFz1bzWJoITJ5j-7E4j55fBkmuyp8xvc,37881
werkzeug/contrib/__init__.py,sha256=f7PfttZhbrImqpr5Ezre8CXgwvcGUJK7zWNpO34WWrw,623
werkzeug/contrib/atom.py,sha256=rvijBrphjMzVObfuCR6ddu6aLwI_SiNiudu64OSTh4Q,15588
werkzeug/contrib/cache.py,sha256=4W2WCT9Hw6HEU8yME9GuU4Xf8e50r2K84ASMxhLb6tY,27983
werkzeug/contrib/fixers.py,sha256=MtN_YmENxoTsGvXGGERmtbQ62LaeFc5I2d1YifXNENA,10183
werkzeug/contrib/iterio.py,sha256=pTX36rYCKO_9IEoB5sIN5cFSYszI9zdx6YhquWovcPY,10814
werkzeug/contrib/jsrouting.py,sha256=QTmgeDoKXvNK02KzXgx9lr3cAH6fAzpwF5bBdPNvJPs,8564
werkzeug/contrib/limiter.py,sha256=iS8-ahPZ-JLRnmfIBzxpm7O_s3lPsiDMVWv7llAIDCI,1334
werkzeug/contrib/lint.py,sha256=UxVVvYwnKa5BqYJdgfAzNc2w834OKgguvN-wg8E1Dhc,12322
werkzeug/contrib/profiler.py,sha256=ISwCWvwVyGpDLRBRpLjo_qUWma6GXYBrTAco4PEQSHY,5151
werkzeug/contrib/securecookie.py,sha256=X-Ao_0NRDveW6K1Fhe4U42hHWBW8esCpA3VcBDpzWIk,12206
werkzeug/contrib/sessions.py,sha256=uAPcnyxaxEla-bUA13gKc3KK4mwSagdzbCZzyKl3PeE,12577
werkzeug/contrib/testtools.py,sha256=G9xN-qeihJlhExrIZMCahvQOIDxdL9NiX874jiiHFMs,2453
werkzeug/contrib/wrappers.py,sha256=Uv5FRO5OqKwOsNgkW2-FRcw0vUDe3uiaivjPNYWNfAk,10337
werkzeug/debug/__init__.py,sha256=GDFrgOvwQ5wXQ2q5EeVBKh6JUQS8zLFFkgY6UOWeKrs,13126
werkzeug/debug/console.py,sha256=B7uAu9Rk60siDnGlEt-A_q1ZR4zCtmxx5itg3X-BOxo,5599
werkzeug/debug/repr.py,sha256=NaoB89aHb0vuvdSWels-GWdeGDZp76uE4uSNZPX1jAM,9354
werkzeug/debug/tbtools.py,sha256=L5P5TkGEHc_Bc5duNosP6D4CNe7ieTo1oiPX8nKQdek,18402
werkzeug/debug/shared/FONT_LICENSE,sha256=LwAVEI1oYnvXiNMT9SnCH_TaLCxCpeHziDrMg0gPkAI,4673
werkzeug/debug/shared/console.png,sha256=bxax6RXXlvOij_KeqvSNX0ojJf83YbnZ7my-3Gx9w2A,507
werkzeug/debug/shared/debugger.js,sha256=PEMBoNuD6fUaNou8Km_ZvVmFcIA3z3k3jSEMWLW-cA0,6187
werkzeug/debug/shared/jquery.js,sha256=7LkWEzqTdpEfELxcZZlS6wAx5Ff13zZ83lYO2_ujj7g,95957
werkzeug/debug/shared/less.png,sha256=-4-kNRaXJSONVLahrQKUxMwXGm9R4OnZ9SxDGpHlIR4,191
werkzeug/debug/shared/more.png,sha256=GngN7CioHQoV58rH6ojnkYi8c_qED2Aka5FO5UXrReY,200
werkzeug/debug/shared/source.png,sha256=RoGcBTE4CyCB85GBuDGTFlAnUqxwTBiIfDqW15EpnUQ,818
werkzeug/debug/shared/style.css,sha256=7x1s8olZO1XHalqD4M9MWn9vRqQkA635S9_6zRoe220,6231
werkzeug/debug/shared/ubuntu.ttf,sha256=1eaHFyepmy4FyDvjLVzpITrGEBu_CZYY94jE0nED1c0,70220
werkzeug/_reloader.pyc,,
werkzeug/filesystem.pyc,,
werkzeug/contrib/testtools.pyc,,
werkzeug/formparser.pyc,,
werkzeug/_compat.pyc,,
werkzeug/posixemulation.pyc,,
werkzeug/serving.pyc,,
werkzeug/contrib/__init__.pyc,,
werkzeug/contrib/iterio.pyc,,
werkzeug/datastructures.pyc,,
werkzeug/__init__.pyc,,
werkzeug/contrib/limiter.pyc,,
werkzeug/debug/tbtools.pyc,,
werkzeug/contrib/sessions.pyc,,
werkzeug/local.pyc,,
werkzeug/utils.pyc,,
werkzeug/contrib/lint.pyc,,
werkzeug/security.pyc,,
werkzeug/contrib/cache.pyc,,
werkzeug/contrib/securecookie.pyc,,
werkzeug/script.pyc,,
werkzeug/routing.pyc,,
werkzeug/wrappers.pyc,,
werkzeug/contrib/jsrouting.pyc,,
werkzeug/contrib/fixers.pyc,,
werkzeug/contrib/profiler.pyc,,
werkzeug/debug/console.pyc,,
werkzeug/debug/__init__.pyc,,
werkzeug/wsgi.pyc,,
werkzeug/test.pyc,,
werkzeug/http.pyc,,
werkzeug/urls.pyc,,
werkzeug/useragents.pyc,,
werkzeug/_internal.pyc,,
werkzeug/contrib/wrappers.pyc,,
werkzeug/exceptions.pyc,,
werkzeug/contrib/atom.pyc,,
werkzeug/testapp.pyc,,
werkzeug/debug/repr.pyc,,
================================================
FILE: lib/Werkzeug-0.11.dist-info/WHEEL
================================================
Wheel-Version: 1.0
Generator: bdist_wheel (0.26.0)
Root-Is-Purelib: true
Tag: py2-none-any
Tag: py3-none-any
================================================
FILE: lib/Werkzeug-0.11.dist-info/metadata.json
================================================
{"generator": "bdist_wheel (0.26.0)", "summary": "The Swiss Army knife of Python web development", "classifiers": ["Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Software Development :: Libraries :: Python Modules"], "extensions": {"python.details": {"project_urls": {"Home": "http://werkzeug.pocoo.org/"}, "contacts": [{"email": "armin.ronacher@active-4.com", "name": "Armin Ronacher", "role": "author"}], "document_names": {"description": "DESCRIPTION.rst"}}}, "license": "BSD", "metadata_version": "2.0", "name": "Werkzeug", "platform": "any", "version": "0.11"}
================================================
FILE: lib/Werkzeug-0.11.dist-info/top_level.txt
================================================
werkzeug
================================================
FILE: lib/flask/__init__.py
================================================
# -*- coding: utf-8 -*-
"""
flask
~~~~~
A microframework based on Werkzeug. It's extensively documented
and follows best practice patterns.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
__version__ = '0.10'
# utilities we import from Werkzeug and Jinja2 that are unused
# in the module but are exported as public interface.
from werkzeug.exceptions import abort
from werkzeug.utils import redirect
from jinja2 import Markup, escape
from .app import Flask, Request, Response
from .config import Config
from .helpers import url_for, flash, send_file, send_from_directory, \
get_flashed_messages, get_template_attribute, make_response, safe_join, \
stream_with_context
from .globals import current_app, g, request, session, _request_ctx_stack, \
_app_ctx_stack
from .ctx import has_request_context, has_app_context, \
after_this_request, copy_current_request_context
from .module import Module
from .blueprints import Blueprint
from .templating import render_template, render_template_string
# the signals
from .signals import signals_available, template_rendered, request_started, \
request_finished, got_request_exception, request_tearing_down, \
appcontext_tearing_down, appcontext_pushed, \
appcontext_popped, message_flashed
# We're not exposing the actual json module but a convenient wrapper around
# it.
from . import json
# This was the only thing that flask used to export at one point and it had
# a more generic name.
jsonify = json.jsonify
# backwards compat, goes away in 1.0
from .sessions import SecureCookieSession as Session
json_available = True
================================================
FILE: lib/flask/_compat.py
================================================
# -*- coding: utf-8 -*-
"""
flask._compat
~~~~~~~~~~~~~
Some py2/py3 compatibility support based on a stripped down
version of six so we don't have to depend on a specific version
of it.
:copyright: (c) 2013 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import sys
PY2 = sys.version_info[0] == 2
_identity = lambda x: x
if not PY2:
text_type = str
string_types = (str,)
integer_types = (int, )
iterkeys = lambda d: iter(d.keys())
itervalues = lambda d: iter(d.values())
iteritems = lambda d: iter(d.items())
from io import StringIO
def reraise(tp, value, tb=None):
if value.__traceback__ is not tb:
raise value.with_traceback(tb)
raise value
implements_to_string = _identity
else:
text_type = unicode
string_types = (str, unicode)
integer_types = (int, long)
iterkeys = lambda d: d.iterkeys()
itervalues = lambda d: d.itervalues()
iteritems = lambda d: d.iteritems()
from cStringIO import StringIO
exec('def reraise(tp, value, tb=None):\n raise tp, value, tb')
def implements_to_string(cls):
cls.__unicode__ = cls.__str__
cls.__str__ = lambda x: x.__unicode__().encode('utf-8')
return cls
def with_metaclass(meta, *bases):
# This requires a bit of explanation: the basic idea is to make a
# dummy metaclass for one level of class instantiation that replaces
# itself with the actual metaclass. Because of internal type checks
# we also need to make sure that we downgrade the custom metaclass
# for one level to something closer to type (that's why __call__ and
# __init__ comes back from type etc.).
#
# This has the advantage over six.with_metaclass in that it does not
# introduce dummy classes into the final MRO.
class metaclass(meta):
__call__ = type.__call__
__init__ = type.__init__
def __new__(cls, name, this_bases, d):
if this_bases is None:
return type.__new__(cls, name, (), d)
return meta(name, bases, d)
return metaclass('temporary_class', None, {})
================================================
FILE: lib/flask/app.py
================================================
# -*- coding: utf-8 -*-
"""
flask.app
~~~~~~~~~
This module implements the central WSGI application object.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import os
import sys
from threading import Lock
from datetime import timedelta
from itertools import chain
from functools import update_wrapper
from werkzeug.datastructures import ImmutableDict
from werkzeug.routing import Map, Rule, RequestRedirect, BuildError
from werkzeug.exceptions import HTTPException, InternalServerError, \
MethodNotAllowed, BadRequest
from .helpers import _PackageBoundObject, url_for, get_flashed_messages, \
locked_cached_property, _endpoint_from_view_func, find_package
from . import json
from .wrappers import Request, Response
from .config import ConfigAttribute, Config
from .ctx import RequestContext, AppContext, _AppCtxGlobals
from .globals import _request_ctx_stack, request, session, g
from .sessions import SecureCookieSessionInterface
from .module import blueprint_is_module
from .templating import DispatchingJinjaLoader, Environment, \
_default_template_ctx_processor
from .signals import request_started, request_finished, got_request_exception, \
request_tearing_down, appcontext_tearing_down
from ._compat import reraise, string_types, text_type, integer_types
# a lock used for logger initialization
_logger_lock = Lock()
def _make_timedelta(value):
if not isinstance(value, timedelta):
return timedelta(seconds=value)
return value
def setupmethod(f):
"""Wraps a method so that it performs a check in debug mode if the
first request was already handled.
"""
def wrapper_func(self, *args, **kwargs):
if self.debug and self._got_first_request:
raise AssertionError('A setup function was called after the '
'first request was handled. This usually indicates a bug '
'in the application where a module was not imported '
'and decorators or other functionality was called too late.\n'
'To fix this make sure to import all your view modules, '
'database models and everything related at a central place '
'before the application starts serving requests.')
return f(self, *args, **kwargs)
return update_wrapper(wrapper_func, f)
class Flask(_PackageBoundObject):
"""The flask object implements a WSGI application and acts as the central
object. It is passed the name of the module or package of the
application. Once it is created it will act as a central registry for
the view functions, the URL rules, template configuration and much more.
The name of the package is used to resolve resources from inside the
package or the folder the module is contained in depending on if the
package parameter resolves to an actual python package (a folder with
an `__init__.py` file inside) or a standard module (just a `.py` file).
For more information about resource loading, see :func:`open_resource`.
Usually you create a :class:`Flask` instance in your main module or
in the `__init__.py` file of your package like this::
from flask import Flask
app = Flask(__name__)
.. admonition:: About the First Parameter
The idea of the first parameter is to give Flask an idea what
belongs to your application. This name is used to find resources
on the file system, can be used by extensions to improve debugging
information and a lot more.
So it's important what you provide there. If you are using a single
module, `__name__` is always the correct value. If you however are
using a package, it's usually recommended to hardcode the name of
your package there.
For example if your application is defined in `yourapplication/app.py`
you should create it with one of the two versions below::
app = Flask('yourapplication')
app = Flask(__name__.split('.')[0])
Why is that? The application will work even with `__name__`, thanks
to how resources are looked up. However it will make debugging more
painful. Certain extensions can make assumptions based on the
import name of your application. For example the Flask-SQLAlchemy
extension will look for the code in your application that triggered
an SQL query in debug mode. If the import name is not properly set
up, that debugging information is lost. (For example it would only
pick up SQL queries in `yourapplication.app` and not
`yourapplication.views.frontend`)
.. versionadded:: 0.7
The `static_url_path`, `static_folder`, and `template_folder`
parameters were added.
.. versionadded:: 0.8
The `instance_path` and `instance_relative_config` parameters were
added.
:param import_name: the name of the application package
:param static_url_path: can be used to specify a different path for the
static files on the web. Defaults to the name
of the `static_folder` folder.
:param static_folder: the folder with static files that should be served
at `static_url_path`. Defaults to the ``'static'``
folder in the root path of the application.
:param template_folder: the folder that contains the templates that should
be used by the application. Defaults to
``'templates'`` folder in the root path of the
application.
:param instance_path: An alternative instance path for the application.
By default the folder ``'instance'`` next to the
package or module is assumed to be the instance
path.
:param instance_relative_config: if set to `True` relative filenames
for loading the config are assumed to
be relative to the instance path instead
of the application root.
"""
#: The class that is used for request objects. See :class:`~flask.Request`
#: for more information.
request_class = Request
#: The class that is used for response objects. See
#: :class:`~flask.Response` for more information.
response_class = Response
#: The class that is used for the :data:`~flask.g` instance.
#:
#: Example use cases for a custom class:
#:
#: 1. Store arbitrary attributes on flask.g.
#: 2. Add a property for lazy per-request database connectors.
#: 3. Return None instead of AttributeError on expected attributes.
#: 4. Raise exception if an unexpected attr is set, a "controlled" flask.g.
#:
#: In Flask 0.9 this property was called `request_globals_class` but it
#: was changed in 0.10 to :attr:`app_ctx_globals_class` because the
#: flask.g object is not application context scoped.
#:
#: .. versionadded:: 0.10
app_ctx_globals_class = _AppCtxGlobals
# Backwards compatibility support
def _get_request_globals_class(self):
return self.app_ctx_globals_class
def _set_request_globals_class(self, value):
from warnings import warn
warn(DeprecationWarning('request_globals_class attribute is now '
'called app_ctx_globals_class'))
self.app_ctx_globals_class = value
request_globals_class = property(_get_request_globals_class,
_set_request_globals_class)
del _get_request_globals_class, _set_request_globals_class
#: The debug flag. Set this to `True` to enable debugging of the
#: application. In debug mode the debugger will kick in when an unhandled
#: exception occurs and the integrated server will automatically reload
#: the application if changes in the code are detected.
#:
#: This attribute can also be configured from the config with the `DEBUG`
#: configuration key. Defaults to `False`.
debug = ConfigAttribute('DEBUG')
#: The testing flag. Set this to `True` to enable the test mode of
#: Flask extensions (and in the future probably also Flask itself).
#: For example this might activate unittest helpers that have an
#: additional runtime cost which should not be enabled by default.
#:
#: If this is enabled and PROPAGATE_EXCEPTIONS is not changed from the
#: default it's implicitly enabled.
#:
#: This attribute can also be configured from the config with the
#: `TESTING` configuration key. Defaults to `False`.
testing = ConfigAttribute('TESTING')
#: If a secret key is set, cryptographic components can use this to
#: sign cookies and other things. Set this to a complex random value
#: when you want to use the secure cookie for instance.
#:
#: This attribute can also be configured from the config with the
#: `SECRET_KEY` configuration key. Defaults to `None`.
secret_key = ConfigAttribute('SECRET_KEY')
#: The secure cookie uses this for the name of the session cookie.
#:
#: This attribute can also be configured from the config with the
#: `SESSION_COOKIE_NAME` configuration key. Defaults to ``'session'``
session_cookie_name = ConfigAttribute('SESSION_COOKIE_NAME')
#: A :class:`~datetime.timedelta` which is used to set the expiration
#: date of a permanent session. The default is 31 days which makes a
#: permanent session survive for roughly one month.
#:
#: This attribute can also be configured from the config with the
#: `PERMANENT_SESSION_LIFETIME` configuration key. Defaults to
#: ``timedelta(days=31)``
permanent_session_lifetime = ConfigAttribute('PERMANENT_SESSION_LIFETIME',
get_converter=_make_timedelta)
#: Enable this if you want to use the X-Sendfile feature. Keep in
#: mind that the server has to support this. This only affects files
#: sent with the :func:`send_file` method.
#:
#: .. versionadded:: 0.2
#:
#: This attribute can also be configured from the config with the
#: `USE_X_SENDFILE` configuration key. Defaults to `False`.
use_x_sendfile = ConfigAttribute('USE_X_SENDFILE')
#: The name of the logger to use. By default the logger name is the
#: package name passed to the constructor.
#:
#: .. versionadded:: 0.4
logger_name = ConfigAttribute('LOGGER_NAME')
#: Enable the deprecated module support? This is active by default
#: in 0.7 but will be changed to False in 0.8. With Flask 1.0 modules
#: will be removed in favor of Blueprints
enable_modules = True
#: The logging format used for the debug logger. This is only used when
#: the application is in debug mode, otherwise the attached logging
#: handler does the formatting.
#:
#: .. versionadded:: 0.3
debug_log_format = (
'-' * 80 + '\n' +
'%(levelname)s in %(module)s [%(pathname)s:%(lineno)d]:\n' +
'%(message)s\n' +
'-' * 80
)
#: The JSON encoder class to use. Defaults to :class:`~flask.json.JSONEncoder`.
#:
#: .. versionadded:: 0.10
json_encoder = json.JSONEncoder
#: The JSON decoder class to use. Defaults to :class:`~flask.json.JSONDecoder`.
#:
#: .. versionadded:: 0.10
json_decoder = json.JSONDecoder
#: Options that are passed directly to the Jinja2 environment.
jinja_options = ImmutableDict(
extensions=['jinja2.ext.autoescape', 'jinja2.ext.with_']
)
#: Default configuration parameters.
default_config = ImmutableDict({
'DEBUG': False,
'TESTING': False,
'PROPAGATE_EXCEPTIONS': None,
'PRESERVE_CONTEXT_ON_EXCEPTION': None,
'SECRET_KEY': None,
'PERMANENT_SESSION_LIFETIME': timedelta(days=31),
'USE_X_SENDFILE': False,
'LOGGER_NAME': None,
'SERVER_NAME': None,
'APPLICATION_ROOT': None,
'SESSION_COOKIE_NAME': 'session',
'SESSION_COOKIE_DOMAIN': None,
'SESSION_COOKIE_PATH': None,
'SESSION_COOKIE_HTTPONLY': True,
'SESSION_COOKIE_SECURE': False,
'MAX_CONTENT_LENGTH': None,
'SEND_FILE_MAX_AGE_DEFAULT': 12 * 60 * 60, # 12 hours
'TRAP_BAD_REQUEST_ERRORS': False,
'TRAP_HTTP_EXCEPTIONS': False,
'PREFERRED_URL_SCHEME': 'http',
'JSON_AS_ASCII': True,
'JSON_SORT_KEYS': True,
'JSONIFY_PRETTYPRINT_REGULAR': True,
})
#: The rule object to use for URL rules created. This is used by
#: :meth:`add_url_rule`. Defaults to :class:`werkzeug.routing.Rule`.
#:
#: .. versionadded:: 0.7
url_rule_class = Rule
#: the test client that is used with when `test_client` is used.
#:
#: .. versionadded:: 0.7
test_client_class = None
#: the session interface to use. By default an instance of
#: :class:`~flask.sessions.SecureCookieSessionInterface` is used here.
#:
#: .. versionadded:: 0.8
session_interface = SecureCookieSessionInterface()
def __init__(self, import_name, static_path=None, static_url_path=None,
static_folder='static', template_folder='templates',
instance_path=None, instance_relative_config=False):
_PackageBoundObject.__init__(self, import_name,
template_folder=template_folder)
if static_path is not None:
from warnings import warn
warn(DeprecationWarning('static_path is now called '
'static_url_path'), stacklevel=2)
static_url_path = static_path
if static_url_path is not None:
self.static_url_path = static_url_path
if static_folder is not None:
self.static_folder = static_folder
if instance_path is None:
instance_path = self.auto_find_instance_path()
elif not os.path.isabs(instance_path):
raise ValueError('If an instance path is provided it must be '
'absolute. A relative path was given instead.')
#: Holds the path to the instance folder.
#:
#: .. versionadded:: 0.8
self.instance_path = instance_path
#: The configuration dictionary as :class:`Config`. This behaves
#: exactly like a regular dictionary but supports additional methods
#: to load a config from files.
self.config = self.make_config(instance_relative_config)
# Prepare the deferred setup of the logger.
self._logger = None
self.logger_name = self.import_name
#: A dictionary of all view functions registered. The keys will
#: be function names which are also used to generate URLs and
#: the values are the function objects themselves.
#: To register a view function, use the :meth:`route` decorator.
self.view_functions = {}
# support for the now deprecated `error_handlers` attribute. The
# :attr:`error_handler_spec` shall be used now.
self._error_handlers = {}
#: A dictionary of all registered error handlers. The key is `None`
#: for error handlers active on the application, otherwise the key is
#: the name of the blueprint. Each key points to another dictionary
#: where they key is the status code of the http exception. The
#: special key `None` points to a list of tuples where the first item
#: is the class for the instance check and the second the error handler
#: function.
#:
#: To register a error handler, use the :meth:`errorhandler`
#: decorator.
self.error_handler_spec = {None: self._error_handlers}
#: A list of functions that are called when :meth:`url_for` raises a
#: :exc:`~werkzeug.routing.BuildError`. Each function registered here
#: is called with `error`, `endpoint` and `values`. If a function
#: returns `None` or raises a `BuildError` the next function is
#: tried.
#:
#: .. versionadded:: 0.9
self.url_build_error_handlers = []
#: A dictionary with lists of functions that should be called at the
#: beginning of the request. The key of the dictionary is the name of
#: the blueprint this function is active for, `None` for all requests.
#: This can for example be used to open database connections or
#: getting hold of the currently logged in user. To register a
#: function here, use the :meth:`before_request` decorator.
self.before_request_funcs = {}
#: A lists of functions that should be called at the beginning of the
#: first request to this instance. To register a function here, use
#: the :meth:`before_first_request` decorator.
#:
#: .. versionadded:: 0.8
self.before_first_request_funcs = []
#: A dictionary with lists of functions that should be called after
#: each request. The key of the dictionary is the name of the blueprint
#: this function is active for, `None` for all requests. This can for
#: example be used to open database connections or getting hold of the
#: currently logged in user. To register a function here, use the
#: :meth:`after_request` decorator.
self.after_request_funcs = {}
#: A dictionary with lists of functions that are called after
#: each request, even if an exception has occurred. The key of the
#: dictionary is the name of the blueprint this function is active for,
#: `None` for all requests. These functions are not allowed to modify
#: the request, and their return values are ignored. If an exception
#: occurred while processing the request, it gets passed to each
#: teardown_request function. To register a function here, use the
#: :meth:`teardown_request` decorator.
#:
#: .. versionadded:: 0.7
self.teardown_request_funcs = {}
#: A list of functions that are called when the application context
#: is destroyed. Since the application context is also torn down
#: if the request ends this is the place to store code that disconnects
#: from databases.
#:
#: .. versionadded:: 0.9
self.teardown_appcontext_funcs = []
#: A dictionary with lists of functions that can be used as URL
#: value processor functions. Whenever a URL is built these functions
#: are called to modify the dictionary of values in place. The key
#: `None` here is used for application wide
#: callbacks, otherwise the key is the name of the blueprint.
#: Each of these functions has the chance to modify the dictionary
#:
#: .. versionadded:: 0.7
self.url_value_preprocessors = {}
#: A dictionary with lists of functions that can be used as URL value
#: preprocessors. The key `None` here is used for application wide
#: callbacks, otherwise the key is the name of the blueprint.
#: Each of these functions has the chance to modify the dictionary
#: of URL values before they are used as the keyword arguments of the
#: view function. For each function registered this one should also
#: provide a :meth:`url_defaults` function that adds the parameters
#: automatically again that were removed that way.
#:
#: .. versionadded:: 0.7
self.url_default_functions = {}
#: A dictionary with list of functions that are called without argument
#: to populate the template context. The key of the dictionary is the
#: name of the blueprint this function is active for, `None` for all
#: requests. Each returns a dictionary that the template context is
#: updated with. To register a function here, use the
#: :meth:`context_processor` decorator.
self.template_context_processors = {
None: [_default_template_ctx_processor]
}
#: all the attached blueprints in a dictionary by name. Blueprints
#: can be attached multiple times so this dictionary does not tell
#: you how often they got attached.
#:
#: .. versionadded:: 0.7
self.blueprints = {}
#: a place where extensions can store application specific state. For
#: example this is where an extension could store database engines and
#: similar things. For backwards compatibility extensions should register
#: themselves like this::
#:
#: if not hasattr(app, 'extensions'):
#: app.extensions = {}
#: app.extensions['extensionname'] = SomeObject()
#:
#: The key must match the name of the `flaskext` module. For example in
#: case of a "Flask-Foo" extension in `flaskext.foo`, the key would be
#: ``'foo'``.
#:
#: .. versionadded:: 0.7
self.extensions = {}
#: The :class:`~werkzeug.routing.Map` for this instance. You can use
#: this to change the routing converters after the class was created
#: but before any routes are connected. Example::
#:
#: from werkzeug.routing import BaseConverter
#:
#: class ListConverter(BaseConverter):
#: def to_python(self, value):
#: return value.split(',')
#: def to_url(self, values):
#: return ','.join(BaseConverter.to_url(value)
#: for value in values)
#:
#: app = Flask(__name__)
#: app.url_map.converters['list'] = ListConverter
self.url_map = Map()
# tracks internally if the application already handled at least one
# request.
self._got_first_request = False
self._before_request_lock = Lock()
# register the static folder for the application. Do that even
# if the folder does not exist. First of all it might be created
# while the server is running (usually happens during development)
# but also because google appengine stores static files somewhere
# else when mapped with the .yml file.
if self.has_static_folder:
self.add_url_rule(self.static_url_path + '/<path:filename>',
endpoint='static',
view_func=self.send_static_file)
def _get_error_handlers(self):
from warnings import warn
warn(DeprecationWarning('error_handlers is deprecated, use the '
'new error_handler_spec attribute instead.'), stacklevel=1)
return self._error_handlers
def _set_error_handlers(self, value):
self._error_handlers = value
self.error_handler_spec[None] = value
error_handlers = property(_get_error_handlers, _set_error_handlers)
del _get_error_handlers, _set_error_handlers
@locked_cached_property
def name(self):
"""The name of the application. This is usually the import name
with the difference that it's guessed from the run file if the
import name is main. This name is used as a display name when
Flask needs the name of the application. It can be set and overridden
to change the value.
.. versionadded:: 0.8
"""
if self.import_name == '__main__':
fn = getattr(sys.modules['__main__'], '__file__', None)
if fn is None:
return '__main__'
return os.path.splitext(os.path.basename(fn))[0]
return self.import_name
@property
def propagate_exceptions(self):
"""Returns the value of the `PROPAGATE_EXCEPTIONS` configuration
value in case it's set, otherwise a sensible default is returned.
.. versionadded:: 0.7
"""
rv = self.config['PROPAGATE_EXCEPTIONS']
if rv is not None:
return rv
return self.testing or self.debug
@property
def preserve_context_on_exception(self):
"""Returns the value of the `PRESERVE_CONTEXT_ON_EXCEPTION`
configuration value in case it's set, otherwise a sensible default
is returned.
.. versionadded:: 0.7
"""
rv = self.config['PRESERVE_CONTEXT_ON_EXCEPTION']
if rv is not None:
return rv
return self.debug
@property
def logger(self):
"""A :class:`logging.Logger` object for this application. The
default configuration is to log to stderr if the application is
in debug mode. This logger can be used to (surprise) log messages.
Here some examples::
app.logger.debug('A value for debugging')
app.logger.warning('A warning occurred (%d apples)', 42)
app.logger.error('An error occurred')
.. versionadded:: 0.3
"""
if self._logger and self._logger.name == self.logger_name:
return self._logger
with _logger_lock:
if self._logger and self._logger.name == self.logger_name:
return self._logger
from flask.logging import create_logger
self._logger = rv = create_logger(self)
return rv
@locked_cached_property
def jinja_env(self):
"""The Jinja2 environment used to load templates."""
return self.create_jinja_environment()
@property
def got_first_request(self):
"""This attribute is set to `True` if the application started
handling the first request.
.. versionadded:: 0.8
"""
return self._got_first_request
def make_config(self, instance_relative=False):
"""Used to create the config attribute by the Flask constructor.
The `instance_relative` parameter is passed in from the constructor
of Flask (there named `instance_relative_config`) and indicates if
the config should be relative to the instance path or the root path
of the application.
.. versionadded:: 0.8
"""
root_path = self.root_path
if instance_relative:
root_path = self.instance_path
return Config(root_path, self.default_config)
def auto_find_instance_path(self):
"""Tries to locate the instance path if it was not provided to the
constructor of the application class. It will basically calculate
the path to a folder named ``instance`` next to your main file or
the package.
.. versionadded:: 0.8
"""
prefix, package_path = find_package(self.import_name)
if prefix is None:
return os.path.join(package_path, 'instance')
return os.path.join(prefix, 'var', self.name + '-instance')
def open_instance_resource(self, resource, mode='rb'):
"""Opens a resource from the application's instance folder
(:attr:`instance_path`). Otherwise works like
:meth:`open_resource`. Instance resources can also be opened for
writing.
:param resource: the name of the resource. To access resources within
subfolders use forward slashes as separator.
:param mode: resource file opening mode, default is 'rb'.
"""
return open(os.path.join(self.instance_path, resource), mode)
def create_jinja_environment(self):
"""Creates the Jinja2 environment based on :attr:`jinja_options`
and :meth:`select_jinja_autoescape`. Since 0.7 this also adds
the Jinja2 globals and filters after initialization. Override
this function to customize the behavior.
.. versionadded:: 0.5
"""
options = dict(self.jinja_options)
if 'autoescape' not in options:
options['autoescape'] = self.select_jinja_autoescape
rv = Environment(self, **options)
rv.globals.update(
url_for=url_for,
get_flashed_messages=get_flashed_messages,
config=self.config,
# request, session and g are normally added with the
# context processor for efficiency reasons but for imported
# templates we also want the proxies in there.
request=request,
session=session,
g=g
)
rv.filters['tojson'] = json.tojson_filter
return rv
def create_global_jinja_loader(self):
"""Creates the loader for the Jinja2 environment. Can be used to
override just the loader and keeping the rest unchanged. It's
discouraged to override this function. Instead one should override
the :meth:`jinja_loader` function instead.
The global loader dispatches between the loaders of the application
and the individual blueprints.
.. versionadded:: 0.7
"""
return DispatchingJinjaLoader(self)
def init_jinja_globals(self):
"""Deprecated. Used to initialize the Jinja2 globals.
.. versionadded:: 0.5
.. versionchanged:: 0.7
This method is deprecated with 0.7. Override
:meth:`create_jinja_environment` instead.
"""
def select_jinja_autoescape(self, filename):
"""Returns `True` if autoescaping should be active for the given
template name.
.. versionadded:: 0.5
"""
if filename is None:
return False
return filename.endswith(('.html', '.htm', '.xml', '.xhtml'))
def update_template_context(self, context):
"""Update the template context with some commonly used variables.
This injects request, session, config and g into the template
context as well as everything template context processors want
to inject. Note that the as of Flask 0.6, the original values
in the context will not be overridden if a context processor
decides to return a value with the same key.
:param context: the context as a dictionary that is updated in place
to add extra variables.
"""
funcs = self.template_context_processors[None]
reqctx = _request_ctx_stack.top
if reqctx is not None:
bp = reqctx.request.blueprint
if bp is not None and bp in self.template_context_processors:
funcs = chain(funcs, self.template_context_processors[bp])
orig_ctx = context.copy()
for func in funcs:
context.update(func())
# make sure the original values win. This makes it possible to
# easier add new variables in context processors without breaking
# existing views.
context.update(orig_ctx)
def run(self, host=None, port=None, debug=None, **options):
"""Runs the application on a local development server. If the
:attr:`debug` flag is set the server will automatically reload
for code changes and show a debugger in case an exception happened.
If you want to run the application in debug mode, but disable the
code execution on the interactive debugger, you can pass
``use_evalex=False`` as parameter. This will keep the debugger's
traceback screen active, but disable code execution.
.. admonition:: Keep in Mind
Flask will suppress any server error with a generic error page
unless it is in debug mode. As such to enable just the
interactive debugger without the code reloading, you have to
invoke :meth:`run` with ``debug=True`` and ``use_reloader=False``.
Setting ``use_debugger`` to `True` without being in debug mode
won't catch any exceptions because there won't be any to
catch.
.. versionchanged:: 0.10
The default port is now picked from the ``SERVER_NAME`` variable.
:param host: the hostname to listen on. Set this to ``'0.0.0.0'`` to
have the server available externally as well. Defaults to
``'127.0.0.1'``.
:param port: the port of the webserver. Defaults to ``5000`` or the
port defined in the ``SERVER_NAME`` config variable if
present.
:param debug: if given, enable or disable debug mode.
See :attr:`debug`.
:param options: the options to be forwarded to the underlying
Werkzeug server. See
:func:`werkzeug.serving.run_simple` for more
information.
"""
from werkzeug.serving import run_simple
if host is None:
host = '127.0.0.1'
if port is None:
server_name = self.config['SERVER_NAME']
if server_name and ':' in server_name:
port = int(server_name.rsplit(':', 1)[1])
else:
port = 5000
if debug is not None:
self.debug = bool(debug)
options.setdefault('use_reloader', self.debug)
options.setdefault('use_debugger', self.debug)
try:
run_simple(host, port, self, **options)
finally:
# reset the first request information if the development server
# resetted normally. This makes it possible to restart the server
# without reloader and that stuff from an interactive shell.
self._got_first_request = False
def test_client(self, use_cookies=True):
"""Creates a test client for this application. For information
about unit testing head over to :ref:`testing`.
Note that if you are testing for assertions or exceptions in your
application code, you must set ``app.testing = True`` in order for the
exceptions to propagate to the test client. Otherwise, the exception
will be handled by the application (not visible to the test client) and
the only indication of an AssertionError or other exception will be a
500 status code response to the test client. See the :attr:`testing`
attribute. For example::
app.testing = True
client = app.test_client()
The test client can be used in a `with` block to defer the closing down
of the context until the end of the `with` block. This is useful if
you want to access the context locals for testing::
with app.test_client() as c:
rv = c.get('/?vodka=42')
assert request.args['vodka'] == '42'
See :class:`~flask.testing.FlaskClient` for more information.
.. versionchanged:: 0.4
added support for `with` block usage for the client.
.. versionadded:: 0.7
The `use_cookies` parameter was added as well as the ability
to override the client to be used by setting the
:attr:`test_client_class` attribute.
"""
cls = self.test_client_class
if cls is None:
from flask.testing import FlaskClient as cls
return cls(self, self.response_class, use_cookies=use_cookies)
def open_session(self, request):
"""Creates or opens a new session. Default implementation stores all
session data in a signed cookie. This requires that the
:attr:`secret_key` is set. Instead of overriding this method
we recommend replacing the :class:`session_interface`.
:param request: an instance of :attr:`request_class`.
"""
return self.session_interface.open_session(self, request)
def save_session(self, session, response):
"""Saves the session if it needs updates. For the default
implementation, check :meth:`open_session`. Instead of overriding this
method we recommend replacing the :class:`session_interface`.
:param session: the session to be saved (a
:class:`~werkzeug.contrib.securecookie.SecureCookie`
object)
:param response: an instance of :attr:`response_class`
"""
return self.session_interface.save_session(self, session, response)
def make_null_session(self):
"""Creates a new instance of a missing session. Instead of overriding
this method we recommend replacing the :class:`session_interface`.
.. versionadded:: 0.7
"""
return self.session_interface.make_null_session(self)
def register_module(self, module, **options):
"""Registers a module with this application. The keyword argument
of this function are the same as the ones for the constructor of the
:class:`Module` class and will override the values of the module if
provided.
.. versionchanged:: 0.7
The module system was deprecated in favor for the blueprint
system.
"""
assert blueprint_is_module(module), 'register_module requires ' \
'actual module objects. Please upgrade to blueprints though.'
if not self.enable_modules:
raise RuntimeError('Module support was disabled but code '
'attempted to register a module named %r' % module)
else:
from warnings import warn
warn(DeprecationWarning('Modules are deprecated. Upgrade to '
'using blueprints. Have a look into the documentation for '
'more information. If this module was registered by a '
'Flask-Extension upgrade the extension or contact the author '
'of that extension instead. (Registered %r)' % module),
stacklevel=2)
self.register_blueprint(module, **options)
@setupmethod
def register_blueprint(self, blueprint, **options):
"""Registers a blueprint on the application.
.. versionadded:: 0.7
"""
first_registration = False
if blueprint.name in self.blueprints:
assert self.blueprints[blueprint.name] is blueprint, \
'A blueprint\'s name collision occurred between %r and ' \
'%r. Both share the same name "%s". Blueprints that ' \
'are created on the fly need unique names.' % \
(blueprint, self.blueprints[blueprint.name], blueprint.name)
else:
self.blueprints[blueprint.name] = blueprint
first_registration = True
blueprint.register(self, options, first_registration)
@setupmethod
def add_url_rule(self, rule, endpoint=None, view_func=None, **options):
"""Connects a URL rule. Works exactly like the :meth:`route`
decorator. If a view_func is provided it will be registered with the
endpoint.
Basically this example::
@app.route('/')
def index():
pass
Is equivalent to the following::
def index():
pass
app.add_url_rule('/', 'index', index)
If the view_func is not provided you will need to connect the endpoint
to a view function like so::
app.view_functions['index'] = index
Internally :meth:`route` invokes :meth:`add_url_rule` so if you want
to customize the behavior via subclassing you only need to change
this method.
For more information refer to :ref:`url-route-registrations`.
.. versionchanged:: 0.2
`view_func` parameter added.
.. versionchanged:: 0.6
`OPTIONS` is added automatically as method.
:param rule: the URL rule as string
:param endpoint: the endpoint for the registered URL rule. Flask
itself assumes the name of the view function as
endpoint
:param view_func: the function to call when serving a request to the
provided endpoint
:param options: the options to be forwarded to the underlying
:class:`~werkzeug.routing.Rule` object. A change
to Werkzeug is handling of method options. methods
is a list of methods this rule should be limited
to (`GET`, `POST` etc.). By default a rule
just listens for `GET` (and implicitly `HEAD`).
Starting with Flask 0.6, `OPTIONS` is implicitly
added and handled by the standard request handling.
"""
if endpoint is None:
endpoint = _endpoint_from_view_func(view_func)
options['endpoint'] = endpoint
methods = options.pop('methods', None)
# if the methods are not given and the view_func object knows its
# methods we can use that instead. If neither exists, we go with
# a tuple of only `GET` as default.
if methods is None:
methods = getattr(view_func, 'methods', None) or ('GET',)
methods = set(methods)
# Methods that should always be added
required_methods = set(getattr(view_func, 'required_methods', ()))
# starting with Flask 0.8 the view_func object can disable and
# force-enable the automatic options handling.
provide_automatic_options = getattr(view_func,
'provide_automatic_options', None)
if provide_automatic_options is None:
if 'OPTIONS' not in methods:
provide_automatic_options = True
required_methods.add('OPTIONS')
else:
provide_automatic_options = False
# Add the required methods now.
methods |= required_methods
# due to a werkzeug bug we need to make sure that the defaults are
# None if they are an empty dictionary. This should not be necessary
# with Werkzeug 0.7
options['defaults'] = options.get('defaults') or None
rule = self.url_rule_class(rule, methods=methods, **options)
rule.provide_automatic_options = provide_automatic_options
self.url_map.add(rule)
if view_func is not None:
old_func = self.view_functions.get(endpoint)
if old_func is not None and old_func is not view_func:
raise AssertionError('View function mapping is overwriting an '
'existing endpoint function: %s' % endpoint)
self.view_functions[endpoint] = view_func
def route(self, rule, **options):
"""A decorator that is used to register a view function for a
given URL rule. This does the same thing as :meth:`add_url_rule`
but is intended for decorator usage::
@app.route('/')
def index():
return 'Hello World'
For more information refer to :ref:`url-route-registrations`.
:param rule: the URL rule as string
:param endpoint: the endpoint for the registered URL rule. Flask
itself assumes the name of the view function as
endpoint
:param options: the options to be forwarded to the underlying
:class:`~werkzeug.routing.Rule` object. A change
to Werkzeug is handling of method options. methods
is a list of methods this rule should be limited
to (`GET`, `POST` etc.). By default a rule
just listens for `GET` (and implicitly `HEAD`).
Starting with Flask 0.6, `OPTIONS` is implicitly
added and handled by the standard request handling.
"""
def decorator(f):
endpoint = options.pop('endpoint', None)
self.add_url_rule(rule, endpoint, f, **options)
return f
return decorator
@setupmethod
def endpoint(self, endpoint):
"""A decorator to register a function as an endpoint.
Example::
@app.endpoint('example.endpoint')
def example():
return "example"
:param endpoint: the name of the endpoint
"""
def decorator(f):
self.view_functions[endpoint] = f
return f
return decorator
@setupmethod
def errorhandler(self, code_or_exception):
"""A decorator that is used to register a function give a given
error code. Example::
@app.errorhandler(404)
def page_not_found(error):
return 'This page does not exist', 404
You can also register handlers for arbitrary exceptions::
@app.errorhandler(DatabaseError)
def special_exception_handler(error):
return 'Database connection failed', 500
You can also register a function as error handler without using
the :meth:`errorhandler` decorator. The following example is
equivalent to the one above::
def page_not_found(error):
return 'This page does not exist', 404
app.error_handler_spec[None][404] = page_not_found
Setting error handlers via assignments to :attr:`error_handler_spec`
however is discouraged as it requires fiddling with nested dictionaries
and the special case for arbitrary exception types.
The first `None` refers to the active blueprint. If the error
handler should be application wide `None` shall be used.
.. versionadded:: 0.7
One can now additionally also register custom exception types
that do not necessarily have to be a subclass of the
:class:`~werkzeug.exceptions.HTTPException` class.
:param code: the code as integer for the handler
"""
def decorator(f):
self._register_error_handler(None, code_or_exception, f)
return f
return decorator
def register_error_handler(self, code_or_exception, f):
"""Alternative error attach function to the :meth:`errorhandler`
decorator that is more straightforward to use for non decorator
usage.
.. versionadded:: 0.7
"""
self._register_error_handler(None, code_or_exception, f)
@setupmethod
def _register_error_handler(self, key, code_or_exception, f):
if isinstance(code_or_exception, HTTPException):
code_or_exception = code_or_exception.code
if isinstance(code_or_exception, integer_types):
assert code_or_exception != 500 or key is None, \
'It is currently not possible to register a 500 internal ' \
'server error on a per-blueprint level.'
self.error_handler_spec.setdefault(key, {})[code_or_exception] = f
else:
self.error_handler_spec.setdefault(key, {}).setdefault(None, []) \
.append((code_or_exception, f))
@setupmethod
def template_filter(self, name=None):
"""A decorator that is used to register custom template filter.
You can specify a name for the filter, otherwise the function
name will be used. Example::
@app.template_filter()
def reverse(s):
return s[::-1]
:param name: the optional name of the filter, otherwise the
function name will be used.
"""
def decorator(f):
self.add_template_filter(f, name=name)
return f
return decorator
@setupmethod
def add_template_filter(self, f, name=None):
"""Register a custom template filter. Works exactly like the
:meth:`template_filter` decorator.
:param name: the optional name of the filter, otherwise the
function name will be used.
"""
self.jinja_env.filters[name or f.__name__] = f
@setupmethod
def template_test(self, name=None):
"""A decorator that is used to register custom template test.
You can specify a name for the test, otherwise the function
name will be used. Example::
@app.template_test()
def is_prime(n):
if n == 2:
return True
for i in range(2, int(math.ceil(math.sqrt(n))) + 1):
if n % i == 0:
return False
return True
.. versionadded:: 0.10
:param name: the optional name of the test, otherwise the
function name will be used.
"""
def decorator(f):
self.add_template_test(f, name=name)
return f
return decorator
@setupmethod
def add_template_test(self, f, name=None):
"""Register a custom template test. Works exactly like the
:meth:`template_test` decorator.
.. versionadded:: 0.10
:param name: the optional name of the test, otherwise the
function name will be used.
"""
self.jinja_env.tests[name or f.__name__] = f
@setupmethod
def template_global(self, name=None):
"""A decorator that is used to register a custom template global function.
You can specify a name for the global function, otherwise the function
name will be used. Example::
@app.template_global()
def double(n):
return 2 * n
.. versionadded:: 0.10
:param name: the optional name of the global function, otherwise the
function name will be used.
"""
def decorator(f):
self.add_template_global(f, name=name)
return f
return decorator
@setupmethod
def add_template_global(self, f, name=None):
"""Register a custom template global function. Works exactly like the
:meth:`template_global` decorator.
.. versionadded:: 0.10
:param name: the optional name of the global function, otherwise the
function name will be used.
"""
self.jinja_env.globals[name or f.__name__] = f
@setupmethod
def before_request(self, f):
"""Registers a function to run before each request."""
self.before_request_funcs.setdefault(None, []).append(f)
return f
@setupmethod
def before_first_request(self, f):
"""Registers a function to be run before the first request to this
instance of the application.
.. versionadded:: 0.8
"""
self.before_first_request_funcs.append(f)
@setupmethod
def after_request(self, f):
"""Register a function to be run after each request. Your function
must take one parameter, a :attr:`response_class` object and return
a new response object or the same (see :meth:`process_response`).
As of Flask 0.7 this function might not be executed at the end of the
request in case an unhandled exception occurred.
"""
self.after_request_funcs.setdefault(None, []).append(f)
return f
@setupmethod
def teardown_request(self, f):
"""Register a function to be run at the end of each request,
regardless of whether there was an exception or not. These functions
are executed when the request context is popped, even if not an
actual request was performed.
Example::
ctx = app.test_request_context()
ctx.push()
...
ctx.pop()
When ``ctx.pop()`` is executed in the above example, the teardown
functions are called just before the request context moves from the
stack of active contexts. This becomes relevant if you are using
such constructs in tests.
Generally teardown functions must take every necessary step to avoid
that they will fail. If they do execute code that might fail they
will have to surround the execution of these code by try/except
statements and log occurring errors.
When a teardown function was called because of a exception it will
be passed an error object.
.. admonition:: Debug Note
In debug mode Flask will not tear down a request on an exception
immediately. Instead if will keep it alive so that the interactive
debugger can still access it. This behavior can be controlled
by the ``PRESERVE_CONTEXT_ON_EXCEPTION`` configuration variable.
"""
self.teardown_request_funcs.setdefault(None, []).append(f)
return f
@setupmethod
def teardown_appcontext(self, f):
"""Registers a function to be called when the application context
ends. These functions are typically also called when the request
context is popped.
Example::
ctx = app.app_context()
ctx.push()
...
ctx.pop()
When ``ctx.pop()`` is executed in the above example, the teardown
functions are called just before the app context moves from the
stack of active contexts. This becomes relevant if you are using
such constructs in tests.
Since a request context typically also manages an application
context it would also be called when you pop a request context.
When a teardown function was called because of an exception it will
be passed an error object.
.. versionadded:: 0.9
"""
self.teardown_appcontext_funcs.append(f)
return f
@setupmethod
def context_processor(self, f):
"""Registers a template context processor function."""
self.template_context_processors[None].append(f)
return f
@setupmethod
def url_value_preprocessor(self, f):
"""Registers a function as URL value preprocessor for all view
functions of the application. It's called before the view functions
are called and can modify the url values provided.
"""
self.url_value_preprocessors.setdefault(None, []).append(f)
return f
@setupmethod
def url_defaults(self, f):
"""Callback function for URL defaults for all view functions of the
application. It's called with the endpoint and values and should
update the values passed in place.
"""
self.url_default_functions.setdefault(None, []).append(f)
return f
def handle_http_exception(self, e):
"""Handles an HTTP exception. By default this will invoke the
registered error handlers and fall back to returning the
exception as response.
.. versionadded:: 0.3
"""
handlers = self.error_handler_spec.get(request.blueprint)
# Proxy exceptions don't have error codes. We want to always return
# those unchanged as errors
if e.code is None:
return e
if handlers and e.code in handlers:
handler = handlers[e.code]
else:
handler = self.error_handler_spec[None].get(e.code)
if handler is None:
return e
return handler(e)
def trap_http_exception(self, e):
"""Checks if an HTTP exception should be trapped or not. By default
this will return `False` for all exceptions except for a bad request
key error if ``TRAP_BAD_REQUEST_ERRORS`` is set to `True`. It
also returns `True` if ``TRAP_HTTP_EXCEPTIONS`` is set to `True`.
This is called for all HTTP exceptions raised by a view function.
If it returns `True` for any exception the error handler for this
exception is not called and it shows up as regular exception in the
traceback. This is helpful for debugging implicitly raised HTTP
exceptions.
.. versionadded:: 0.8
"""
if self.config['TRAP_HTTP_EXCEPTIONS']:
return True
if self.config['TRAP_BAD_REQUEST_ERRORS']:
return isinstance(e, BadRequest)
return False
def handle_user_exception(self, e):
"""This method is called whenever an exception occurs that should be
handled. A special case are
:class:`~werkzeug.exception.HTTPException`\s which are forwarded by
this function to the :meth:`handle_http_exception` method. This
function will either return a response value or reraise the
exception with the same traceback.
.. versionadded:: 0.7
"""
exc_type, exc_value, tb = sys.exc_info()
assert exc_value is e
# ensure not to trash sys.exc_info() at that point in case someone
# wants the traceback preserved in handle_http_exception. Of course
# we cannot prevent users from trashing it themselves in a custom
# trap_http_exception method so that's their fault then.
if isinstance(e, HTTPException) and not self.trap_http_exception(e):
return self.handle_http_exception(e)
blueprint_handlers = ()
handlers = self.error_handler_spec.get(request.blueprint)
if handlers is not None:
blueprint_handlers = handlers.get(None, ())
app_handlers = self.error_handler_spec[None].get(None, ())
for typecheck, handler in chain(blueprint_handlers, app_handlers):
if isinstance(e, typecheck):
return handler(e)
reraise(exc_type, exc_value, tb)
def handle_exception(self, e):
"""Default exception handling that kicks in when an exception
occurs that is not caught. In debug mode the exception will
be re-raised immediately, otherwise it is logged and the handler
for a 500 internal server error is used. If no such handler
exists, a default 500 internal server error message is displayed.
.. versionadded:: 0.3
"""
exc_type, exc_value, tb = sys.exc_info()
got_request_exception.send(self, exception=e)
handler = self.error_handler_spec[None].get(500)
if self.propagate_exceptions:
# if we want to repropagate the exception, we can attempt to
# raise it with the whole traceback in case we can do that
# (the function was actually called from the except part)
# otherwise, we just raise the error again
if exc_value is e:
reraise(exc_type, exc_value, tb)
else:
raise e
self.log_exception((exc_type, exc_value, tb))
if handler is None:
return InternalServerError()
return handler(e)
def log_exception(self, exc_info):
"""Logs an exception. This is called by :meth:`handle_exception`
if debugging is disabled and right before the handler is called.
The default implementation logs the exception as error on the
:attr:`logger`.
.. versionadded:: 0.8
"""
self.logger.error('Exception on %s [%s]' % (
request.path,
request.method
), exc_info=exc_info)
def raise_routing_exception(self, request):
"""Exceptions that are recording during routing are reraised with
this method. During debug we are not reraising redirect requests
for non ``GET``, ``HEAD``, or ``OPTIONS`` requests and we're raising
a different error instead to help debug situations.
:internal:
"""
if not self.debug \
or not isinstance(request.routing_exception, RequestRedirect) \
or request.method in ('GET', 'HEAD', 'OPTIONS'):
raise request.routing_exception
from .debughelpers import FormDataRoutingRedirect
raise FormDataRoutingRedirect(request)
def dispatch_request(self):
"""Does the request dispatching. Matches the URL and returns the
return value of the view or error handler. This does not have to
be a response object. In order to convert the return value to a
proper response object, call :func:`make_response`.
.. versionchanged:: 0.7
This no longer does the exception handling, this code was
moved to the new :meth:`full_dispatch_request`.
"""
req = _request_ctx_stack.top.request
if req.routing_exception is not None:
self.raise_routing_exception(req)
rule = req.url_rule
# if we provide automatic options for this URL and the
# request came with the OPTIONS method, reply automatically
if getattr(rule, 'provide_automatic_options', False) \
and req.method == 'OPTIONS':
return self.make_default_options_response()
# otherwise dispatch to the handler for that endpoint
return self.view_functions[rule.endpoint](**req.view_args)
def full_dispatch_request(self):
"""Dispatches the request and on top of that performs request
pre and postprocessing as well as HTTP exception catching and
error handling.
.. versionadded:: 0.7
"""
self.try_trigger_before_first_request_functions()
try:
request_started.send(self)
rv = self.preprocess_request()
if rv is None:
rv = self.dispatch_request()
except Exception as e:
rv = self.handle_user_exception(e)
response = self.make_response(rv)
response = self.process_response(response)
request_finished.send(self, response=response)
return response
def try_trigger_before_first_request_functions(self):
"""Called before each request and will ensure that it triggers
the :attr:`before_first_request_funcs` and only exactly once per
application instance (which means process usually).
:internal:
"""
if self._got_first_request:
return
with self._before_request_lock:
if self._got_first_request:
return
self._got_first_request = True
for func in self.before_first_request_funcs:
func()
def make_default_options_response(self):
"""This method is called to create the default `OPTIONS` response.
This can be changed through subclassing to change the default
behavior of `OPTIONS` responses.
.. versionadded:: 0.7
"""
adapter = _request_ctx_stack.top.url_adapter
if hasattr(adapter, 'allowed_methods'):
methods = adapter.allowed_methods()
else:
# fallback for Werkzeug < 0.7
methods = []
try:
adapter.match(method='--')
except MethodNotAllowed as e:
methods = e.valid_methods
except HTTPException as e:
pass
rv = self.response_class()
rv.allow.update(methods)
return rv
def should_ignore_error(self, error):
"""This is called to figure out if an error should be ignored
or not as far as the teardown system is concerned. If this
function returns `True` then the teardown handlers will not be
passed the error.
.. versionadded:: 0.10
"""
return False
def make_response(self, rv):
"""Converts the return value from a view function to a real
response object that is an instance of :attr:`response_class`.
The following types are allowed for `rv`:
.. tabularcolumns:: |p{3.5cm}|p{9.5cm}|
======================= ===========================================
:attr:`response_class` the object is returned unchanged
:class:`str` a response object is created with the
string as body
:class:`unicode` a response object is created with the
string encoded to utf-8 as body
a WSGI function the function is called as WSGI application
and buffered as response object
:class:`tuple` A tuple in the form ``(response, status,
headers)`` where `response` is any of the
types defined here, `status` is a string
or an integer and `headers` is a list of
a dictionary with header values.
======================= ===========================================
:param rv: the return value from the view function
.. versionchanged:: 0.9
Previously a tuple was interpreted as the arguments for the
response object.
"""
status = headers = None
if isinstance(rv, tuple):
rv, status, headers = rv + (None,) * (3 - len(rv))
if rv is None:
raise ValueError('View function did not return a response')
if not isinstance(rv, self.response_class):
# When we create a response object directly, we let the constructor
# set the headers and status. We do this because there can be
# some extra logic involved when creating these objects with
# specific values (like default content type selection).
if isinstance(rv, (text_type, bytes, bytearray)):
rv = self.response_class(rv, headers=headers, status=status)
headers = status = None
else:
rv = self.response_class.force_type(rv, request.environ)
if status is not None:
if isinstance(status, string_types):
rv.status = status
else:
rv.status_code = status
if headers:
rv.headers.extend(headers)
return rv
def create_url_adapter(self, request):
"""Creates a URL adapter for the given request. The URL adapter
is created at a point where the request context is not yet set up
so the request is passed explicitly.
.. versionadded:: 0.6
.. versionchanged:: 0.9
This can now also be called without a request object when the
URL adapter is created for the application context.
"""
if request is not None:
return self.url_map.bind_to_environ(request.environ,
server_name=self.config['SERVER_NAME'])
# We need at the very least the server name to be set for this
# to work.
if self.config['SERVER_NAME'] is not None:
return self.url_map.bind(
self.config['SERVER_NAME'],
script_name=self.config['APPLICATION_ROOT'] or '/',
url_scheme=self.config['PREFERRED_URL_SCHEME'])
def inject_url_defaults(self, endpoint, values):
"""Injects the URL defaults for the given endpoint directly into
the values dictionary passed. This is used internally and
automatically called on URL building.
.. versionadded:: 0.7
"""
funcs = self.url_default_functions.get(None, ())
if '.' in endpoint:
bp = endpoint.rsplit('.', 1)[0]
funcs = chain(funcs, self.url_default_functions.get(bp, ()))
for func in funcs:
func(endpoint, values)
def handle_url_build_error(self, error, endpoint, values):
"""Handle :class:`~werkzeug.routing.BuildError` on :meth:`url_for`.
"""
exc_type, exc_value, tb = sys.exc_info()
for handler in self.url_build_error_handlers:
try:
rv = handler(error, endpoint, values)
if rv is not None:
return rv
except BuildError as error:
pass
# At this point we want to reraise the exception. If the error is
# still the same one we can reraise it with the original traceback,
# otherwise we raise it from here.
if error is exc_value:
reraise(exc_type, exc_value, tb)
raise error
def preprocess_request(self):
"""Called before the actual request dispatching and will
call every as :meth:`before_request` decorated function.
If any of these function returns a value it's handled as
if it was the return value from the view and further
request handling is stopped.
This also triggers the :meth:`url_value_processor` functions before
the actual :meth:`before_request` functions are called.
"""
bp = _request_ctx_stack.top.request.blueprint
funcs = self.url_value_preprocessors.get(None, ())
if bp is not None and bp in self.url_value_preprocessors:
funcs = chain(funcs, self.url_value_preprocessors[bp])
for func in funcs:
func(request.endpoint, request.view_args)
funcs = self.before_request_funcs.get(None, ())
if bp is not None and bp in self.before_request_funcs:
funcs = chain(funcs, self.before_request_funcs[bp])
for func in funcs:
rv = func()
if rv is not None:
return rv
def process_response(self, response):
"""Can be overridden in order to modify the response object
before it's sent to the WSGI server. By default this will
call all the :meth:`after_request` decorated functions.
.. versionchanged:: 0.5
As of Flask 0.5 the functions registered for after request
execution are called in reverse order of registration.
:param response: a :attr:`response_class` object.
:return: a new response object or the same, has to be an
instance of :attr:`response_class`.
"""
ctx = _request_ctx_stack.top
bp = ctx.request.blueprint
funcs = ctx._after_request_functions
if bp is not None and bp in self.after_request_funcs:
funcs = chain(funcs, reversed(self.after_request_funcs[bp]))
if None in self.after_request_funcs:
funcs = chain(funcs, reversed(self.after_request_funcs[None]))
for handler in funcs:
response = handler(response)
if not self.session_interface.is_null_session(ctx.session):
self.save_session(ctx.session, response)
return response
def do_teardown_request(self, exc=None):
"""Called after the actual request dispatching and will
call every as :meth:`teardown_request` decorated function. This is
not actually called by the :class:`Flask` object itself but is always
triggered when the request context is popped. That way we have a
tighter control over certain resources under testing environments.
.. versionchanged:: 0.9
Added the `exc` argument. Previously this was always using the
current exception information.
"""
if exc is None:
exc = sys.exc_info()[1]
funcs = reversed(self.teardown_request_funcs.get(None, ()))
bp = _request_ctx_stack.top.request.blueprint
if bp is not None and bp in self.teardown_request_funcs:
funcs = chain(funcs, reversed(self.teardown_request_funcs[bp]))
for func in funcs:
rv = func(exc)
request_tearing_down.send(self, exc=exc)
def do_teardown_appcontext(self, exc=None):
"""Called when an application context is popped. This works pretty
much the same as :meth:`do_teardown_request` but for the application
context.
.. versionadded:: 0.9
"""
if exc is None:
exc = sys.exc_info()[1]
for func in reversed(self.teardown_appcontext_funcs):
func(exc)
appcontext_tearing_down.send(self, exc=exc)
def app_context(self):
"""Binds the application only. For as long as the application is bound
to the current context the :data:`flask.current_app` points to that
application. An application context is automatically created when a
request context is pushed if necessary.
Example usage::
with app.app_context():
...
.. versionadded:: 0.9
"""
return AppContext(self)
def request_context(self, environ):
"""Creates a :class:`~flask.ctx.RequestContext` from the given
environment and binds it to the current context. This must be used in
combination with the `with` statement because the request is only bound
to the current context for the duration of the `with` block.
Example usage::
with app.request_context(environ):
do_something_with(request)
The object returned can also be used without the `with` statement
which is useful for working in the shell. The example above is
doing exactly the same as this code::
ctx = app.request_context(environ)
ctx.push()
try:
do_something_with(request)
finally:
ctx.pop()
.. versionchanged:: 0.3
Added support for non-with statement usage and `with` statement
is now passed the ctx object.
:param environ: a WSGI environment
"""
return RequestContext(self, environ)
def test_request_context(self, *args, **kwargs):
"""Creates a WSGI environment from the given values (see
:func:`werkzeug.test.EnvironBuilder` for more information, this
function accepts the same arguments).
"""
from flask.testing import make_test_environ_builder
builder = make_test_environ_builder(self, *args, **kwargs)
try:
return self.request_context(builder.get_environ())
finally:
builder.close()
def wsgi_app(self, environ, start_response):
"""The actual WSGI application. This is not implemented in
`__call__` so that middlewares can be applied without losing a
reference to the class. So instead of doing this::
app = MyMiddleware(app)
It's a better idea to do this instead::
app.wsgi_app = MyMiddleware(app.wsgi_app)
Then you still have the original application object around and
can continue to call methods on it.
.. versionchanged:: 0.7
The behavior of the before and after request callbacks was changed
under error conditions and a new callback was added that will
always execute at the end of the request, independent on if an
error occurred or not. See :ref:`callbacks-and-errors`.
:param environ: a WSGI environment
:param start_response: a callable accepting a status code,
a list of headers and an optional
exception context to start the response
"""
ctx = self.request_context(environ)
ctx.push()
error = None
try:
try:
response = self.full_dispatch_request()
except Exception as e:
error = e
response = self.make_response(self.handle_exception(e))
return response(environ, start_response)
finally:
if self.should_ignore_error(error):
error = None
ctx.auto_pop(error)
@property
def modules(self):
from warnings import warn
warn(DeprecationWarning('Flask.modules is deprecated, use '
'Flask.blueprints instead'), stacklevel=2)
return self.blueprints
def __call__(self, environ, start_response):
"""Shortcut for :attr:`wsgi_app`."""
return self.wsgi_app(environ, start_response)
def __repr__(self):
return '<%s %r>' % (
self.__class__.__name__,
self.name,
)
================================================
FILE: lib/flask/blueprints.py
================================================
# -*- coding: utf-8 -*-
"""
flask.blueprints
~~~~~~~~~~~~~~~~
Blueprints are the recommended way to implement larger or more
pluggable applications in Flask 0.7 and later.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from functools import update_wrapper
from .helpers import _PackageBoundObject, _endpoint_from_view_func
class BlueprintSetupState(object):
"""Temporary holder object for registering a blueprint with the
application. An instance of this class is created by the
:meth:`~flask.Blueprint.make_setup_state` method and later passed
to all register callback functions.
"""
def __init__(self, blueprint, app, options, first_registration):
#: a reference to the current application
self.app = app
#: a reference to the blueprint that created this setup state.
self.blueprint = blueprint
#: a dictionary with all options that were passed to the
#: :meth:`~flask.Flask.register_blueprint` method.
self.options = options
#: as blueprints can be registered multiple times with the
#: application and not everything wants to be registered
#: multiple times on it, this attribute can be used to figure
#: out if the blueprint was registered in the past already.
self.first_registration = first_registration
subdomain = self.options.get('subdomain')
if subdomain is None:
subdomain = self.blueprint.subdomain
#: The subdomain that the blueprint should be active for, `None`
#: otherwise.
self.subdomain = subdomain
url_prefix = self.options.get('url_prefix')
if url_prefix is None:
url_prefix = self.blueprint.url_prefix
#: The prefix that should be used for all URLs defined on the
#: blueprint.
self.url_prefix = url_prefix
#: A dictionary with URL defaults that is added to each and every
#: URL that was defined with the blueprint.
self.url_defaults = dict(self.blueprint.url_values_defaults)
self.url_defaults.update(self.options.get('url_defaults', ()))
def add_url_rule(self, rule, endpoint=None, view_func=None, **options):
"""A helper method to register a rule (and optionally a view function)
to the application. The endpoint is automatically prefixed with the
blueprint's name.
"""
if self.url_prefix:
rule = self.url_prefix + rule
options.setdefault('subdomain', self.subdomain)
if endpoint is None:
endpoint = _endpoint_from_view_func(view_func)
defaults = self.url_defaults
if 'defaults' in options:
defaults = dict(defaults, **options.pop('defaults'))
self.app.add_url_rule(rule, '%s.%s' % (self.blueprint.name, endpoint),
view_func, defaults=defaults, **options)
class Blueprint(_PackageBoundObject):
"""Represents a blueprint. A blueprint is an object that records
functions that will be called with the
:class:`~flask.blueprint.BlueprintSetupState` later to register functions
or other things on the main application. See :ref:`blueprints` for more
information.
.. versionadded:: 0.7
"""
warn_on_modifications = False
_got_registered_once = False
def __init__(self, name, import_name, static_folder=None,
static_url_path=None, template_folder=None,
url_prefix=None, subdomain=None, url_defaults=None):
_PackageBoundObject.__init__(self, import_name, template_folder)
self.name = name
self.url_prefix = url_prefix
self.subdomain = subdomain
self.static_folder = static_folder
self.static_url_path = static_url_path
self.deferred_functions = []
self.view_functions = {}
if url_defaults is None:
url_defaults = {}
self.url_values_defaults = url_defaults
def record(self, func):
"""Registers a function that is called when the blueprint is
registered on the application. This function is called with the
state as argument as returned by the :meth:`make_setup_state`
method.
"""
if self._got_registered_once and self.warn_on_modifications:
from warnings import warn
warn(Warning('The blueprint was already registered once '
'but is getting modified now. These changes '
'will not show up.'))
self.deferred_functions.append(func)
def record_once(self, func):
"""Works like :meth:`record` but wraps the function in another
function that will ensure the function is only called once. If the
blueprint is registered a second time on the application, the
function passed is not called.
"""
def wrapper(state):
if state.first_registration:
func(state)
return self.record(update_wrapper(wrapper, func))
def make_setup_state(self, app, options, first_registration=False):
"""Creates an instance of :meth:`~flask.blueprints.BlueprintSetupState`
object that is later passed to the register callback functions.
Subclasses can override this to return a subclass of the setup state.
"""
return BlueprintSetupState(self, app, options, first_registration)
def register(self, app, options, first_registration=False):
"""Called by :meth:`Flask.register_blueprint` to register a blueprint
on the application. This can be overridden to customize the register
behavior. Keyword arguments from
:func:`~flask.Flask.register_blueprint` are directly forwarded to this
method in the `options` dictionary.
"""
self._got_registered_once = True
state = self.make_setup_state(app, options, first_registration)
if self.has_static_folder:
state.add_url_rule(self.static_url_path + '/<path:filename>',
view_func=self.send_static_file,
endpoint='static')
for deferred in self.deferred_functions:
deferred(state)
def route(self, rule, **options):
"""Like :meth:`Flask.route` but for a blueprint. The endpoint for the
:func:`url_for` function is prefixed with the name of the blueprint.
"""
def decorator(f):
endpoint = options.pop("endpoint", f.__name__)
self.add_url_rule(rule, endpoint, f, **options)
return f
return decorator
def add_url_rule(self, rule, endpoint=None, view_func=None, **options):
"""Like :meth:`Flask.add_url_rule` but for a blueprint. The endpoint for
the :func:`url_for` function is prefixed with the name of the blueprint.
"""
if endpoint:
assert '.' not in endpoint, "Blueprint endpoint's should not contain dot's"
self.record(lambda s:
s.add_url_rule(rule, endpoint, view_func, **options))
def endpoint(self, endpoint):
"""Like :meth:`Flask.endpoint` but for a blueprint. This does not
prefix the endpoint with the blueprint name, this has to be done
explicitly by the user of this method. If the endpoint is prefixed
with a `.` it will be registered to the current blueprint, otherwise
it's an application independent endpoint.
"""
def decorator(f):
def register_endpoint(state):
state.app.view_functions[endpoint] = f
self.record_once(register_endpoint)
return f
return decorator
def app_template_filter(self, name=None):
"""Register a custom template filter, available application wide. Like
:meth:`Flask.template_filter` but for a blueprint.
:param name: the optional name of the filter, otherwise the
function name will be used.
"""
def decorator(f):
self.add_app_template_filter(f, name=name)
return f
return decorator
def add_app_template_filter(self, f, name=None):
"""Register a custom template filter, available application wide. Like
:meth:`Flask.add_template_filter` but for a blueprint. Works exactly
like the :meth:`app_template_filter` decorator.
:param name: the optional name of the filter, otherwise the
function name will be used.
"""
def register_template(state):
state.app.jinja_env.filters[name or f.__name__] = f
self.record_once(register_template)
def app_template_test(self, name=None):
"""Register a custom template test, available application wide. Like
:meth:`Flask.template_test` but for a blueprint.
.. versionadded:: 0.10
:param name: the optional name of the test, otherwise the
function name will be used.
"""
def decorator(f):
self.add_app_template_test(f, name=name)
return f
return decorator
def add_app_template_test(self, f, name=None):
"""Register a custom template test, available application wide. Like
:meth:`Flask.add_template_test` but for a blueprint. Works exactly
like the :meth:`app_template_test` decorator.
.. versionadded:: 0.10
:param name: the optional name of the test, otherwise the
function name will be used.
"""
def register_template(state):
state.app.jinja_env.tests[name or f.__name__] = f
self.record_once(register_template)
def app_template_global(self, name=None):
"""Register a custom template global, available application wide. Like
:meth:`Flask.template_global` but for a blueprint.
.. versionadded:: 0.10
:param name: the optional name of the global, otherwise the
function name will be used.
"""
def decorator(f):
self.add_app_template_global(f, name=name)
return f
return decorator
def add_app_template_global(self, f, name=None):
"""Register a custom template global, available application wide. Like
:meth:`Flask.add_template_global` but for a blueprint. Works exactly
like the :meth:`app_template_global` decorator.
.. versionadded:: 0.10
:param name: the optional name of the global, otherwise the
function name will be used.
"""
def register_template(state):
state.app.jinja_env.globals[name or f.__name__] = f
self.record_once(register_template)
def before_request(self, f):
"""Like :meth:`Flask.before_request` but for a blueprint. This function
is only executed before each request that is handled by a function of
that blueprint.
"""
self.record_once(lambda s: s.app.before_request_funcs
.setdefault(self.name, []).append(f))
return f
def before_app_request(self, f):
"""Like :meth:`Flask.before_request`. Such a function is executed
before each request, even if outside of a blueprint.
"""
self.record_once(lambda s: s.app.before_request_funcs
.setdefault(None, []).append(f))
return f
def before_app_first_request(self, f):
"""Like :meth:`Flask.before_first_request`. Such a function is
executed before the first request to the application.
"""
self.record_once(lambda s: s.app.before_first_request_funcs.append(f))
return f
def after_request(self, f):
"""Like :meth:`Flask.after_request` but for a blueprint. This function
is only executed after each request that is handled by a function of
that blueprint.
"""
self.record_once(lambda s: s.app.after_request_funcs
.setdefault(self.name, []).append(f))
return f
def after_app_request(self, f):
"""Like :meth:`Flask.after_request` but for a blueprint. Such a function
is executed after each request, even if outside of the blueprint.
"""
self.record_once(lambda s: s.app.after_request_funcs
.setdefault(None, []).append(f))
return f
def teardown_request(self, f):
"""Like :meth:`Flask.teardown_request` but for a blueprint. This
function is only executed when tearing down requests handled by a
function of that blueprint. Teardown request functions are executed
when the request context is popped, even when no actual request was
performed.
"""
self.record_once(lambda s: s.app.teardown_request_funcs
.setdefault(self.name, []).append(f))
return f
def teardown_app_request(self, f):
"""Like :meth:`Flask.teardown_request` but for a blueprint. Such a
function is executed when tearing down each request, even if outside of
the blueprint.
"""
self.record_once(lambda s: s.app.teardown_request_funcs
.setdefault(None, []).append(f))
return f
def context_processor(self, f):
"""Like :meth:`Flask.context_processor` but for a blueprint. This
function is only executed for requests handled by a blueprint.
"""
self.record_once(lambda s: s.app.template_context_processors
.setdefault(self.name, []).append(f))
return f
def app_context_processor(self, f):
"""Like :meth:`Flask.context_processor` but for a blueprint. Such a
function is executed each request, even if outside of the blueprint.
"""
self.record_once(lambda s: s.app.template_context_processors
.setdefault(None, []).append(f))
return f
def app_errorhandler(self, code):
"""Like :meth:`Flask.errorhandler` but for a blueprint. This
handler is used for all requests, even if outside of the blueprint.
"""
def decorator(f):
self.record_once(lambda s: s.app.errorhandler(code)(f))
return f
return decorator
def url_value_preprocessor(self, f):
"""Registers a function as URL value preprocessor for this
blueprint. It's called before the view functions are called and
can modify the url values provided.
"""
self.record_once(lambda s: s.app.url_value_preprocessors
.setdefault(self.name, []).append(f))
return f
def url_defaults(self, f):
"""Callback function for URL defaults for this blueprint. It's called
with the endpoint and values and should update the values passed
in place.
"""
self.record_once(lambda s: s.app.url_default_functions
.setdefault(self.name, []).append(f))
return f
def app_url_value_preprocessor(self, f):
"""Same as :meth:`url_value_preprocessor` but application wide.
"""
self.record_once(lambda s: s.app.url_value_preprocessors
.setdefault(None, []).append(f))
return f
def app_url_defaults(self, f):
"""Same as :meth:`url_defaults` but application wide.
"""
self.record_once(lambda s: s.app.url_default_functions
.setdefault(None, []).append(f))
return f
def errorhandler(self, code_or_exception):
"""Registers an error handler that becomes active for this blueprint
only. Please be aware that routing does not happen local to a
blueprint so an error handler for 404 usually is not handled by
a blueprint unless it is caused inside a view function. Another
special case is the 500 internal server error which is always looked
up from the application.
Otherwise works as the :meth:`~flask.Flask.errorhandler` decorator
of the :class:`~flask.Flask` object.
"""
def decorator(f):
self.record_once(lambda s: s.app._register_error_handler(
self.name, code_or_exception, f))
return f
return decorator
================================================
FILE: lib/flask/config.py
================================================
# -*- coding: utf-8 -*-
"""
flask.config
~~~~~~~~~~~~
Implements the configuration related objects.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import imp
import os
import errno
from werkzeug.utils import import_string
from ._compat import string_types
class ConfigAttribute(object):
"""Makes an attribute forward to the config"""
def __init__(self, name, get_converter=None):
self.__name__ = name
self.get_converter = get_converter
def __get__(self, obj, type=None):
if obj is None:
return self
rv = obj.config[self.__name__]
if self.get_converter is not None:
rv = self.get_converter(rv)
return rv
def __set__(self, obj, value):
obj.config[self.__name__] = value
class Config(dict):
"""Works exactly like a dict but provides ways to fill it from files
or special dictionaries. There are two common patterns to populate the
config.
Either you can fill the config from a config file::
app.config.from_pyfile('yourconfig.cfg')
Or alternatively you can define the configuration options in the
module that calls :meth:`from_object` or provide an import path to
a module that should be loaded. It is also possible to tell it to
use the same module and with that provide the configuration values
just before the call::
DEBUG = True
SECRET_KEY = 'development key'
app.config.from_object(__name__)
In both cases (loading from any Python file or loading from modules),
only uppercase keys are added to the config. This makes it possible to use
lowercase values in the config file for temporary values that are not added
to the config or to define the config keys in the same file that implements
the application.
Probably the most interesting way to load configurations is from an
environment variable pointing to a file::
app.config.from_envvar('YOURAPPLICATION_SETTINGS')
In this case before launching the application you have to set this
environment variable to the file you want to use. On Linux and OS X
use the export statement::
export YOURAPPLICATION_SETTINGS='/path/to/config/file'
On windows use `set` instead.
:param root_path: path to which files are read relative from. When the
config object is created by the application, this is
the application's :attr:`~flask.Flask.root_path`.
:param defaults: an optional dictionary of default values
"""
def __init__(self, root_path, defaults=None):
dict.__init__(self, defaults or {})
self.root_path = root_path
def from_envvar(self, variable_name, silent=False):
"""Loads a configuration from an environment variable pointing to
a configuration file. This is basically just a shortcut with nicer
error messages for this line of code::
app.config.from_pyfile(os.environ['YOURAPPLICATION_SETTINGS'])
:param variable_name: name of the environment variable
:param silent: set to `True` if you want silent failure for missing
files.
:return: bool. `True` if able to load config, `False` otherwise.
"""
rv = os.environ.get(variable_name)
if not rv:
if silent:
return False
raise RuntimeError('The environment variable %r is not set '
'and as such configuration could not be '
'loaded. Set this variable and make it '
'point to a configuration file' %
variable_name)
return self.from_pyfile(rv, silent=silent)
def from_pyfile(self, filename, silent=False):
"""Updates the values in the config from a Python file. This function
behaves as if the file was imported as module with the
:meth:`from_object` function.
:param filename: the filename of the config. This can either be an
absolute filename or a filename relative to the
root path.
:param silent: set to `True` if you want silent failure for missing
files.
.. versionadded:: 0.7
`silent` parameter.
"""
filename = os.path.join(self.root_path, filename)
d = imp.new_module('config')
d.__file__ = filename
try:
with open(filename) as config_file:
exec(compile(config_file.read(), filename, 'exec'), d.__dict__)
except IOError as e:
if silent and e.errno in (errno.ENOENT, errno.EISDIR):
return False
e.strerror = 'Unable to load configuration file (%s)' % e.strerror
raise
self.from_object(d)
return True
def from_object(self, obj):
"""Updates the values from the given object. An object can be of one
of the following two types:
- a string: in this case the object with that name will be imported
- an actual object reference: that object is used directly
Objects are usually either modules or classes.
Just the uppercase variables in that object are stored in the config.
Example usage::
app.config.from_object('yourapplication.default_config')
from yourapplication import default_config
app.config.from_object(default_config)
You should not use this function to load the actual configuration but
rather configuration defaults. The actual config should be loaded
with :meth:`from_pyfile` and ideally from a location not within the
package because the package might be installed system wide.
:param obj: an import name or object
"""
if isinstance(obj, string_types):
obj = import_string(obj)
for key in dir(obj):
if key.isupper():
self[key] = getattr(obj, key)
def __repr__(self):
return '<%s %s>' % (self.__class__.__name__, dict.__repr__(self))
================================================
FILE: lib/flask/ctx.py
================================================
# -*- coding: utf-8 -*-
"""
flask.ctx
~~~~~~~~~
Implements the objects required to keep the context.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from __future__ import with_statement
import sys
from functools import update_wrapper
from werkzeug.exceptions import HTTPException
from .globals import _request_ctx_stack, _app_ctx_stack
from .module import blueprint_is_module
from .signals import appcontext_pushed, appcontext_popped
class _AppCtxGlobals(object):
"""A plain object."""
def get(self, name, default=None):
return self.__dict__.get(name, default)
def __contains__(self, item):
return item in self.__dict__
def __iter__(self):
return iter(self.__dict__)
def __repr__(self):
top = _app_ctx_stack.top
if top is not None:
return '<flask.g of %r>' % top.app.name
return object.__repr__(self)
def after_this_request(f):
"""Executes a function after this request. This is useful to modify
response objects. The function is passed the response object and has
to return the same or a new one.
Example::
@app.route('/')
def index():
@after_this_request
def add_header(response):
response.headers['X-Foo'] = 'Parachute'
return response
return 'Hello World!'
This is more useful if a function other than the view function wants to
modify a response. For instance think of a decorator that wants to add
some headers without converting the return value into a response object.
.. versionadded:: 0.9
"""
_request_ctx_stack.top._after_request_functions.append(f)
return f
def copy_current_request_context(f):
"""A helper function that decorates a function to retain the current
request context. This is useful when working with greenlets. The moment
the function is decorated a copy of the request context is created and
then pushed when the function is called.
Example::
import gevent
from flask import copy_current_request_context
@app.route('/')
def index():
@copy_current_request_context
def do_some_work():
# do some work here, it can access flask.request like you
# would otherwise in the view function.
...
gevent.spawn(do_some_work)
return 'Regular response'
.. versionadded:: 0.10
"""
top = _request_ctx_stack.top
if top is None:
raise RuntimeError('This decorator can only be used at local scopes '
'when a request context is on the stack. For instance within '
'view functions.')
reqctx = top.copy()
def wrapper(*args, **kwargs):
with reqctx:
return f(*args, **kwargs)
return update_wrapper(wrapper, f)
def has_request_context():
"""If you have code that wants to test if a request context is there or
not this function can be used. For instance, you may want to take advantage
of request information if the request object is available, but fail
silently if it is unavailable.
::
class User(db.Model):
def __init__(self, username, remote_addr=None):
self.username = username
if remote_addr is None and has_request_context():
remote_addr = request.remote_addr
self.remote_addr = remote_addr
Alternatively you can also just test any of the context bound objects
(such as :class:`request` or :class:`g` for truthness)::
class User(db.Model):
def __init__(self, username, remote_addr=None):
self.username = username
if remote_addr is None and request:
remote_addr = request.remote_addr
self.remote_addr = remote_addr
.. versionadded:: 0.7
"""
return _request_ctx_stack.top is not None
def has_app_context():
"""Works like :func:`has_request_context` but for the application
context. You can also just do a boolean check on the
:data:`current_app` object instead.
.. versionadded:: 0.9
"""
return _app_ctx_stack.top is not None
class AppContext(object):
"""The application context binds an application object implicitly
to the current thread or greenlet, similar to how the
:class:`RequestContext` binds request information. The application
context is also implicitly created if a request context is created
but the application is not on top of the individual application
context.
"""
def __init__(self, app):
self.app = app
self.url_adapter = app.create_url_adapter(None)
self.g = app.app_ctx_globals_class()
# Like request context, app contexts can be pushed multiple times
# but there a basic "refcount" is enough to track them.
self._refcnt = 0
def push(self):
"""Binds the app context to the current context."""
self._refcnt += 1
_app_ctx_stack.push(self)
appcontext_pushed.send(self.app)
def pop(self, exc=None):
"""Pops the app context."""
self._refcnt -= 1
if self._refcnt <= 0:
if exc is None:
exc = sys.exc_info()[1]
self.app.do_teardown_appcontext(exc)
rv = _app_ctx_stack.pop()
assert rv is self, 'Popped wrong app context. (%r instead of %r)' \
% (rv, self)
appcontext_popped.send(self.app)
def __enter__(self):
self.push()
return self
def __exit__(self, exc_type, exc_value, tb):
self.pop(exc_value)
class RequestContext(object):
"""The request context contains all request relevant information. It is
created at the beginning of the request and pushed to the
`_request_ctx_stack` and removed at the end of it. It will create the
URL adapter and request object for the WSGI environment provided.
Do not attempt to use this class directly, instead use
:meth:`~flask.Flask.test_request_context` and
:meth:`~flask.Flask.request_context` to create this object.
When the request context is popped, it will evaluate all the
functions registered on the application for teardown execution
(:meth:`~flask.Flask.teardown_request`).
The request context is automatically popped at the end of the request
for you. In debug mode the request context is kept around if
exceptions happen so that interactive debuggers have a chance to
introspect the data. With 0.4 this can also be forced for requests
that did not fail and outside of `DEBUG` mode. By setting
``'flask._preserve_context'`` to `True` on the WSGI environment the
context will not pop itself at the end of the request. This is used by
the :meth:`~flask.Flask.test_client` for example to implement the
deferred cleanup functionality.
You might find this helpful for unittests where you need the
information from the context local around for a little longer. Make
sure to properly :meth:`~werkzeug.LocalStack.pop` the stack yourself in
that situation, otherwise your unittests will leak memory.
"""
def __init__(self, app, environ, request=None):
self.app = app
if request is None:
request = app.request_class(environ)
self.request = request
self.url_adapter = app.create_url_adapter(self.request)
self.flashes = None
self.session = None
# Request contexts can be pushed multiple times and interleaved with
# other request contexts. Now only if the last level is popped we
# get rid of them. Additionally if an application context is missing
# one is created implicitly so for each level we add this information
self._implicit_app_ctx_stack = []
# indicator if the context was preserved. Next time another context
# is pushed the preserved context is popped.
self.preserved = False
# remembers the exception for pop if there is one in case the context
# preservation kicks in.
self._preserved_exc = None
# Functions that should be executed after the request on the response
# object. These will be called before the regular "after_request"
# functions.
self._after_request_functions = []
self.match_request()
# XXX: Support for deprecated functionality. This is going away with
# Flask 1.0
blueprint = self.request.blueprint
if blueprint is not None:
# better safe than sorry, we don't want to break code that
# already worked
bp = app.blueprints.get(blueprint)
if bp is not None and blueprint_is_module(bp):
self.request._is_old_module = True
def _get_g(self):
return _app_ctx_stack.top.g
def _set_g(self, value):
_app_ctx_stack.top.g = value
g = property(_get_g, _set_g)
del _get_g, _set_g
def copy(self):
"""Creates a copy of this request context with the same request object.
This can be used to move a request context to a different greenlet.
Because the actual request object is the same this cannot be used to
move a request context to a different thread unless access to the
request object is locked.
.. versionadded:: 0.10
"""
return self.__class__(self.app,
environ=self.request.environ,
request=self.request
)
def match_request(self):
"""Can be overridden by a subclass to hook into the matching
of the request.
"""
try:
url_rule, self.request.view_args = \
self.url_adapter.match(return_rule=True)
self.request.url_rule = url_rule
except HTTPException as e:
self.request.routing_exception = e
def push(self):
"""Binds the request context to the current context."""
# If an exception occurs in debug mode or if context preservation is
# activated under exception situations exactly one context stays
# on the stack. The rationale is that you want to access that
# information under debug situations. However if someone forgets to
# pop that context again we want to make sure that on the next push
# it's invalidated, otherwise we run at risk that something leaks
# memory. This is usually only a problem in testsuite since this
# functionality is not active in production environments.
top = _request_ctx_stack.top
if top is not None and top.preserved:
top.pop(top._preserved_exc)
# Before we push the request context we have to ensure that there
# is an application context.
app_ctx = _app_ctx_stack.top
if app_ctx is None or app_ctx.app != self.app:
app_ctx = self.app.app_context()
app_ctx.push()
self._implicit_app_ctx_stack.append(app_ctx)
else:
self._implicit_app_ctx_stack.append(None)
_request_ctx_stack.push(self)
# Open the session at the moment that the request context is
# available. This allows a custom open_session method to use the
# request context (e.g. code that access database information
# stored on `g` instead of the appcontext).
self.session = self.app.open_session(self.request)
if self.session is None:
self.session = self.app.make_null_session()
def pop(self, exc=None):
"""Pops the request context and unbinds it by doing that. This will
also trigger the execution of functions registered by the
:meth:`~flask.Flask.teardown_request` decorator.
.. versionchanged:: 0.9
Added the `exc` argument.
"""
app_ctx = self._implicit_app_ctx_stack.pop()
clear_request = False
if not self._implicit_app_ctx_stack:
self.preserved = False
self._preserved_exc = None
if exc is None:
exc = sys.exc_info()[1]
self.app.do_teardown_request(exc)
# If this interpreter supports clearing the exception information
# we do that now. This will only go into effect on Python 2.x,
# on 3.x it disappears automatically at the end of the exception
# stack.
if hasattr(sys, 'exc_clear'):
sys.exc_clear()
request_close = getattr(self.request, 'close', None)
if request_close is not None:
request_close()
clear_request = True
rv = _request_ctx_stack.pop()
assert rv is self, 'Popped wrong request context. (%r instead of %r)' \
% (rv, self)
# get rid of circular dependencies at the end of the request
# so that we don't require the GC to be active.
if clear_request:
rv.request.environ['werkzeug.request'] = None
# Get rid of the app as well if necessary.
if app_ctx is not None:
app_ctx.pop(exc)
def auto_pop(self, exc):
if self.request.environ.get('flask._preserve_context') or \
(exc is not None and self.app.preserve_context_on_exception):
self.preserved = True
self._preserved_exc = exc
else:
self.pop(exc)
def __enter__(self):
self.push()
return self
def __exit__(self, exc_type, exc_value, tb):
# do not pop the request stack if we are in debug mode and an
# exception happened. This will allow the debugger to still
# access the request object in the interactive shell. Furthermore
# the context can be force kept alive for the test client.
# See flask.testing for how this works.
self.auto_pop(exc_value)
def __repr__(self):
return '<%s \'%s\' [%s] of %s>' % (
self.__class__.__name__,
self.request.url,
self.request.method,
self.app.name,
)
================================================
FILE: lib/flask/debughelpers.py
================================================
# -*- coding: utf-8 -*-
"""
flask.debughelpers
~~~~~~~~~~~~~~~~~~
Various helpers to make the development experience better.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from ._compat import implements_to_string
class UnexpectedUnicodeError(AssertionError, UnicodeError):
"""Raised in places where we want some better error reporting for
unexpected unicode or binary data.
"""
@implements_to_string
class DebugFilesKeyError(KeyError, AssertionError):
"""Raised from request.files during debugging. The idea is that it can
provide a better error message than just a generic KeyError/BadRequest.
"""
def __init__(self, request, key):
form_matches = request.form.getlist(key)
buf = ['You tried to access the file "%s" in the request.files '
'dictionary but it does not exist. The mimetype for the request '
'is "%s" instead of "multipart/form-data" which means that no '
'file contents were transmitted. To fix this error you should '
'provide enctype="multipart/form-data" in your form.' %
(key, request.mimetype)]
if form_matches:
buf.append('\n\nThe browser instead transmitted some file names. '
'This was submitted: %s' % ', '.join('"%s"' % x
for x in form_matches))
self.msg = ''.join(buf)
def __str__(self):
return self.msg
class FormDataRoutingRedirect(AssertionError):
"""This exception is raised by Flask in debug mode if it detects a
redirect caused by the routing system when the request method is not
GET, HEAD or OPTIONS. Reasoning: form data will be dropped.
"""
def __init__(self, request):
exc = request.routing_exception
buf = ['A request was sent to this URL (%s) but a redirect was '
'issued automatically by the routing system to "%s".'
% (request.url, exc.new_url)]
# In case just a slash was appended we can be extra helpful
if request.base_url + '/' == exc.new_url.split('?')[0]:
buf.append(' The URL was defined with a trailing slash so '
'Flask will automatically redirect to the URL '
'with the trailing slash if it was accessed '
'without one.')
buf.append(' Make sure to directly send your %s-request to this URL '
'since we can\'t make browsers or HTTP clients redirect '
'with form data reliably or without user interaction.' %
request.method)
buf.append('\n\nNote: this exception is only raised in debug mode')
AssertionError.__init__(self, ''.join(buf).encode('utf-8'))
def attach_enctype_error_multidict(request):
"""Since Flask 0.8 we're monkeypatching the files object in case a
request is detected that does not use multipart form data but the files
object is accessed.
"""
oldcls = request.files.__class__
class newcls(oldcls):
def __getitem__(self, key):
try:
return oldcls.__getitem__(self, key)
except KeyError as e:
if key not in request.form:
raise
raise DebugFilesKeyError(request, key)
newcls.__name__ = oldcls.__name__
newcls.__module__ = oldcls.__module__
request.files.__class__ = newcls
================================================
FILE: lib/flask/ext/__init__.py
================================================
# -*- coding: utf-8 -*-
"""
flask.ext
~~~~~~~~~
Redirect imports for extensions. This module basically makes it possible
for us to transition from flaskext.foo to flask_foo without having to
force all extensions to upgrade at the same time.
When a user does ``from flask.ext.foo import bar`` it will attempt to
import ``from flask_foo import bar`` first and when that fails it will
try to import ``from flaskext.foo import bar``.
We're switching from namespace packages because it was just too painful for
everybody involved.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
def setup():
from ..exthook import ExtensionImporter
importer = ExtensionImporter(['flask_%s', 'flaskext.%s'], __name__)
importer.install()
setup()
del setup
================================================
FILE: lib/flask/exthook.py
================================================
# -*- coding: utf-8 -*-
"""
flask.exthook
~~~~~~~~~~~~~
Redirect imports for extensions. This module basically makes it possible
for us to transition from flaskext.foo to flask_foo without having to
force all extensions to upgrade at the same time.
When a user does ``from flask.ext.foo import bar`` it will attempt to
import ``from flask_foo import bar`` first and when that fails it will
try to import ``from flaskext.foo import bar``.
We're switching from namespace packages because it was just too painful for
everybody involved.
This is used by `flask.ext`.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import sys
import os
from ._compat import reraise
class ExtensionImporter(object):
"""This importer redirects imports from this submodule to other locations.
This makes it possible to transition from the old flaskext.name to the
newer flask_name without people having a hard time.
"""
def __init__(self, module_choices, wrapper_module):
self.module_choices = module_choices
self.wrapper_module = wrapper_module
self.prefix = wrapper_module + '.'
self.prefix_cutoff = wrapper_module.count('.') + 1
def __eq__(self, other):
return self.__class__.__module__ == other.__class__.__module__ and \
self.__class__.__name__ == other.__class__.__name__ and \
self.wrapper_module == other.wrapper_module and \
self.module_choices == other.module_choices
def __ne__(self, other):
return not self.__eq__(other)
def install(self):
sys.meta_path[:] = [x for x in sys.meta_path if self != x] + [self]
def find_module(self, fullname, path=None):
if fullname.startswith(self.prefix):
return self
def load_module(self, fullname):
if fullname in sys.modules:
return sys.modules[fullname]
modname = fullname.split('.', self.prefix_cutoff)[self.prefix_cutoff]
for path in self.module_choices:
realname = path % modname
try:
__import__(realname)
except ImportError:
exc_type, exc_value, tb = sys.exc_info()
# since we only establish the entry in sys.modules at the
# very this seems to be redundant, but if recursive imports
# happen we will call into the move import a second time.
# On the second invocation we still don't have an entry for
# fullname in sys.modules, but we will end up with the same
# fake module name and that import will succeed since this
# one already has a temporary entry in the modules dict.
# Since this one "succeeded" temporarily that second
# invocation now will have created a fullname entry in
# sys.modules which we have to kill.
sys.modules.pop(fullname, None)
# If it's an important traceback we reraise it, otherwise
# we swallow it and try the next choice. The skipped frame
# is the one from __import__ above which we don't care about
if self.is_important_traceback(realname, tb):
reraise(exc_type, exc_value, tb.tb_next)
continue
module = sys.modules[fullname] = sys.modules[realname]
if '.' not in modname:
setattr(sys.modules[self.wrapper_module], modname, module)
return module
raise ImportError('No module named %s' % fullname)
def is_important_traceback(self, important_module, tb):
"""Walks a traceback's frames and checks if any of the frames
originated in the given important module. If that is the case then we
were able to import the module itself but apparently something went
wrong when the module was imported. (Eg: import of an import failed).
"""
while tb is not None:
if self.is_important_frame(important_module, tb):
return True
tb = tb.tb_next
return False
def is_important_frame(self, important_module, tb):
"""Checks a single frame if it's important."""
g = tb.tb_frame.f_globals
if '__name__' not in g:
return False
module_name = g['__name__']
# Python 2.7 Behavior. Modules are cleaned up late so the
# name shows up properly here. Success!
if module_name == important_module:
return True
# Some python versions will will clean up modules so early that the
# module name at that point is no longer set. Try guessing from
# the filename then.
filename = os.path.abspath(tb.tb_frame.f_code.co_filename)
test_string = os.path.sep + important_module.replace('.', os.path.sep)
return test_string + '.py' in filename or \
test_string + os.path.sep + '__init__.py' in filename
================================================
FILE: lib/flask/globals.py
================================================
# -*- coding: utf-8 -*-
"""
flask.globals
~~~~~~~~~~~~~
Defines all the global objects that are proxies to the current
active context.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from functools import partial
from werkzeug.local import LocalStack, LocalProxy
def _lookup_req_object(name):
top = _request_ctx_stack.top
if top is None:
raise RuntimeError('working outside of request context')
return getattr(top, name)
def _lookup_app_object(name):
top = _app_ctx_stack.top
if top is None:
raise RuntimeError('working outside of application context')
return getattr(top, name)
def _find_app():
top = _app_ctx_stack.top
if top is None:
raise RuntimeError('working outside of application context')
return top.app
# context locals
_request_ctx_stack = LocalStack()
_app_ctx_stack = LocalStack()
current_app = LocalProxy(_find_app)
request = LocalProxy(partial(_lookup_req_object, 'request'))
session = LocalProxy(partial(_lookup_req_object, 'session'))
g = LocalProxy(partial(_lookup_app_object, 'g'))
================================================
FILE: lib/flask/helpers.py
================================================
# -*- coding: utf-8 -*-
"""
flask.helpers
~~~~~~~~~~~~~
Implements various helpers.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import os
import sys
import pkgutil
import posixpath
import mimetypes
from time import time
from zlib import adler32
from threading import RLock
from werkzeug.routing import BuildError
from functools import update_wrapper
try:
from werkzeug.urls import url_quote
except ImportError:
from urlparse import quote as url_quote
from werkzeug.datastructures import Headers
from werkzeug.exceptions import NotFound
# this was moved in 0.7
try:
from werkzeug.wsgi import wrap_file
except ImportError:
from werkzeug.utils import wrap_file
from jinja2 import FileSystemLoader
from .signals import message_flashed
from .globals import session, _request_ctx_stack, _app_ctx_stack, \
current_app, request
from ._compat import string_types, text_type
# sentinel
_missing = object()
# what separators does this operating system provide that are not a slash?
# this is used by the send_from_directory function to ensure that nobody is
# able to access files from outside the filesystem.
_os_alt_seps = list(sep for sep in [os.path.sep, os.path.altsep]
if sep not in (None, '/'))
def _endpoint_from_view_func(view_func):
"""Internal helper that returns the default endpoint for a given
function. This always is the function name.
"""
assert view_func is not None, 'expected view func if endpoint ' \
'is not provided.'
return view_func.__name__
def stream_with_context(generator_or_function):
"""Request contexts disappear when the response is started on the server.
This is done for efficiency reasons and to make it less likely to encounter
memory leaks with badly written WSGI middlewares. The downside is that if
you are using streamed responses, the generator cannot access request bound
information any more.
This function however can help you keep the context around for longer::
from flask import stream_with_context, request, Response
@app.route('/stream')
def streamed_response():
@stream_with_context
def generate():
yield 'Hello '
yield request.args['name']
yield '!'
return Response(generate())
Alternatively it can also be used around a specific generator::
from flask import stream_with_context, request, Response
@app.route('/stream')
def streamed_response():
def generate():
yield 'Hello '
yield request.args['name']
yield '!'
return Response(stream_with_context(generate()))
.. versionadded:: 0.9
"""
try:
gen = iter(generator_or_function)
except TypeError:
def decorator(*args, **kwargs):
gen = generator_or_function()
return stream_with_context(gen)
return update_wrapper(decorator, generator_or_function)
def generator():
ctx = _request_ctx_stack.top
if ctx is None:
raise RuntimeError('Attempted to stream with context but '
'there was no context in the first place to keep around.')
with ctx:
# Dummy sentinel. Has to be inside the context block or we're
# not actually keeping the context around.
yield None
# The try/finally is here so that if someone passes a WSGI level
# iterator in we're still running the cleanup logic. Generators
# don't need that because they are closed on their destruction
# automatically.
try:
for item in gen:
yield item
finally:
if hasattr(gen, 'close'):
gen.close()
# The trick is to start the generator. Then the code execution runs until
# the first dummy None is yielded at which point the context was already
# pushed. This item is discarded. Then when the iteration continues the
# real generator is executed.
wrapped_g = generator()
next(wrapped_g)
return wrapped_g
def make_response(*args):
"""Sometimes it is necessary to set additional headers in a view. Because
views do not have to return response objects but can return a value that
is converted into a response object by Flask itself, it becomes tricky to
add headers to it. This function can be called instead of using a return
and you will get a response object which you can use to attach headers.
If view looked like this and you want to add a new header::
def index():
return render_template('index.html', foo=42)
You can now do something like this::
def index():
response = make_response(render_template('index.html', foo=42))
gitextract_vdmaijab/ ├── .gitignore ├── .playground ├── CONTRIB.md ├── LICENSE ├── README.md ├── app.yaml ├── appengine_config.py ├── lib/ │ ├── Flask-0.10.dist-info/ │ │ ├── DESCRIPTION.rst │ │ ├── METADATA │ │ ├── RECORD │ │ ├── WHEEL │ │ ├── metadata.json │ │ └── top_level.txt │ ├── Jinja2-2.8.dist-info/ │ │ ├── DESCRIPTION.rst │ │ ├── METADATA │ │ ├── RECORD │ │ ├── WHEEL │ │ ├── entry_points.txt │ │ ├── metadata.json │ │ └── top_level.txt │ ├── MarkupSafe-0.23.dist-info/ │ │ ├── DESCRIPTION.rst │ │ ├── METADATA │ │ ├── RECORD │ │ ├── WHEEL │ │ ├── metadata.json │ │ └── top_level.txt │ ├── README.md │ ├── Werkzeug-0.11.dist-info/ │ │ ├── DESCRIPTION.rst │ │ ├── METADATA │ │ ├── RECORD │ │ ├── WHEEL │ │ ├── metadata.json │ │ └── top_level.txt │ ├── flask/ │ │ ├── __init__.py │ │ ├── _compat.py │ │ ├── app.py │ │ ├── blueprints.py │ │ ├── config.py │ │ ├── ctx.py │ │ ├── debughelpers.py │ │ ├── ext/ │ │ │ └── __init__.py │ │ ├── exthook.py │ │ ├── globals.py │ │ ├── helpers.py │ │ ├── json.py │ │ ├── logging.py │ │ ├── module.py │ │ ├── sessions.py │ │ ├── signals.py │ │ ├── templating.py │ │ ├── testing.py │ │ ├── testsuite/ │ │ │ ├── __init__.py │ │ │ ├── appctx.py │ │ │ ├── basic.py │ │ │ ├── blueprints.py │ │ │ ├── config.py │ │ │ ├── deprecations.py │ │ │ ├── examples.py │ │ │ ├── ext.py │ │ │ ├── helpers.py │ │ │ ├── regression.py │ │ │ ├── reqctx.py │ │ │ ├── signals.py │ │ │ ├── static/ │ │ │ │ └── index.html │ │ │ ├── subclassing.py │ │ │ ├── templates/ │ │ │ │ ├── _macro.html │ │ │ │ ├── context_template.html │ │ │ │ ├── escaping_template.html │ │ │ │ ├── mail.txt │ │ │ │ ├── nested/ │ │ │ │ │ └── nested.txt │ │ │ │ ├── simple_template.html │ │ │ │ ├── template_filter.html │ │ │ │ └── template_test.html │ │ │ ├── templating.py │ │ │ ├── test_apps/ │ │ │ │ ├── blueprintapp/ │ │ │ │ │ ├── __init__.py │ │ │ │ │ └── apps/ │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── admin/ │ │ │ │ │ │ ├── __init__.py │ │ │ │ │ │ ├── static/ │ │ │ │ │ │ │ ├── css/ │ │ │ │ │ │ │ │ └── test.css │ │ │ │ │ │ │ └── test.txt │ │ │ │ │ │ └── templates/ │ │ │ │ │ │ └── admin/ │ │ │ │ │ │ └── index.html │ │ │ │ │ └── frontend/ │ │ │ │ │ ├── __init__.py │ │ │ │ │ └── templates/ │ │ │ │ │ └── frontend/ │ │ │ │ │ └── index.html │ │ │ │ ├── config_module_app.py │ │ │ │ ├── config_package_app/ │ │ │ │ │ └── __init__.py │ │ │ │ ├── flask_broken/ │ │ │ │ │ ├── __init__.py │ │ │ │ │ └── b.py │ │ │ │ ├── flask_newext_package/ │ │ │ │ │ ├── __init__.py │ │ │ │ │ └── submodule.py │ │ │ │ ├── flask_newext_simple.py │ │ │ │ ├── flaskext/ │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── oldext_package/ │ │ │ │ │ │ ├── __init__.py │ │ │ │ │ │ └── submodule.py │ │ │ │ │ └── oldext_simple.py │ │ │ │ ├── importerror.py │ │ │ │ ├── lib/ │ │ │ │ │ └── python2.5/ │ │ │ │ │ └── site-packages/ │ │ │ │ │ ├── SiteEgg.egg │ │ │ │ │ ├── site_app.py │ │ │ │ │ └── site_package/ │ │ │ │ │ └── __init__.py │ │ │ │ ├── main_app.py │ │ │ │ ├── moduleapp/ │ │ │ │ │ ├── __init__.py │ │ │ │ │ └── apps/ │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── admin/ │ │ │ │ │ │ ├── __init__.py │ │ │ │ │ │ ├── static/ │ │ │ │ │ │ │ ├── css/ │ │ │ │ │ │ │ │ └── test.css │ │ │ │ │ │ │ └── test.txt │ │ │ │ │ │ └── templates/ │ │ │ │ │ │ └── index.html │ │ │ │ │ └── frontend/ │ │ │ │ │ ├── __init__.py │ │ │ │ │ └── templates/ │ │ │ │ │ └── index.html │ │ │ │ ├── path/ │ │ │ │ │ └── installed_package/ │ │ │ │ │ └── __init__.py │ │ │ │ └── subdomaintestmodule/ │ │ │ │ ├── __init__.py │ │ │ │ └── static/ │ │ │ │ └── hello.txt │ │ │ ├── testing.py │ │ │ └── views.py │ │ ├── views.py │ │ └── wrappers.py │ ├── itsdangerous-0.24.dist-info/ │ │ ├── DESCRIPTION.rst │ │ ├── METADATA │ │ ├── RECORD │ │ ├── WHEEL │ │ ├── metadata.json │ │ └── top_level.txt │ ├── itsdangerous.py │ ├── jinja2/ │ │ ├── __init__.py │ │ ├── _compat.py │ │ ├── _stringdefs.py │ │ ├── bccache.py │ │ ├── compiler.py │ │ ├── constants.py │ │ ├── debug.py │ │ ├── defaults.py │ │ ├── environment.py │ │ ├── exceptions.py │ │ ├── ext.py │ │ ├── filters.py │ │ ├── lexer.py │ │ ├── loaders.py │ │ ├── meta.py │ │ ├── nodes.py │ │ ├── optimizer.py │ │ ├── parser.py │ │ ├── runtime.py │ │ ├── sandbox.py │ │ ├── tests.py │ │ ├── utils.py │ │ └── visitor.py │ ├── markupsafe/ │ │ ├── __init__.py │ │ ├── _compat.py │ │ ├── _constants.py │ │ ├── _native.py │ │ ├── _speedups.c │ │ └── tests.py │ └── werkzeug/ │ ├── __init__.py │ ├── _compat.py │ ├── _internal.py │ ├── _reloader.py │ ├── contrib/ │ │ ├── __init__.py │ │ ├── atom.py │ │ ├── cache.py │ │ ├── fixers.py │ │ ├── iterio.py │ │ ├── jsrouting.py │ │ ├── limiter.py │ │ ├── lint.py │ │ ├── profiler.py │ │ ├── securecookie.py │ │ ├── sessions.py │ │ ├── testtools.py │ │ └── wrappers.py │ ├── datastructures.py │ ├── debug/ │ │ ├── __init__.py │ │ ├── console.py │ │ ├── repr.py │ │ ├── shared/ │ │ │ ├── FONT_LICENSE │ │ │ ├── debugger.js │ │ │ ├── jquery.js │ │ │ └── style.css │ │ └── tbtools.py │ ├── exceptions.py │ ├── filesystem.py │ ├── formparser.py │ ├── http.py │ ├── local.py │ ├── posixemulation.py │ ├── routing.py │ ├── script.py │ ├── security.py │ ├── serving.py │ ├── test.py │ ├── testapp.py │ ├── urls.py │ ├── useragents.py │ ├── utils.py │ ├── wrappers.py │ └── wsgi.py ├── main.py └── requirements.txt
Showing preview only (209K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (2864 symbols across 107 files)
FILE: lib/flask/_compat.py
function reraise (line 30) | def reraise(tp, value, tb=None):
function implements_to_string (line 50) | def implements_to_string(cls):
function with_metaclass (line 56) | def with_metaclass(meta, *bases):
FILE: lib/flask/app.py
function _make_timedelta (line 43) | def _make_timedelta(value):
function setupmethod (line 49) | def setupmethod(f):
class Flask (line 66) | class Flask(_PackageBoundObject):
method _get_request_globals_class (line 167) | def _get_request_globals_class(self):
method _set_request_globals_class (line 169) | def _set_request_globals_class(self, value):
method __init__ (line 315) | def __init__(self, import_name, static_path=None, static_url_path=None,
method _get_error_handlers (line 511) | def _get_error_handlers(self):
method _set_error_handlers (line 516) | def _set_error_handlers(self, value):
method name (line 523) | def name(self):
method propagate_exceptions (line 540) | def propagate_exceptions(self):
method preserve_context_on_exception (line 552) | def preserve_context_on_exception(self):
method logger (line 565) | def logger(self):
method jinja_env (line 587) | def jinja_env(self):
method got_first_request (line 592) | def got_first_request(self):
method make_config (line 600) | def make_config(self, instance_relative=False):
method auto_find_instance_path (line 614) | def auto_find_instance_path(self):
method open_instance_resource (line 627) | def open_instance_resource(self, resource, mode='rb'):
method create_jinja_environment (line 639) | def create_jinja_environment(self):
method create_global_jinja_loader (line 665) | def create_global_jinja_loader(self):
method init_jinja_globals (line 678) | def init_jinja_globals(self):
method select_jinja_autoescape (line 687) | def select_jinja_autoescape(self, filename):
method update_template_context (line 697) | def update_template_context(self, context):
method run (line 722) | def run(self, host=None, port=None, debug=None, **options):
method test_client (line 779) | def test_client(self, use_cookies=True):
method open_session (line 817) | def open_session(self, request):
method save_session (line 827) | def save_session(self, session, response):
method make_null_session (line 839) | def make_null_session(self):
method register_module (line 847) | def register_module(self, module, **options):
method register_blueprint (line 874) | def register_blueprint(self, blueprint, **options):
method add_url_rule (line 892) | def add_url_rule(self, rule, endpoint=None, view_func=None, **options):
method route (line 987) | def route(self, rule, **options):
method endpoint (line 1018) | def endpoint(self, endpoint):
method errorhandler (line 1034) | def errorhandler(self, code_or_exception):
method register_error_handler (line 1075) | def register_error_handler(self, code_or_exception, f):
method _register_error_handler (line 1085) | def _register_error_handler(self, key, code_or_exception, f):
method template_filter (line 1098) | def template_filter(self, name=None):
method add_template_filter (line 1116) | def add_template_filter(self, f, name=None):
method template_test (line 1126) | def template_test(self, name=None):
method add_template_test (line 1151) | def add_template_test(self, f, name=None):
method template_global (line 1164) | def template_global(self, name=None):
method add_template_global (line 1184) | def add_template_global(self, f, name=None):
method before_request (line 1196) | def before_request(self, f):
method before_first_request (line 1202) | def before_first_request(self, f):
method after_request (line 1211) | def after_request(self, f):
method teardown_request (line 1223) | def teardown_request(self, f):
method teardown_appcontext (line 1260) | def teardown_appcontext(self, f):
method context_processor (line 1289) | def context_processor(self, f):
method url_value_preprocessor (line 1295) | def url_value_preprocessor(self, f):
method url_defaults (line 1304) | def url_defaults(self, f):
method handle_http_exception (line 1312) | def handle_http_exception(self, e):
method trap_http_exception (line 1332) | def trap_http_exception(self, e):
method handle_user_exception (line 1352) | def handle_user_exception(self, e):
method handle_exception (line 1383) | def handle_exception(self, e):
method log_exception (line 1412) | def log_exception(self, exc_info):
method raise_routing_exception (line 1425) | def raise_routing_exception(self, request):
method dispatch_request (line 1441) | def dispatch_request(self):
method full_dispatch_request (line 1463) | def full_dispatch_request(self):
method try_trigger_before_first_request_functions (line 1483) | def try_trigger_before_first_request_functions(self):
method make_default_options_response (line 1499) | def make_default_options_response(self):
method should_ignore_error (line 1522) | def should_ignore_error(self, error):
method make_response (line 1532) | def make_response(self, rv):
method create_url_adapter (line 1589) | def create_url_adapter(self, request):
method inject_url_defaults (line 1611) | def inject_url_defaults(self, endpoint, values):
method handle_url_build_error (line 1625) | def handle_url_build_error(self, error, endpoint, values):
method preprocess_request (line 1644) | def preprocess_request(self):
method process_response (line 1670) | def process_response(self, response):
method do_teardown_request (line 1696) | def do_teardown_request(self, exc=None):
method do_teardown_appcontext (line 1717) | def do_teardown_appcontext(self, exc=None):
method app_context (line 1730) | def app_context(self):
method request_context (line 1745) | def request_context(self, environ):
method test_request_context (line 1775) | def test_request_context(self, *args, **kwargs):
method wsgi_app (line 1787) | def wsgi_app(self, environ, start_response):
method modules (line 1828) | def modules(self):
method __call__ (line 1834) | def __call__(self, environ, start_response):
method __repr__ (line 1838) | def __repr__(self):
FILE: lib/flask/blueprints.py
class BlueprintSetupState (line 17) | class BlueprintSetupState(object):
method __init__ (line 24) | def __init__(self, blueprint, app, options, first_registration):
method add_url_rule (line 62) | def add_url_rule(self, rule, endpoint=None, view_func=None, **options):
class Blueprint (line 79) | class Blueprint(_PackageBoundObject):
method __init__ (line 92) | def __init__(self, name, import_name, static_folder=None,
method record (line 107) | def record(self, func):
method record_once (line 120) | def record_once(self, func):
method make_setup_state (line 131) | def make_setup_state(self, app, options, first_registration=False):
method register (line 138) | def register(self, app, options, first_registration=False):
method route (line 155) | def route(self, rule, **options):
method add_url_rule (line 165) | def add_url_rule(self, rule, endpoint=None, view_func=None, **options):
method endpoint (line 174) | def endpoint(self, endpoint):
method app_template_filter (line 188) | def app_template_filter(self, name=None):
method add_app_template_filter (line 200) | def add_app_template_filter(self, f, name=None):
method app_template_test (line 212) | def app_template_test(self, name=None):
method add_app_template_test (line 226) | def add_app_template_test(self, f, name=None):
method app_template_global (line 240) | def app_template_global(self, name=None):
method add_app_template_global (line 254) | def add_app_template_global(self, f, name=None):
method before_request (line 268) | def before_request(self, f):
method before_app_request (line 277) | def before_app_request(self, f):
method before_app_first_request (line 285) | def before_app_first_request(self, f):
method after_request (line 292) | def after_request(self, f):
method after_app_request (line 301) | def after_app_request(self, f):
method teardown_request (line 309) | def teardown_request(self, f):
method teardown_app_request (line 320) | def teardown_app_request(self, f):
method context_processor (line 329) | def context_processor(self, f):
method app_context_processor (line 337) | def app_context_processor(self, f):
method app_errorhandler (line 345) | def app_errorhandler(self, code):
method url_value_preprocessor (line 354) | def url_value_preprocessor(self, f):
method url_defaults (line 363) | def url_defaults(self, f):
method app_url_value_preprocessor (line 372) | def app_url_value_preprocessor(self, f):
method app_url_defaults (line 379) | def app_url_defaults(self, f):
method errorhandler (line 386) | def errorhandler(self, code_or_exception):
FILE: lib/flask/config.py
class ConfigAttribute (line 20) | class ConfigAttribute(object):
method __init__ (line 23) | def __init__(self, name, get_converter=None):
method __get__ (line 27) | def __get__(self, obj, type=None):
method __set__ (line 35) | def __set__(self, obj, value):
class Config (line 39) | class Config(dict):
method __init__ (line 83) | def __init__(self, root_path, defaults=None):
method from_envvar (line 87) | def from_envvar(self, variable_name, silent=False):
method from_pyfile (line 110) | def from_pyfile(self, filename, silent=False):
method from_object (line 138) | def from_object(self, obj):
method __repr__ (line 167) | def __repr__(self):
FILE: lib/flask/ctx.py
class _AppCtxGlobals (line 24) | class _AppCtxGlobals(object):
method get (line 27) | def get(self, name, default=None):
method __contains__ (line 30) | def __contains__(self, item):
method __iter__ (line 33) | def __iter__(self):
method __repr__ (line 36) | def __repr__(self):
function after_this_request (line 43) | def after_this_request(f):
function copy_current_request_context (line 68) | def copy_current_request_context(f):
function has_request_context (line 103) | def has_request_context():
function has_app_context (line 135) | def has_app_context():
class AppContext (line 145) | class AppContext(object):
method __init__ (line 154) | def __init__(self, app):
method push (line 163) | def push(self):
method pop (line 169) | def pop(self, exc=None):
method __enter__ (line 181) | def __enter__(self):
method __exit__ (line 185) | def __exit__(self, exc_type, exc_value, tb):
class RequestContext (line 189) | class RequestContext(object):
method __init__ (line 219) | def __init__(self, app, environ, request=None):
method _get_g (line 259) | def _get_g(self):
method _set_g (line 261) | def _set_g(self, value):
method copy (line 266) | def copy(self):
method match_request (line 280) | def match_request(self):
method push (line 291) | def push(self):
method pop (line 325) | def pop(self, exc=None):
method auto_pop (line 368) | def auto_pop(self, exc):
method __enter__ (line 376) | def __enter__(self):
method __exit__ (line 380) | def __exit__(self, exc_type, exc_value, tb):
method __repr__ (line 388) | def __repr__(self):
FILE: lib/flask/debughelpers.py
class UnexpectedUnicodeError (line 14) | class UnexpectedUnicodeError(AssertionError, UnicodeError):
class DebugFilesKeyError (line 21) | class DebugFilesKeyError(KeyError, AssertionError):
method __init__ (line 26) | def __init__(self, request, key):
method __str__ (line 40) | def __str__(self):
class FormDataRoutingRedirect (line 44) | class FormDataRoutingRedirect(AssertionError):
method __init__ (line 50) | def __init__(self, request):
function attach_enctype_error_multidict (line 71) | def attach_enctype_error_multidict(request):
FILE: lib/flask/ext/__init__.py
function setup (line 22) | def setup():
FILE: lib/flask/exthook.py
class ExtensionImporter (line 27) | class ExtensionImporter(object):
method __init__ (line 33) | def __init__(self, module_choices, wrapper_module):
method __eq__ (line 39) | def __eq__(self, other):
method __ne__ (line 45) | def __ne__(self, other):
method install (line 48) | def install(self):
method find_module (line 51) | def find_module(self, fullname, path=None):
method load_module (line 55) | def load_module(self, fullname):
method is_important_traceback (line 89) | def is_important_traceback(self, important_module, tb):
method is_important_frame (line 101) | def is_important_frame(self, important_module, tb):
FILE: lib/flask/globals.py
function _lookup_req_object (line 17) | def _lookup_req_object(name):
function _lookup_app_object (line 24) | def _lookup_app_object(name):
function _find_app (line 31) | def _find_app():
FILE: lib/flask/helpers.py
function _endpoint_from_view_func (line 56) | def _endpoint_from_view_func(view_func):
function stream_with_context (line 65) | def stream_with_context(generator_or_function):
function make_response (line 137) | def make_response(*args):
function url_for (line 186) | def url_for(endpoint, **values):
function get_template_attribute (line 319) | def get_template_attribute(template_name, attribute):
function flash (line 342) | def flash(message, category='message'):
function get_flashed_messages (line 371) | def get_flashed_messages(with_categories=False, category_filter=[]):
function send_file (line 410) | def send_file(filename_or_fp, mimetype=None, as_attachment=False,
function safe_join (line 558) | def safe_join(directory, filename):
function send_from_directory (line 585) | def send_from_directory(directory, filename, **options):
function get_root_path (line 619) | def get_root_path(import_name):
function find_package (line 652) | def find_package(import_name):
class locked_cached_property (line 703) | class locked_cached_property(object):
method __init__ (line 711) | def __init__(self, func, name=None, doc=None):
method __get__ (line 718) | def __get__(self, obj, type=None):
class _PackageBoundObject (line 729) | class _PackageBoundObject(object):
method __init__ (line 731) | def __init__(self, import_name, template_folder=None):
method _get_static_folder (line 746) | def _get_static_folder(self):
method _set_static_folder (line 749) | def _set_static_folder(self, value):
method _get_static_url_path (line 754) | def _get_static_url_path(self):
method _set_static_url_path (line 760) | def _set_static_url_path(self, value):
method has_static_folder (line 766) | def has_static_folder(self):
method jinja_loader (line 775) | def jinja_loader(self):
method get_send_file_max_age (line 784) | def get_send_file_max_age(self, filename):
method send_static_file (line 810) | def send_static_file(self, filename):
method open_resource (line 824) | def open_resource(self, resource, mode='rb'):
FILE: lib/flask/json.py
function _wrap_reader_for_text (line 38) | def _wrap_reader_for_text(fp, encoding):
function _wrap_writer_for_text (line 44) | def _wrap_writer_for_text(fp, encoding):
class JSONEncoder (line 52) | class JSONEncoder(_json.JSONEncoder):
method default (line 60) | def default(self, o):
class JSONDecoder (line 86) | class JSONDecoder(_json.JSONDecoder):
function _dump_arg_defaults (line 94) | def _dump_arg_defaults(kwargs):
function _load_arg_defaults (line 106) | def _load_arg_defaults(kwargs):
function dumps (line 114) | def dumps(obj, **kwargs):
function dump (line 132) | def dump(obj, fp, **kwargs):
function loads (line 141) | def loads(s, **kwargs):
function load (line 152) | def load(fp, **kwargs):
function htmlsafe_dumps (line 161) | def htmlsafe_dumps(obj, **kwargs):
function htmlsafe_dump (line 181) | def htmlsafe_dump(obj, fp, **kwargs):
function jsonify (line 186) | def jsonify(*args, **kwargs):
function tojson_filter (line 227) | def tojson_filter(obj, **kwargs):
FILE: lib/flask/logging.py
function create_logger (line 17) | def create_logger(app):
FILE: lib/flask/module.py
function blueprint_is_module (line 17) | def blueprint_is_module(bp):
class Module (line 22) | class Module(Blueprint):
method __init__ (line 32) | def __init__(self, import_name, name=None, url_prefix=None,
FILE: lib/flask/sessions.py
function total_seconds (line 23) | def total_seconds(td):
class SessionMixin (line 27) | class SessionMixin(object):
method _get_permanent (line 32) | def _get_permanent(self):
method _set_permanent (line 35) | def _set_permanent(self, value):
class TaggedJSONSerializer (line 54) | class TaggedJSONSerializer(object):
method dumps (line 59) | def dumps(self, value):
method loads (line 84) | def loads(self, value):
class SecureCookieSession (line 104) | class SecureCookieSession(CallbackDict, SessionMixin):
method __init__ (line 107) | def __init__(self, initial=None):
class NullSession (line 114) | class NullSession(SecureCookieSession):
method _fail (line 120) | def _fail(self, *args, **kwargs):
class SessionInterface (line 129) | class SessionInterface(object):
method make_null_session (line 172) | def make_null_session(self, app):
method is_null_session (line 184) | def is_null_session(self, obj):
method get_cookie_domain (line 193) | def get_cookie_domain(self, app):
method get_cookie_path (line 219) | def get_cookie_path(self, app):
method get_cookie_httponly (line 228) | def get_cookie_httponly(self, app):
method get_cookie_secure (line 235) | def get_cookie_secure(self, app):
method get_expiration_time (line 241) | def get_expiration_time(self, app, session):
method open_session (line 250) | def open_session(self, app, request):
method save_session (line 258) | def save_session(self, app, session, response):
class SecureCookieSessionInterface (line 267) | class SecureCookieSessionInterface(SessionInterface):
method get_signing_serializer (line 285) | def get_signing_serializer(self, app):
method open_session (line 296) | def open_session(self, app, request):
method save_session (line 310) | def save_session(self, app, session, response):
FILE: lib/flask/signals.py
class Namespace (line 17) | class Namespace(object):
method signal (line 18) | def signal(self, name, doc=None):
class _FakeSignal (line 21) | class _FakeSignal(object):
method __init__ (line 28) | def __init__(self, name, doc=None):
method _fail (line 31) | def _fail(self, *args, **kwargs):
FILE: lib/flask/templating.py
function _default_template_ctx_processor (line 21) | def _default_template_ctx_processor():
class Environment (line 36) | class Environment(BaseEnvironment):
method __init__ (line 42) | def __init__(self, app, **options):
class DispatchingJinjaLoader (line 49) | class DispatchingJinjaLoader(BaseLoader):
method __init__ (line 54) | def __init__(self, app):
method get_source (line 57) | def get_source(self, environment, template):
method _iter_loaders (line 66) | def _iter_loaders(self, template):
method list_templates (line 90) | def list_templates(self):
function _render (line 108) | def _render(template, context, app):
function render_template (line 115) | def render_template(template_name_or_list, **context):
function render_template_string (line 131) | def render_template_string(source, **context):
FILE: lib/flask/testing.py
function make_test_environ_builder (line 23) | def make_test_environ_builder(app, path='/', base_url=None, *args, **kwa...
class FlaskClient (line 37) | class FlaskClient(Client):
method session_transaction (line 49) | def session_transaction(self, *args, **kwargs):
method open (line 96) | def open(self, *args, **kwargs):
method __enter__ (line 110) | def __enter__(self):
method __exit__ (line 116) | def __exit__(self, exc_type, exc_value, tb):
FILE: lib/flask/testsuite/__init__.py
function add_to_path (line 26) | def add_to_path(path):
function iter_suites (line 46) | def iter_suites():
function find_all_tests (line 54) | def find_all_tests(suite):
function catch_warnings (line 70) | def catch_warnings():
function catch_stderr (line 90) | def catch_stderr():
function emits_module_deprecation_warning (line 100) | def emits_module_deprecation_warning(f):
class FlaskTestCase (line 110) | class FlaskTestCase(unittest.TestCase):
method ensure_clean_request_context (line 116) | def ensure_clean_request_context(self):
method setup (line 124) | def setup(self):
method teardown (line 127) | def teardown(self):
method setUp (line 130) | def setUp(self):
method tearDown (line 133) | def tearDown(self):
method assert_equal (line 138) | def assert_equal(self, x, y):
method assert_raises (line 141) | def assert_raises(self, exc_type, callable=None, *args, **kwargs):
method assert_true (line 148) | def assert_true(self, x, msg=None):
method assert_false (line 151) | def assert_false(self, x, msg=None):
method assert_in (line 154) | def assert_in(self, x, y):
method assert_not_in (line 157) | def assert_not_in(self, x, y):
method assertIn (line 161) | def assertIn(self, x, y):
method assertNotIn (line 164) | def assertNotIn(self, x, y):
class _ExceptionCatcher (line 168) | class _ExceptionCatcher(object):
method __init__ (line 170) | def __init__(self, test_case, exc_type):
method __enter__ (line 174) | def __enter__(self):
method __exit__ (line 177) | def __exit__(self, exc_type, exc_value, tb):
class BetterLoader (line 187) | class BetterLoader(unittest.TestLoader):
method getRootSuite (line 196) | def getRootSuite(self):
method loadTestsFromName (line 199) | def loadTestsFromName(self, name, module=None):
function setup_path (line 223) | def setup_path():
function suite (line 228) | def suite():
function main (line 241) | def main():
FILE: lib/flask/testsuite/appctx.py
class AppContextTestCase (line 17) | class AppContextTestCase(FlaskTestCase):
method test_basic_url_generation (line 19) | def test_basic_url_generation(self):
method test_url_generation_requires_server_name (line 32) | def test_url_generation_requires_server_name(self):
method test_url_generation_without_context_fails (line 38) | def test_url_generation_without_context_fails(self):
method test_request_context_means_app_context (line 42) | def test_request_context_means_app_context(self):
method test_app_context_provides_current_app (line 48) | def test_app_context_provides_current_app(self):
method test_app_tearing_down (line 54) | def test_app_tearing_down(self):
method test_custom_app_ctx_globals_class (line 66) | def test_custom_app_ctx_globals_class(self):
method test_context_refcounts (line 76) | def test_context_refcounts(self):
function suite (line 98) | def suite():
FILE: lib/flask/testsuite/basic.py
class BasicFunctionalityTestCase (line 26) | class BasicFunctionalityTestCase(FlaskTestCase):
method test_options_work (line 28) | def test_options_work(self):
method test_options_on_multiple_rules (line 37) | def test_options_on_multiple_rules(self):
method test_options_handling_disabled (line 48) | def test_options_handling_disabled(self):
method test_request_dispatching (line 65) | def test_request_dispatching(self):
method test_url_mapping (line 88) | def test_url_mapping(self):
method test_werkzeug_routing (line 112) | def test_werkzeug_routing(self):
method test_endpoint_decorator (line 130) | def test_endpoint_decorator(self):
method test_session (line 150) | def test_session(self):
method test_session_using_server_name (line 165) | def test_session_using_server_name(self):
method test_session_using_server_name_and_port (line 179) | def test_session_using_server_name_and_port(self):
method test_session_using_server_name_port_and_path (line 193) | def test_session_using_server_name_port_and_path(self):
method test_session_using_application_root (line 209) | def test_session_using_application_root(self):
method test_session_using_session_settings (line 231) | def test_session_using_session_settings(self):
method test_missing_session (line 253) | def test_missing_session(self):
method test_session_expiration (line 267) | def test_session_expiration(self):
method test_session_stored_last (line 300) | def test_session_stored_last(self):
method test_session_special_types (line 317) | def test_session_special_types(self):
method test_flashes (line 345) | def test_flashes(self):
method test_extended_flashing (line 357) | def test_extended_flashing(self):
method test_request_processing (line 438) | def test_request_processing(self):
method test_after_request_processing (line 459) | def test_after_request_processing(self):
method test_teardown_request_handler (line 474) | def test_teardown_request_handler(self):
method test_teardown_request_handler_debug_mode (line 489) | def test_teardown_request_handler_debug_mode(self):
method test_teardown_request_handler_error (line 505) | def test_teardown_request_handler_error(self):
method test_before_after_request_order (line 538) | def test_before_after_request_order(self):
method test_error_handling (line 568) | def test_error_handling(self):
method test_before_request_and_routing_errors (line 590) | def test_before_request_and_routing_errors(self):
method test_user_error_handling (line 602) | def test_user_error_handling(self):
method test_trapping_of_bad_request_key_errors (line 618) | def test_trapping_of_bad_request_key_errors(self):
method test_trapping_of_all_http_exceptions (line 636) | def test_trapping_of_all_http_exceptions(self):
method test_enctype_debug_helper (line 652) | def test_enctype_debug_helper(self):
method test_response_creation (line 672) | def test_response_creation(self):
method test_make_response (line 695) | def test_make_response(self):
method test_make_response_with_response_instance (line 713) | def test_make_response_with_response_instance(self):
method test_url_generation (line 735) | def test_url_generation(self):
method test_build_error_handler (line 745) | def test_build_error_handler(self):
method test_custom_converters (line 771) | def test_custom_converters(self):
method test_static_files (line 787) | def test_static_files(self):
method test_none_response (line 798) | def test_none_response(self):
method test_request_locals (line 811) | def test_request_locals(self):
method test_test_app_proper_environ (line 815) | def test_test_app_proper_environ(self):
method test_exception_propagation (line 866) | def test_exception_propagation(self):
method test_max_content_length (line 893) | def test_max_content_length(self):
method test_url_processors (line 912) | def test_url_processors(self):
method test_inject_blueprint_url_defaults (line 943) | def test_inject_blueprint_url_defaults(self):
method test_nonascii_pathinfo (line 966) | def test_nonascii_pathinfo(self):
method test_debug_mode_complains_after_first_request (line 978) | def test_debug_mode_complains_after_first_request(self):
method test_before_first_request_functions (line 1002) | def test_before_first_request_functions(self):
method test_routing_redirect_debugging (line 1015) | def test_routing_redirect_debugging(self):
method test_route_decorator_custom_endpoint (line 1039) | def test_route_decorator_custom_endpoint(self):
method test_preserve_only_once (line 1065) | def test_preserve_only_once(self):
method test_preserve_remembers_exception (line 1085) | def test_preserve_remembers_exception(self):
method test_get_method_on_g (line 1119) | def test_get_method_on_g(self):
method test_g_iteration_protocol (line 1130) | def test_g_iteration_protocol(self):
class SubdomainTestCase (line 1142) | class SubdomainTestCase(FlaskTestCase):
method test_basic_support (line 1144) | def test_basic_support(self):
method test_module_static_path_subdomain (line 1162) | def test_module_static_path_subdomain(self):
method test_subdomain_matching (line 1173) | def test_subdomain_matching(self):
method test_subdomain_matching_with_ports (line 1184) | def test_subdomain_matching_with_ports(self):
method test_module_subdomain_support (line 1196) | def test_module_subdomain_support(self):
function suite (line 1218) | def suite():
FILE: lib/flask/testsuite/blueprints.py
class ModuleTestCase (line 29) | class ModuleTestCase(FlaskTestCase):
method test_basic_module (line 32) | def test_basic_module(self):
method test_default_endpoint_name (line 55) | def test_default_endpoint_name(self):
method test_request_processing (line 68) | def test_request_processing(self):
method test_context_processors (line 104) | def test_context_processors(self):
method test_late_binding (line 128) | def test_late_binding(self):
method test_error_handling (line 138) | def test_error_handling(self):
method test_templates_and_static (line 162) | def test_templates_and_static(self):
method test_safe_access (line 195) | def test_safe_access(self):
method test_endpoint_decorator (line 230) | def test_endpoint_decorator(self):
class BlueprintTestCase (line 257) | class BlueprintTestCase(FlaskTestCase):
method test_blueprint_specific_error_handling (line 259) | def test_blueprint_specific_error_handling(self):
method test_blueprint_url_definitions (line 299) | def test_blueprint_url_definitions(self):
method test_blueprint_url_processors (line 320) | def test_blueprint_url_processors(self):
method test_templates_and_static (line 347) | def test_templates_and_static(self):
method test_default_static_cache_timeout (line 393) | def test_default_static_cache_timeout(self):
method test_templates_list (line 417) | def test_templates_list(self):
method test_dotted_names (line 423) | def test_dotted_names(self):
method test_dotted_names_from_app (line 448) | def test_dotted_names_from_app(self):
method test_empty_url_defaults (line 467) | def test_empty_url_defaults(self):
method test_route_decorator_custom_endpoint (line 482) | def test_route_decorator_custom_endpoint(self):
method test_route_decorator_custom_endpoint_with_dots (line 516) | def test_route_decorator_custom_endpoint_with_dots(self):
method test_template_filter (line 568) | def test_template_filter(self):
method test_add_template_filter (line 579) | def test_add_template_filter(self):
method test_template_filter_with_name (line 590) | def test_template_filter_with_name(self):
method test_add_template_filter_with_name (line 601) | def test_add_template_filter_with_name(self):
method test_template_filter_with_template (line 612) | def test_template_filter_with_template(self):
method test_template_filter_after_route_with_template (line 625) | def test_template_filter_after_route_with_template(self):
method test_add_template_filter_with_template (line 638) | def test_add_template_filter_with_template(self):
method test_template_filter_with_name_and_template (line 651) | def test_template_filter_with_name_and_template(self):
method test_add_template_filter_with_name_and_template (line 664) | def test_add_template_filter_with_name_and_template(self):
method test_template_test (line 677) | def test_template_test(self):
method test_add_template_test (line 688) | def test_add_template_test(self):
method test_template_test_with_name (line 699) | def test_template_test_with_name(self):
method test_add_template_test_with_name (line 710) | def test_add_template_test_with_name(self):
method test_template_test_with_template (line 721) | def test_template_test_with_template(self):
method test_template_test_after_route_with_template (line 734) | def test_template_test_after_route_with_template(self):
method test_add_template_test_with_template (line 747) | def test_add_template_test_with_template(self):
method test_template_test_with_name_and_template (line 760) | def test_template_test_with_name_and_template(self):
method test_add_template_test_with_name_and_template (line 773) | def test_add_template_test_with_name_and_template(self):
function suite (line 786) | def suite():
FILE: lib/flask/testsuite/config.py
class ConfigTestCase (line 26) | class ConfigTestCase(FlaskTestCase):
method common_object_test (line 28) | def common_object_test(self, app):
method test_config_from_file (line 33) | def test_config_from_file(self):
method test_config_from_object (line 38) | def test_config_from_object(self):
method test_config_from_class (line 43) | def test_config_from_class(self):
method test_config_from_envvar (line 52) | def test_config_from_envvar(self):
method test_config_from_envvar_missing (line 71) | def test_config_from_envvar_missing(self):
method test_config_missing (line 89) | def test_config_missing(self):
method test_session_lifetime (line 102) | def test_session_lifetime(self):
class LimitedLoaderMockWrapper (line 108) | class LimitedLoaderMockWrapper(object):
method __init__ (line 109) | def __init__(self, loader):
method __getattr__ (line 112) | def __getattr__(self, name):
function patch_pkgutil_get_loader (line 120) | def patch_pkgutil_get_loader(wrapper_class=LimitedLoaderMockWrapper):
class InstanceTestCase (line 137) | class InstanceTestCase(FlaskTestCase):
method test_explicit_instance_paths (line 139) | def test_explicit_instance_paths(self):
method test_main_module_paths (line 151) | def test_main_module_paths(self):
method test_uninstalled_module_paths (line 159) | def test_uninstalled_module_paths(self):
method test_uninstalled_package_paths (line 164) | def test_uninstalled_package_paths(self):
method test_installed_module_paths (line 169) | def test_installed_module_paths(self):
method test_installed_module_paths_with_limited_loader (line 186) | def test_installed_module_paths_with_limited_loader(self):
method test_installed_package_paths (line 204) | def test_installed_package_paths(self):
method test_installed_package_paths_with_limited_loader (line 221) | def test_installed_package_paths_with_limited_loader(self):
method test_prefix_package_paths (line 239) | def test_prefix_package_paths(self):
method test_prefix_package_paths_with_limited_loader (line 256) | def test_prefix_package_paths_with_limited_loader(self):
method test_egg_installed_paths (line 274) | def test_egg_installed_paths(self):
function suite (line 295) | def suite():
FILE: lib/flask/testsuite/deprecations.py
class DeprecationsTestCase (line 17) | class DeprecationsTestCase(FlaskTestCase):
function suite (line 21) | def suite():
FILE: lib/flask/testsuite/examples.py
function setup_path (line 16) | def setup_path():
function suite (line 23) | def suite():
FILE: lib/flask/testsuite/ext.py
class ExtImportHookTestCase (line 21) | class ExtImportHookTestCase(FlaskTestCase):
method setup (line 23) | def setup(self):
method teardown (line 46) | def teardown(self):
method test_flaskext_new_simple_import_normal (line 51) | def test_flaskext_new_simple_import_normal(self):
method test_flaskext_new_simple_import_module (line 55) | def test_flaskext_new_simple_import_module(self):
method test_flaskext_new_package_import_normal (line 60) | def test_flaskext_new_package_import_normal(self):
method test_flaskext_new_package_import_module (line 64) | def test_flaskext_new_package_import_module(self):
method test_flaskext_new_package_import_submodule_function (line 69) | def test_flaskext_new_package_import_submodule_function(self):
method test_flaskext_new_package_import_submodule (line 73) | def test_flaskext_new_package_import_submodule(self):
method test_flaskext_old_simple_import_normal (line 78) | def test_flaskext_old_simple_import_normal(self):
method test_flaskext_old_simple_import_module (line 82) | def test_flaskext_old_simple_import_module(self):
method test_flaskext_old_package_import_normal (line 87) | def test_flaskext_old_package_import_normal(self):
method test_flaskext_old_package_import_module (line 91) | def test_flaskext_old_package_import_module(self):
method test_flaskext_old_package_import_submodule (line 96) | def test_flaskext_old_package_import_submodule(self):
method test_flaskext_old_package_import_submodule_function (line 101) | def test_flaskext_old_package_import_submodule_function(self):
method test_flaskext_broken_package_no_module_caching (line 105) | def test_flaskext_broken_package_no_module_caching(self):
method test_no_error_swallowing (line 110) | def test_no_error_swallowing(self):
function suite (line 131) | def suite():
FILE: lib/flask/testsuite/helpers.py
function has_encoding (line 21) | def has_encoding(name):
class JSONTestCase (line 30) | class JSONTestCase(FlaskTestCase):
method test_json_bad_requests (line 32) | def test_json_bad_requests(self):
method test_json_body_encoding (line 41) | def test_json_body_encoding(self):
method test_jsonify (line 53) | def test_jsonify(self):
method test_json_as_unicode (line 68) | def test_json_as_unicode(self):
method test_json_attr (line 81) | def test_json_attr(self):
method test_template_escaping (line 92) | def test_template_escaping(self):
method test_json_customization (line 108) | def test_json_customization(self):
method test_modified_url_encoding (line 138) | def test_modified_url_encoding(self):
method test_json_key_sorting (line 157) | def test_json_key_sorting(self):
class SendfileTestCase (line 198) | class SendfileTestCase(FlaskTestCase):
method test_send_file_regular (line 200) | def test_send_file_regular(self):
method test_send_file_xsendfile (line 211) | def test_send_file_xsendfile(self):
method test_send_file_object (line 223) | def test_send_file_object(self):
method test_attachment (line 281) | def test_attachment(self):
method test_static_file (line 311) | def test_static_file(self):
class LoggingTestCase (line 354) | class LoggingTestCase(FlaskTestCase):
method test_logger_cache (line 356) | def test_logger_cache(self):
method test_debug_log (line 364) | def test_debug_log(self):
method test_debug_log_override (line 395) | def test_debug_log_override(self):
method test_exception_logging (line 402) | def test_exception_logging(self):
method test_processor_exceptions (line 422) | def test_processor_exceptions(self):
method test_url_for_with_anchor (line 444) | def test_url_for_with_anchor(self):
method test_url_for_with_scheme (line 453) | def test_url_for_with_scheme(self):
method test_url_for_with_scheme_not_external (line 464) | def test_url_for_with_scheme_not_external(self):
method test_url_with_method (line 475) | def test_url_with_method(self):
class NoImportsTestCase (line 502) | class NoImportsTestCase(FlaskTestCase):
method test_name_with_import_error (line 513) | def test_name_with_import_error(self):
class StreamingTestCase (line 520) | class StreamingTestCase(FlaskTestCase):
method test_streaming_with_context (line 522) | def test_streaming_with_context(self):
method test_streaming_with_context_as_decorator (line 536) | def test_streaming_with_context_as_decorator(self):
method test_streaming_with_context_and_custom_close (line 551) | def test_streaming_with_context_and_custom_close(self):
function suite (line 579) | def suite():
FILE: lib/flask/testsuite/regression.py
class _NoLeakAsserter (line 25) | class _NoLeakAsserter(object):
method __init__ (line 27) | def __init__(self, testcase):
method __enter__ (line 30) | def __enter__(self):
method __exit__ (line 44) | def __exit__(self, exc_type, exc_value, tb):
class MemoryTestCase (line 54) | class MemoryTestCase(FlaskTestCase):
method assert_no_leak (line 56) | def assert_no_leak(self):
method test_memory_consumption (line 59) | def test_memory_consumption(self):
method test_safe_join_toplevel_pardir (line 81) | def test_safe_join_toplevel_pardir(self):
class ExceptionTestCase (line 87) | class ExceptionTestCase(FlaskTestCase):
method test_aborting (line 89) | def test_aborting(self):
function suite (line 111) | def suite():
FILE: lib/flask/testsuite/reqctx.py
class RequestContextTestCase (line 21) | class RequestContextTestCase(FlaskTestCase):
method test_teardown_on_pop (line 23) | def test_teardown_on_pop(self):
method test_proper_test_request_context (line 36) | def test_proper_test_request_context(self):
method test_context_binding (line 83) | def test_context_binding(self):
method test_context_test (line 98) | def test_context_test(self):
method test_manual_context_binding (line 110) | def test_manual_context_binding(self):
method test_greenlet_context_copying (line 127) | def test_greenlet_context_copying(self):
method test_greenlet_context_copying_api (line 153) | def test_greenlet_context_copying_api(self):
function suite (line 182) | def suite():
FILE: lib/flask/testsuite/signals.py
class SignalsTestCase (line 17) | class SignalsTestCase(FlaskTestCase):
method test_template_rendered (line 19) | def test_template_rendered(self):
method test_request_signals (line 40) | def test_request_signals(self):
method test_request_exception_signal (line 80) | def test_request_exception_signal(self):
method test_appcontext_signals (line 99) | def test_appcontext_signals(self):
method test_flash_signal (line 123) | def test_flash_signal(self):
function suite (line 149) | def suite():
FILE: lib/flask/testsuite/subclassing.py
class FlaskSubclassingTestCase (line 19) | class FlaskSubclassingTestCase(FlaskTestCase):
method test_suppressed_exception_logging (line 21) | def test_suppressed_exception_logging(self):
function suite (line 43) | def suite():
FILE: lib/flask/testsuite/templating.py
class TemplatingTestCase (line 17) | class TemplatingTestCase(FlaskTestCase):
method test_context_processing (line 19) | def test_context_processing(self):
method test_original_win (line 30) | def test_original_win(self):
method test_request_less_rendering (line 38) | def test_request_less_rendering(self):
method test_standard_context (line 50) | def test_standard_context(self):
method test_escaping (line 66) | def test_escaping(self):
method test_no_escaping (line 83) | def test_no_escaping(self):
method test_macros (line 91) | def test_macros(self):
method test_template_filter (line 97) | def test_template_filter(self):
method test_add_template_filter (line 106) | def test_add_template_filter(self):
method test_template_filter_with_name (line 115) | def test_template_filter_with_name(self):
method test_add_template_filter_with_name (line 124) | def test_add_template_filter_with_name(self):
method test_template_filter_with_template (line 133) | def test_template_filter_with_template(self):
method test_add_template_filter_with_template (line 144) | def test_add_template_filter_with_template(self):
method test_template_filter_with_name_and_template (line 155) | def test_template_filter_with_name_and_template(self):
method test_add_template_filter_with_name_and_template (line 166) | def test_add_template_filter_with_name_and_template(self):
method test_template_test (line 177) | def test_template_test(self):
method test_add_template_test (line 186) | def test_add_template_test(self):
method test_template_test_with_name (line 195) | def test_template_test_with_name(self):
method test_add_template_test_with_name (line 204) | def test_add_template_test_with_name(self):
method test_template_test_with_template (line 213) | def test_template_test_with_template(self):
method test_add_template_test_with_template (line 224) | def test_add_template_test_with_template(self):
method test_template_test_with_name_and_template (line 235) | def test_template_test_with_name_and_template(self):
method test_add_template_test_with_name_and_template (line 246) | def test_add_template_test_with_name_and_template(self):
method test_add_template_global (line 257) | def test_add_template_global(self):
method test_custom_template_loader (line 269) | def test_custom_template_loader(self):
method test_iterable_loader (line 282) | def test_iterable_loader(self):
function suite (line 299) | def suite():
FILE: lib/flask/testsuite/test_apps/blueprintapp/apps/admin/__init__.py
function index (line 9) | def index():
function index2 (line 14) | def index2():
FILE: lib/flask/testsuite/test_apps/blueprintapp/apps/frontend/__init__.py
function index (line 7) | def index():
FILE: lib/flask/testsuite/test_apps/flask_newext_package/submodule.py
function test_function (line 1) | def test_function():
FILE: lib/flask/testsuite/test_apps/flaskext/oldext_package/submodule.py
function test_function (line 1) | def test_function():
FILE: lib/flask/testsuite/test_apps/moduleapp/apps/admin/__init__.py
function index (line 8) | def index():
function index2 (line 13) | def index2():
FILE: lib/flask/testsuite/test_apps/moduleapp/apps/frontend/__init__.py
function index (line 8) | def index():
FILE: lib/flask/testsuite/testing.py
class TestToolsTestCase (line 18) | class TestToolsTestCase(FlaskTestCase):
method test_environ_defaults_from_config (line 20) | def test_environ_defaults_from_config(self):
method test_environ_defaults (line 35) | def test_environ_defaults(self):
method test_redirect_keep_session (line 48) | def test_redirect_keep_session(self):
method test_session_transactions (line 80) | def test_session_transactions(self):
method test_session_transactions_no_null_sessions (line 100) | def test_session_transactions_no_null_sessions(self):
method test_session_transactions_keep_context (line 113) | def test_session_transactions_keep_context(self):
method test_session_transaction_needs_cookies (line 125) | def test_session_transaction_needs_cookies(self):
method test_test_client_context_binding (line 137) | def test_test_client_context_binding(self):
method test_reuse_client (line 167) | def test_reuse_client(self):
method test_test_client_calls_teardown_handlers (line 177) | def test_test_client_calls_teardown_handlers(self):
class SubdomainTestCase (line 200) | class SubdomainTestCase(FlaskTestCase):
method setUp (line 202) | def setUp(self):
method tearDown (line 210) | def tearDown(self):
method test_subdomain (line 214) | def test_subdomain(self):
method test_nosubdomain (line 226) | def test_nosubdomain(self):
function suite (line 238) | def suite():
FILE: lib/flask/testsuite/views.py
class ViewTestCase (line 18) | class ViewTestCase(FlaskTestCase):
method common_test (line 20) | def common_test(self, app):
method test_basic_view (line 29) | def test_basic_view(self):
method test_method_based_view (line 40) | def test_method_based_view(self):
method test_view_patching (line 53) | def test_view_patching(self):
method test_view_inheritance (line 73) | def test_view_inheritance(self):
method test_view_decorators (line 92) | def test_view_decorators(self):
method test_implicit_head (line 113) | def test_implicit_head(self):
method test_explicit_head (line 131) | def test_explicit_head(self):
method test_endpoint_override (line 148) | def test_endpoint_override(self):
function suite (line 166) | def suite():
FILE: lib/flask/views.py
class View (line 19) | class View(object):
method dispatch_request (line 65) | def dispatch_request(self):
method as_view (line 73) | def as_view(cls, name, *class_args, **class_kwargs):
class MethodViewType (line 105) | class MethodViewType(type):
method __new__ (line 107) | def __new__(cls, name, bases, d):
class MethodView (line 123) | class MethodView(with_metaclass(MethodViewType, View)):
method dispatch_request (line 142) | def dispatch_request(self, *args, **kwargs):
FILE: lib/flask/wrappers.py
function _get_data (line 23) | def _get_data(req, cache):
class Request (line 30) | class Request(RequestBase):
method max_content_length (line 65) | def max_content_length(self):
method endpoint (line 72) | def endpoint(self):
method module (line 82) | def module(self):
method blueprint (line 95) | def blueprint(self):
method json (line 101) | def json(self):
method get_json (line 110) | def get_json(self, force=False, silent=False, cache=True):
method on_json_loading_failed (line 150) | def on_json_loading_failed(self, e):
method _load_form_data (line 164) | def _load_form_data(self):
class Response (line 175) | class Response(ResponseBase):
FILE: lib/itsdangerous.py
class _CompactJSON (line 43) | class _CompactJSON(object):
method loads (line 47) | def loads(self, payload):
method dumps (line 50) | def dumps(self, obj):
function want_bytes (line 61) | def want_bytes(s, encoding='utf-8', errors='strict'):
function is_text_serializer (line 67) | def is_text_serializer(serializer):
function constant_time_compare (line 77) | def constant_time_compare(val1, val2):
class BadData (line 100) | class BadData(Exception):
method __init__ (line 108) | def __init__(self, message):
method __str__ (line 112) | def __str__(self):
method __str__ (line 117) | def __str__(self):
class BadPayload (line 121) | class BadPayload(BadData):
method __init__ (line 134) | def __init__(self, message, original_error=None):
class BadSignature (line 141) | class BadSignature(BadData):
method __init__ (line 147) | def __init__(self, message, payload=None):
class BadTimeSignature (line 157) | class BadTimeSignature(BadSignature):
method __init__ (line 162) | def __init__(self, message, payload=None, date_signed=None):
class BadHeader (line 173) | class BadHeader(BadSignature):
method __init__ (line 181) | def __init__(self, message, payload=None, header=None,
class SignatureExpired (line 194) | class SignatureExpired(BadTimeSignature):
function base64_encode (line 201) | def base64_encode(string):
function base64_decode (line 210) | def base64_decode(string):
function int_to_bytes (line 219) | def int_to_bytes(num):
function bytes_to_int (line 228) | def bytes_to_int(bytestr):
class SigningAlgorithm (line 232) | class SigningAlgorithm(object):
method get_signature (line 237) | def get_signature(self, key, value):
method verify_signature (line 241) | def verify_signature(self, key, value, sig):
class NoneAlgorithm (line 246) | class NoneAlgorithm(SigningAlgorithm):
method get_signature (line 251) | def get_signature(self, key, value):
class HMACAlgorithm (line 255) | class HMACAlgorithm(SigningAlgorithm):
method __init__ (line 262) | def __init__(self, digest_method=None):
method get_signature (line 267) | def get_signature(self, key, value):
class Signer (line 272) | class Signer(object):
method __init__ (line 307) | def __init__(self, secret_key, salt=None, sep='.', key_derivation=None,
method derive_key (line 322) | def derive_key(self):
method get_signature (line 344) | def get_signature(self, value):
method sign (line 351) | def sign(self, value):
method verify_signature (line 355) | def verify_signature(self, value, sig):
method unsign (line 364) | def unsign(self, signed_value):
method validate (line 376) | def validate(self, signed_value):
class TimestampSigner (line 386) | class TimestampSigner(Signer):
method get_timestamp (line 394) | def get_timestamp(self):
method timestamp_to_datetime (line 400) | def timestamp_to_datetime(self, ts):
method sign (line 406) | def sign(self, value):
method unsign (line 414) | def unsign(self, value, max_age=None, return_timestamp=False):
method validate (line 469) | def validate(self, signed_value, max_age=None):
class Serializer (line 479) | class Serializer(object):
method __init__ (line 512) | def __init__(self, secret_key, salt=b'itsdangerous', serializer=None,
method load_payload (line 525) | def load_payload(self, payload, serializer=None):
method dump_payload (line 545) | def dump_payload(self, obj):
method make_signer (line 552) | def make_signer(self, salt=None):
method dumps (line 560) | def dumps(self, obj, salt=None):
method dump (line 571) | def dump(self, obj, f, salt=None):
method loads (line 577) | def loads(self, s, salt=None):
method load (line 584) | def load(self, f, salt=None):
method loads_unsafe (line 588) | def loads_unsafe(self, s, salt=None):
method _loads_unsafe_impl (line 603) | def _loads_unsafe_impl(self, s, salt, load_kwargs=None,
method load_unsafe (line 619) | def load_unsafe(self, f, *args, **kwargs):
class TimedSerializer (line 627) | class TimedSerializer(Serializer):
method loads (line 634) | def loads(self, s, max_age=None, return_timestamp=False, salt=None):
method loads_unsafe (line 649) | def loads_unsafe(self, s, max_age=None, salt=None):
class JSONWebSignatureSerializer (line 655) | class JSONWebSignatureSerializer(Serializer):
method __init__ (line 672) | def __init__(self, secret_key, salt=None, serializer=None,
method load_payload (line 681) | def load_payload(self, payload, return_header=False):
method dump_payload (line 710) | def dump_payload(self, header, obj):
method make_algorithm (line 715) | def make_algorithm(self, algorithm_name):
method make_signer (line 721) | def make_signer(self, salt=None, algorithm=None):
method make_header (line 730) | def make_header(self, header_fields):
method dumps (line 735) | def dumps(self, obj, salt=None, header_fields=None):
method loads (line 744) | def loads(self, s, salt=None, return_header=False):
method loads_unsafe (line 758) | def loads_unsafe(self, s, salt=None, return_header=False):
class TimedJSONWebSignatureSerializer (line 763) | class TimedJSONWebSignatureSerializer(JSONWebSignatureSerializer):
method __init__ (line 779) | def __init__(self, secret_key, expires_in=None, **kwargs):
method make_header (line 785) | def make_header(self, header_fields):
method loads (line 793) | def loads(self, s, salt=None, return_header=False):
method get_issue_date (line 813) | def get_issue_date(self, header):
method now (line 818) | def now(self):
class URLSafeSerializerMixin (line 822) | class URLSafeSerializerMixin(object):
method load_payload (line 828) | def load_payload(self, payload):
method dump_payload (line 846) | def dump_payload(self, obj):
class URLSafeSerializer (line 859) | class URLSafeSerializer(URLSafeSerializerMixin, Serializer):
class URLSafeTimedSerializer (line 867) | class URLSafeTimedSerializer(URLSafeSerializerMixin, TimedSerializer):
FILE: lib/jinja2/_compat.py
function reraise (line 35) | def reraise(tp, value, tb=None):
function implements_iterator (line 70) | def implements_iterator(cls):
function implements_to_string (line 75) | def implements_to_string(cls):
function encode_filename (line 82) | def encode_filename(filename):
function with_metaclass (line 88) | def with_metaclass(meta, *bases):
FILE: lib/jinja2/_stringdefs.py
function combine (line 83) | def combine(*args):
function allexcept (line 90) | def allexcept(*args):
FILE: lib/jinja2/bccache.py
function marshal_dump (line 36) | def marshal_dump(code, f):
function marshal_load (line 42) | def marshal_load(f):
class Bucket (line 60) | class Bucket(object):
method __init__ (line 69) | def __init__(self, environment, key, checksum):
method reset (line 75) | def reset(self):
method load_bytecode (line 79) | def load_bytecode(self, f):
method write_bytecode (line 98) | def write_bytecode(self, f):
method bytecode_from_string (line 106) | def bytecode_from_string(self, string):
method bytecode_to_string (line 110) | def bytecode_to_string(self):
class BytecodeCache (line 117) | class BytecodeCache(object):
method load_bytecode (line 146) | def load_bytecode(self, bucket):
method dump_bytecode (line 153) | def dump_bytecode(self, bucket):
method clear (line 160) | def clear(self):
method get_cache_key (line 166) | def get_cache_key(self, name, filename=None):
method get_source_checksum (line 176) | def get_source_checksum(self, source):
method get_bucket (line 180) | def get_bucket(self, environment, name, filename, source):
method set_bucket (line 190) | def set_bucket(self, bucket):
class FileSystemBytecodeCache (line 195) | class FileSystemBytecodeCache(BytecodeCache):
method __init__ (line 213) | def __init__(self, directory=None, pattern='__jinja2_%s.cache'):
method _get_default_cache_dir (line 219) | def _get_default_cache_dir(self):
method _get_cache_filename (line 260) | def _get_cache_filename(self, bucket):
method load_bytecode (line 263) | def load_bytecode(self, bucket):
method dump_bytecode (line 271) | def dump_bytecode(self, bucket):
method clear (line 278) | def clear(self):
class MemcachedBytecodeCache (line 291) | class MemcachedBytecodeCache(BytecodeCache):
method __init__ (line 337) | def __init__(self, client, prefix='jinja2/bytecode/', timeout=None,
method load_bytecode (line 344) | def load_bytecode(self, bucket):
method dump_bytecode (line 354) | def dump_bytecode(self, bucket):
FILE: lib/jinja2/compiler.py
function unoptimize_before_dead_code (line 43) | def unoptimize_before_dead_code():
function generate (line 55) | def generate(node, environment, name, filename, stream=None,
function has_safe_repr (line 67) | def has_safe_repr(value):
function find_undeclared (line 89) | def find_undeclared(nodes, names):
class Identifiers (line 102) | class Identifiers(object):
method __init__ (line 105) | def __init__(self):
method add_special (line 124) | def add_special(self, name):
method is_declared (line 129) | def is_declared(self, name):
method copy (line 135) | def copy(self):
class Frame (line 139) | class Frame(object):
method __init__ (line 142) | def __init__(self, eval_ctx, parent=None):
method copy (line 185) | def copy(self):
method inspect (line 193) | def inspect(self, nodes):
method find_shadowed (line 202) | def find_shadowed(self, extra=()):
method inner (line 211) | def inner(self):
method soft (line 215) | def soft(self):
class VisitorExit (line 227) | class VisitorExit(RuntimeError):
class DependencyFinderVisitor (line 231) | class DependencyFinderVisitor(NodeVisitor):
method __init__ (line 234) | def __init__(self):
method visit_Filter (line 238) | def visit_Filter(self, node):
method visit_Test (line 242) | def visit_Test(self, node):
method visit_Block (line 246) | def visit_Block(self, node):
class UndeclaredNameVisitor (line 250) | class UndeclaredNameVisitor(NodeVisitor):
method __init__ (line 256) | def __init__(self, names):
method visit_Name (line 260) | def visit_Name(self, node):
method visit_Block (line 268) | def visit_Block(self, node):
class FrameIdentifierVisitor (line 272) | class FrameIdentifierVisitor(NodeVisitor):
method __init__ (line 275) | def __init__(self, identifiers):
method visit_Name (line 278) | def visit_Name(self, node):
method visit_If (line 288) | def visit_If(self, node):
method visit_Macro (line 319) | def visit_Macro(self, node):
method visit_Import (line 322) | def visit_Import(self, node):
method visit_FromImport (line 326) | def visit_FromImport(self, node):
method visit_Assign (line 334) | def visit_Assign(self, node):
method visit_For (line 339) | def visit_For(self, node):
method visit_CallBlock (line 345) | def visit_CallBlock(self, node):
method visit_FilterBlock (line 348) | def visit_FilterBlock(self, node):
method visit_AssignBlock (line 351) | def visit_AssignBlock(self, node):
method visit_Scope (line 354) | def visit_Scope(self, node):
method visit_Block (line 357) | def visit_Block(self, node):
class CompilerExit (line 361) | class CompilerExit(Exception):
class CodeGenerator (line 368) | class CodeGenerator(NodeVisitor):
method __init__ (line 370) | def __init__(self, environment, name, filename, stream=None,
method fail (line 425) | def fail(self, msg, lineno):
method temporary_identifier (line 429) | def temporary_identifier(self):
method buffer (line 434) | def buffer(self, frame):
method return_buffer_contents (line 439) | def return_buffer_contents(self, frame):
method indent (line 455) | def indent(self):
method outdent (line 459) | def outdent(self, step=1):
method start_write (line 463) | def start_write(self, frame, node=None):
method end_write (line 470) | def end_write(self, frame):
method simple_write (line 475) | def simple_write(self, s, frame, node=None):
method blockvisit (line 481) | def blockvisit(self, nodes, frame):
method write (line 496) | def write(self, x):
method writeline (line 511) | def writeline(self, x, node=None, extra=0):
method newline (line 516) | def newline(self, node=None, extra=0):
method signature (line 523) | def signature(self, node, frame, extra_kwargs=None):
method pull_locals (line 576) | def pull_locals(self, frame):
method pull_dependencies (line 581) | def pull_dependencies(self, nodes):
method unoptimize_scope (line 594) | def unoptimize_scope(self, frame):
method push_scope (line 606) | def push_scope(self, frame, extra_vars=()):
method pop_scope (line 628) | def pop_scope(self, aliases, frame):
method function_scoping (line 642) | def function_scoping(self, node, frame, children=None,
method macro_body (line 711) | def macro_body(self, node, frame, children=None):
method macro_def (line 735) | def macro_def(self, node, frame):
method position (line 752) | def position(self, node):
method visit_Template (line 761) | def visit_Template(self, node, frame=None):
method visit_Block (line 860) | def visit_Block(self, node, frame):
method visit_Extends (line 879) | def visit_Extends(self, node, frame):
method visit_Include (line 926) | def visit_Include(self, node, frame):
method visit_Import (line 969) | def visit_Import(self, node, frame):
method visit_FromImport (line 987) | def visit_FromImport(self, node, frame):
method visit_For (line 1040) | def visit_For(self, node, frame):
method visit_If (line 1166) | def visit_If(self, node, frame):
method visit_Macro (line 1180) | def visit_Macro(self, node, frame):
method visit_CallBlock (line 1191) | def visit_CallBlock(self, node, frame):
method visit_FilterBlock (line 1200) | def visit_FilterBlock(self, node, frame):
method visit_ExprStmt (line 1212) | def visit_ExprStmt(self, node, frame):
method visit_Output (line 1216) | def visit_Output(self, node, frame):
method make_assignment_frame (line 1361) | def make_assignment_frame(self, frame):
method export_assigned_vars (line 1372) | def export_assigned_vars(self, frame, assignment_frame):
method visit_Assign (line 1395) | def visit_Assign(self, node, frame):
method visit_AssignBlock (line 1403) | def visit_AssignBlock(self, node, frame):
method visit_Name (line 1420) | def visit_Name(self, node, frame):
method visit_Const (line 1426) | def visit_Const(self, node, frame):
method visit_TemplateData (line 1433) | def visit_TemplateData(self, node, frame):
method visit_Tuple (line 1440) | def visit_Tuple(self, node, frame):
method visit_List (line 1449) | def visit_List(self, node, frame):
method visit_Dict (line 1457) | def visit_Dict(self, node, frame):
method binop (line 1467) | def binop(operator, interceptable=True):
method uaop (line 1483) | def uaop(operator, interceptable=True):
method visit_Concat (line 1509) | def visit_Concat(self, node, frame):
method visit_Compare (line 1523) | def visit_Compare(self, node, frame):
method visit_Operand (line 1528) | def visit_Operand(self, node, frame):
method visit_Getattr (line 1532) | def visit_Getattr(self, node, frame):
method visit_Getitem (line 1537) | def visit_Getitem(self, node, frame):
method visit_Slice (line 1551) | def visit_Slice(self, node, frame):
method visit_Filter (line 1561) | def visit_Filter(self, node, frame):
method visit_Test (line 1588) | def visit_Test(self, node, frame):
method visit_CondExpr (line 1596) | def visit_CondExpr(self, node, frame):
method visit_Call (line 1612) | def visit_Call(self, node, frame, forward_caller=False):
method visit_Keyword (line 1622) | def visit_Keyword(self, node, frame):
method visit_MarkSafe (line 1628) | def visit_MarkSafe(self, node, frame):
method visit_MarkSafeIfAutoescape (line 1633) | def visit_MarkSafeIfAutoescape(self, node, frame):
method visit_EnvironmentAttribute (line 1638) | def visit_EnvironmentAttribute(self, node, frame):
method visit_ExtensionAttribute (line 1641) | def visit_ExtensionAttribute(self, node, frame):
method visit_ImportedName (line 1644) | def visit_ImportedName(self, node, frame):
method visit_InternalName (line 1647) | def visit_InternalName(self, node, frame):
method visit_ContextReference (line 1650) | def visit_ContextReference(self, node, frame):
method visit_Continue (line 1653) | def visit_Continue(self, node, frame):
method visit_Break (line 1656) | def visit_Break(self, node, frame):
method visit_Scope (line 1659) | def visit_Scope(self, node, frame):
method visit_EvalContextModifier (line 1667) | def visit_EvalContextModifier(self, node, frame):
method visit_ScopedEvalContextModifier (line 1678) | def visit_ScopedEvalContextModifier(self, node, frame):
FILE: lib/jinja2/debug.py
class TracebackFrameProxy (line 36) | class TracebackFrameProxy(object):
method __init__ (line 39) | def __init__(self, tb):
method tb_next (line 44) | def tb_next(self):
method set_next (line 47) | def set_next(self, next):
method is_jinja_frame (line 59) | def is_jinja_frame(self):
method __getattr__ (line 62) | def __getattr__(self, name):
function make_frame_proxy (line 66) | def make_frame_proxy(frame):
class ProcessedTraceback (line 80) | class ProcessedTraceback(object):
method __init__ (line 83) | def __init__(self, exc_type, exc_value, frames):
method render_as_text (line 97) | def render_as_text(self, limit=None):
method render_as_html (line 103) | def render_as_html(self, full=False):
method is_template_syntax_error (line 112) | def is_template_syntax_error(self):
method exc_info (line 117) | def exc_info(self):
method standard_exc_info (line 122) | def standard_exc_info(self):
function make_traceback (line 132) | def make_traceback(exc_info, source_hint=None):
function translate_syntax_error (line 143) | def translate_syntax_error(error, source=None):
function translate_exception (line 154) | def translate_exception(exc_info, initial_skip=0):
function fake_exc_info (line 198) | def fake_exc_info(exc_info, filename, lineno):
function _init_ugly_crap (line 276) | def _init_ugly_crap():
FILE: lib/jinja2/environment.py
function get_spontaneous_environment (line 44) | def get_spontaneous_environment(*args):
function create_cache (line 60) | def create_cache(size):
function copy_cache (line 69) | def copy_cache(cache):
function load_extensions (line 78) | def load_extensions(environment, extensions):
function _environment_sanity_check (line 90) | def _environment_sanity_check(environment):
class Environment (line 103) | class Environment(object):
method __init__ (line 249) | def __init__(self,
method add_extension (line 318) | def add_extension(self, extension):
method extend (line 325) | def extend(self, **attributes):
method overlay (line 334) | def overlay(self, block_start_string=missing, block_end_string=missing,
method iter_extensions (line 381) | def iter_extensions(self):
method getitem (line 386) | def getitem(self, obj, argument):
method getattr (line 403) | def getattr(self, obj, attribute):
method call_filter (line 416) | def call_filter(self, name, value, args=None, kwargs=None,
method call_test (line 442) | def call_test(self, name, value, args=None, kwargs=None):
method parse (line 453) | def parse(self, source, name=None, filename=None):
method _parse (line 468) | def _parse(self, source, name, filename):
method lex (line 472) | def lex(self, source, name=None, filename=None):
method preprocess (line 489) | def preprocess(self, source, name=None, filename=None):
method _tokenize (line 497) | def _tokenize(self, source, name, filename=None, state=None):
method _generate (line 509) | def _generate(self, source, name, filename, defer_init=False):
method _compile (line 517) | def _compile(self, source, filename):
method compile (line 526) | def compile(self, source, name=None, filename=None, raw=False,
method compile_expression (line 567) | def compile_expression(self, source, undefined_to_none=True):
method compile_templates (line 612) | def compile_templates(self, target, extensions=None, filter_func=None,
method list_templates (line 707) | def list_templates(self, extensions=None, filter_func=None):
method handle_exception (line 734) | def handle_exception(self, exc_info=None, rendered=False, source_hint=...
method join_path (line 756) | def join_path(self, template, parent):
method _load_template (line 769) | def _load_template(self, name, globals):
method get_template (line 792) | def get_template(self, name, parent=None, globals=None):
method select_template (line 815) | def select_template(self, names, parent=None, globals=None):
method get_or_select_template (line 842) | def get_or_select_template(self, template_name_or_list,
method from_string (line 856) | def from_string(self, source, globals=None, template_class=None):
method make_globals (line 864) | def make_globals(self, d):
class Template (line 871) | class Template(object):
method __new__ (line 901) | def __new__(cls, source,
method from_code (line 929) | def from_code(cls, environment, code, globals, uptodate=None):
method from_module_dict (line 943) | def from_module_dict(cls, environment, module_dict, globals):
method _from_namespace (line 952) | def _from_namespace(cls, environment, namespace, globals):
method render (line 974) | def render(self, *args, **kwargs):
method stream (line 991) | def stream(self, *args, **kwargs):
method generate (line 997) | def generate(self, *args, **kwargs):
method new_context (line 1015) | def new_context(self, vars=None, shared=False, locals=None):
method make_module (line 1026) | def make_module(self, vars=None, shared=False, locals=None):
method module (line 1036) | def module(self):
method get_corresponding_lineno (line 1052) | def get_corresponding_lineno(self, lineno):
method is_up_to_date (line 1062) | def is_up_to_date(self):
method debug_info (line 1069) | def debug_info(self):
method __repr__ (line 1074) | def __repr__(self):
class TemplateModule (line 1083) | class TemplateModule(object):
method __init__ (line 1089) | def __init__(self, template, context):
method __html__ (line 1094) | def __html__(self):
method __str__ (line 1097) | def __str__(self):
method __repr__ (line 1100) | def __repr__(self):
class TemplateExpression (line 1108) | class TemplateExpression(object):
method __init__ (line 1114) | def __init__(self, template, undefined_to_none):
method __call__ (line 1118) | def __call__(self, *args, **kwargs):
class TemplateStream (line 1128) | class TemplateStream(object):
method __init__ (line 1139) | def __init__(self, gen):
method dump (line 1143) | def dump(self, fp, encoding=None, errors='strict'):
method disable_buffering (line 1172) | def disable_buffering(self):
method enable_buffering (line 1177) | def enable_buffering(self, size=5):
method __iter__ (line 1204) | def __iter__(self):
method __next__ (line 1207) | def __next__(self):
FILE: lib/jinja2/exceptions.py
class TemplateError (line 14) | class TemplateError(Exception):
method __init__ (line 18) | def __init__(self, message=None):
method message (line 24) | def message(self):
method __unicode__ (line 30) | def __unicode__(self):
method __init__ (line 33) | def __init__(self, message=None):
method message (line 37) | def message(self):
class TemplateNotFound (line 45) | class TemplateNotFound(IOError, LookupError, TemplateError):
method __init__ (line 52) | def __init__(self, name, message=None):
method __str__ (line 60) | def __str__(self):
class TemplatesNotFound (line 64) | class TemplatesNotFound(TemplateNotFound):
method __init__ (line 72) | def __init__(self, names=(), message=None):
class TemplateSyntaxError (line 81) | class TemplateSyntaxError(TemplateError):
method __init__ (line 84) | def __init__(self, message, lineno, name=None, filename=None):
method __str__ (line 95) | def __str__(self):
class TemplateAssertionError (line 119) | class TemplateAssertionError(TemplateSyntaxError):
class TemplateRuntimeError (line 127) | class TemplateRuntimeError(TemplateError):
class UndefinedError (line 133) | class UndefinedError(TemplateRuntimeError):
class SecurityError (line 137) | class SecurityError(TemplateRuntimeError):
class FilterArgumentError (line 143) | class FilterArgumentError(TemplateRuntimeError):
FILE: lib/jinja2/ext.py
class ExtensionRegistry (line 32) | class ExtensionRegistry(type):
method __new__ (line 35) | def __new__(cls, name, bases, d):
class Extension (line 41) | class Extension(with_metaclass(ExtensionRegistry, object)):
method __init__ (line 70) | def __init__(self, environment):
method bind (line 73) | def bind(self, environment):
method preprocess (line 80) | def preprocess(self, source, name, filename=None):
method filter_stream (line 87) | def filter_stream(self, stream):
method parse (line 99) | def parse(self, parser):
method attr (line 107) | def attr(self, name, lineno=None):
method call_method (line 117) | def call_method(self, name, args=None, kwargs=None, dyn_args=None,
function _gettext_alias (line 131) | def _gettext_alias(__context, *args, **kwargs):
function _make_new_gettext (line 135) | def _make_new_gettext(func):
function _make_new_ngettext (line 145) | def _make_new_ngettext(func):
class InternationalizationExtension (line 156) | class InternationalizationExtension(Extension):
method __init__ (line 167) | def __init__(self, environment):
method _install (line 179) | def _install(self, translations, newstyle=None):
method _install_null (line 188) | def _install_null(self, newstyle=None):
method _install_callables (line 195) | def _install_callables(self, gettext, ngettext, newstyle=None):
method _uninstall (line 206) | def _uninstall(self, translations):
method _extract (line 210) | def _extract(self, source, gettext_functions=GETTEXT_FUNCTIONS):
method parse (line 215) | def parse(self, parser):
method _parse_block (line 309) | def _parse_block(self, parser, allow_pluralize):
method _make_node (line 341) | def _make_node(self, singular, plural, variables, plural_expr,
class ExprStmtExtension (line 390) | class ExprStmtExtension(Extension):
method parse (line 396) | def parse(self, parser):
class LoopControlExtension (line 402) | class LoopControlExtension(Extension):
method parse (line 406) | def parse(self, parser):
class WithExtension (line 413) | class WithExtension(Extension):
method parse (line 417) | def parse(self, parser):
class AutoEscapeExtension (line 434) | class AutoEscapeExtension(Extension):
method parse (line 438) | def parse(self, parser):
function extract_from_ast (line 448) | def extract_from_ast(node, gettext_functions=GETTEXT_FUNCTIONS,
class _CommentFinder (line 516) | class _CommentFinder(object):
method __init__ (line 523) | def __init__(self, tokens, comment_tags):
method find_backwards (line 529) | def find_backwards(self, offset):
method find_comments (line 544) | def find_comments(self, lineno):
function babel_extract (line 553) | def babel_extract(fileobj, keywords, comment_tags, options):
FILE: lib/jinja2/filters.py
function contextfilter (line 27) | def contextfilter(f):
function evalcontextfilter (line 35) | def evalcontextfilter(f):
function environmentfilter (line 46) | def environmentfilter(f):
function make_attrgetter (line 54) | def make_attrgetter(environment, attribute):
function do_forceescape (line 73) | def do_forceescape(value):
function do_urlencode (line 80) | def do_urlencode(value):
function do_replace (line 102) | def do_replace(eval_ctx, s, old, new, count=None):
function do_upper (line 129) | def do_upper(s):
function do_lower (line 134) | def do_lower(s):
function do_xmlattr (line 140) | def do_xmlattr(_eval_ctx, d, autospace=True):
function do_capitalize (line 175) | def do_capitalize(s):
function do_title (line 182) | def do_title(s):
function do_dictsort (line 194) | def do_dictsort(value, case_sensitive=False, by='key'):
function do_sort (line 227) | def do_sort(environment, value, reverse=False, case_sensitive=False,
function do_default (line 268) | def do_default(value, default_value=u'', boolean=False):
function do_join (line 291) | def do_join(eval_ctx, value, d=u'', attribute=None):
function do_center (line 340) | def do_center(value, width=80):
function do_first (line 346) | def do_first(environment, seq):
function do_last (line 355) | def do_last(environment, seq):
function do_random (line 364) | def do_random(environment, seq):
function do_filesizeformat (line 372) | def do_filesizeformat(value, binary=False):
function do_pprint (line 402) | def do_pprint(value, verbose=False):
function do_urlize (line 412) | def do_urlize(eval_ctx, value, trim_url_limit=None, nofollow=False,
function do_indent (line 441) | def do_indent(s, width=4, indentfirst=False):
function do_truncate (line 459) | def do_truncate(s, length=255, killwords=False, end='...'):
function do_wordwrap (line 488) | def do_wordwrap(environment, s, width=79, break_long_words=True,
function do_wordcount (line 509) | def do_wordcount(s):
function do_int (line 514) | def do_int(value, default=0, base=10):
function do_float (line 532) | def do_float(value, default=0.0):
function do_format (line 543) | def do_format(value, *args, **kwargs):
function do_trim (line 558) | def do_trim(value):
function do_striptags (line 563) | def do_striptags(value):
function do_slice (line 571) | def do_slice(value, slices, fill_with=None):
function do_batch (line 607) | def do_batch(value, linecount, fill_with=None):
function do_round (line 638) | def do_round(value, precision=0, method='common'):
function do_groupby (line 673) | def do_groupby(environment, value, attribute):
class _GroupTuple (line 715) | class _GroupTuple(tuple):
method __new__ (line 720) | def __new__(cls, xxx_todo_changeme):
function do_sum (line 726) | def do_sum(environment, iterable, attribute=None, start=0):
function do_list (line 746) | def do_list(value):
function do_mark_safe (line 753) | def do_mark_safe(value):
function do_mark_unsafe (line 760) | def do_mark_unsafe(value):
function do_reverse (line 765) | def do_reverse(value):
function do_attr (line 783) | def do_attr(environment, obj, name):
function do_map (line 808) | def do_map(*args, **kwargs):
function do_select (line 854) | def do_select(*args, **kwargs):
function do_reject (line 871) | def do_reject(*args, **kwargs):
function do_selectattr (line 887) | def do_selectattr(*args, **kwargs):
function do_rejectattr (line 904) | def do_rejectattr(*args, **kwargs):
function _select_or_reject (line 918) | def _select_or_reject(args, kwargs, modfunc, lookup_attr):
FILE: lib/jinja2/lexer.py
function _describe_token_type (line 145) | def _describe_token_type(token_type):
function describe_token (line 164) | def describe_token(token):
function describe_token_expr (line 171) | def describe_token_expr(expr):
function count_newlines (line 182) | def count_newlines(value):
function compile_rules (line 189) | def compile_rules(environment):
class Failure (line 212) | class Failure(object):
method __init__ (line 217) | def __init__(self, message, cls=TemplateSyntaxError):
method __call__ (line 221) | def __call__(self, lineno, filename):
class Token (line 225) | class Token(tuple):
method __new__ (line 230) | def __new__(cls, lineno, type, value):
method __str__ (line 233) | def __str__(self):
method test (line 240) | def test(self, expr):
method test_any (line 253) | def test_any(self, *iterable):
method __repr__ (line 260) | def __repr__(self):
class TokenStreamIterator (line 269) | class TokenStreamIterator(object):
method __init__ (line 274) | def __init__(self, stream):
method __iter__ (line 277) | def __iter__(self):
method __next__ (line 280) | def __next__(self):
class TokenStream (line 290) | class TokenStream(object):
method __init__ (line 296) | def __init__(self, generator, name, filename):
method __iter__ (line 305) | def __iter__(self):
method __bool__ (line 308) | def __bool__(self):
method push (line 314) | def push(self, token):
method look (line 318) | def look(self):
method skip (line 326) | def skip(self, n=1):
method next_if (line 331) | def next_if(self, expr):
method skip_if (line 338) | def skip_if(self, expr):
method __next__ (line 342) | def __next__(self):
method close (line 354) | def close(self):
method expect (line 360) | def expect(self, expr):
function get_lexer (line 381) | def get_lexer(environment):
class Lexer (line 402) | class Lexer(object):
method __init__ (line 410) | def __init__(self, environment):
method _normalize_newlines (line 538) | def _normalize_newlines(self, value):
method tokenize (line 542) | def tokenize(self, source, name=None, filename=None, state=None):
method wrap (line 548) | def wrap(self, stream, name=None, filename=None):
method tokeniter (line 594) | def tokeniter(self, source, name, filename=None, state=None):
FILE: lib/jinja2/loaders.py
function split_template_path (line 22) | def split_template_path(template):
class BaseLoader (line 37) | class BaseLoader(object):
method get_source (line 70) | def get_source(self, environment, template):
method list_templates (line 93) | def list_templates(self):
method load (line 100) | def load(self, environment, name, globals=None):
class FileSystemLoader (line 138) | class FileSystemLoader(BaseLoader):
method __init__ (line 160) | def __init__(self, searchpath, encoding='utf-8', followlinks=False):
method get_source (line 167) | def get_source(self, environment, template):
method list_templates (line 189) | def list_templates(self):
class PackageLoader (line 205) | class PackageLoader(BaseLoader):
method __init__ (line 220) | def __init__(self, package_name, package_path='templates',
method get_source (line 231) | def get_source(self, environment, template):
method list_templates (line 250) | def list_templates(self):
class DictLoader (line 270) | class DictLoader(BaseLoader):
method __init__ (line 279) | def __init__(self, mapping):
method get_source (line 282) | def get_source(self, environment, template):
method list_templates (line 288) | def list_templates(self):
class FunctionLoader (line 292) | class FunctionLoader(BaseLoader):
method __init__ (line 310) | def __init__(self, load_func):
method get_source (line 313) | def get_source(self, environment, template):
class PrefixLoader (line 322) | class PrefixLoader(BaseLoader):
method __init__ (line 337) | def __init__(self, mapping, delimiter='/'):
method get_loader (line 341) | def get_loader(self, template):
method get_source (line 349) | def get_source(self, environment, template):
method load (line 359) | def load(self, environment, name, globals=None):
method list_templates (line 368) | def list_templates(self):
class ChoiceLoader (line 376) | class ChoiceLoader(BaseLoader):
method __init__ (line 390) | def __init__(self, loaders):
method get_source (line 393) | def get_source(self, environment, template):
method load (line 402) | def load(self, environment, name, globals=None):
method list_templates (line 410) | def list_templates(self):
class _TemplateModule (line 417) | class _TemplateModule(ModuleType):
class ModuleLoader (line 421) | class ModuleLoader(BaseLoader):
method __init__ (line 436) | def __init__(self, path):
method get_template_key (line 458) | def get_template_key(name):
method get_module_filename (line 462) | def get_module_filename(name):
method load (line 466) | def load(self, environment, name, globals=None):
FILE: lib/jinja2/meta.py
class TrackingCodeGenerator (line 17) | class TrackingCodeGenerator(CodeGenerator):
method __init__ (line 20) | def __init__(self, environment):
method write (line 25) | def write(self, x):
method pull_locals (line 28) | def pull_locals(self, frame):
function find_undeclared_variables (line 33) | def find_undeclared_variables(ast):
function find_referenced_templates (line 57) | def find_referenced_templates(ast):
FILE: lib/jinja2/nodes.py
class Impossible (line 55) | class Impossible(Exception):
class NodeType (line 59) | class NodeType(type):
method __new__ (line 64) | def __new__(cls, name, bases, d):
class EvalContext (line 76) | class EvalContext(object):
method __init__ (line 81) | def __init__(self, environment, template_name=None):
method save (line 89) | def save(self):
method revert (line 92) | def revert(self, old):
function get_eval_context (line 97) | def get_eval_context(node, ctx):
class Node (line 107) | class Node(with_metaclass(NodeType, object)):
method __init__ (line 127) | def __init__(self, *fields, **attributes):
method iter_fields (line 148) | def iter_fields(self, exclude=None, only=None):
method iter_child_nodes (line 164) | def iter_child_nodes(self, exclude=None, only=None):
method find (line 177) | def find(self, node_type):
method find_all (line 184) | def find_all(self, node_type):
method set_ctx (line 194) | def set_ctx(self, ctx):
method set_lineno (line 208) | def set_lineno(self, lineno, override=False):
method set_environment (line 219) | def set_environment(self, environment):
method __eq__ (line 228) | def __eq__(self, other):
method __ne__ (line 232) | def __ne__(self, other):
method __repr__ (line 238) | def __repr__(self):
class Stmt (line 246) | class Stmt(Node):
class Helper (line 251) | class Helper(Node):
class Template (line 256) | class Template(Node):
class Output (line 263) | class Output(Stmt):
class Extends (line 270) | class Extends(Stmt):
class For (line 275) | class For(Stmt):
class If (line 286) | class If(Stmt):
class Macro (line 291) | class Macro(Stmt):
class CallBlock (line 299) | class CallBlock(Stmt):
class FilterBlock (line 306) | class FilterBlock(Stmt):
class Block (line 311) | class Block(Stmt):
class Include (line 316) | class Include(Stmt):
class Import (line 321) | class Import(Stmt):
class FromImport (line 326) | class FromImport(Stmt):
class ExprStmt (line 340) | class ExprStmt(Stmt):
class Assign (line 345) | class Assign(Stmt):
class AssignBlock (line 350) | class AssignBlock(Stmt):
class Expr (line 355) | class Expr(Node):
method as_const (line 359) | def as_const(self, eval_ctx=None):
method can_assign (line 372) | def can_assign(self):
class BinExpr (line 377) | class BinExpr(Expr):
method as_const (line 383) | def as_const(self, eval_ctx=None):
class UnaryExpr (line 396) | class UnaryExpr(Expr):
method as_const (line 402) | def as_const(self, eval_ctx=None):
class Name (line 415) | class Name(Expr):
method can_assign (line 425) | def can_assign(self):
class Literal (line 430) | class Literal(Expr):
class Const (line 435) | class Const(Literal):
method as_const (line 443) | def as_const(self, eval_ctx=None):
method from_untrusted (line 447) | def from_untrusted(cls, value, lineno=None, environment=None):
class TemplateData (line 458) | class TemplateData(Literal):
method as_const (line 462) | def as_const(self, eval_ctx=None):
class Tuple (line 471) | class Tuple(Literal):
method as_const (line 478) | def as_const(self, eval_ctx=None):
method can_assign (line 482) | def can_assign(self):
class List (line 489) | class List(Literal):
method as_const (line 493) | def as_const(self, eval_ctx=None):
class Dict (line 498) | class Dict(Literal):
method as_const (line 504) | def as_const(self, eval_ctx=None):
class Pair (line 509) | class Pair(Helper):
method as_const (line 513) | def as_const(self, eval_ctx=None):
class Keyword (line 518) | class Keyword(Helper):
method as_const (line 522) | def as_const(self, eval_ctx=None):
class CondExpr (line 527) | class CondExpr(Expr):
method as_const (line 533) | def as_const(self, eval_ctx=None):
class Filter (line 545) | class Filter(Expr):
method as_const (line 554) | def as_const(self, eval_ctx=None):
class Test (line 589) | class Test(Expr):
class Call (line 596) | class Call(Expr):
method as_const (line 605) | def as_const(self, eval_ctx=None):
class Getitem (line 638) | class Getitem(Expr):
method as_const (line 642) | def as_const(self, eval_ctx=None):
method can_assign (line 652) | def can_assign(self):
class Getattr (line 656) | class Getattr(Expr):
method as_const (line 662) | def as_const(self, eval_ctx=None):
method can_assign (line 672) | def can_assign(self):
class Slice (line 676) | class Slice(Expr):
method as_const (line 682) | def as_const(self, eval_ctx=None):
class Concat (line 691) | class Concat(Expr):
method as_const (line 697) | def as_const(self, eval_ctx=None):
class Compare (line 702) | class Compare(Expr):
method as_const (line 708) | def as_const(self, eval_ctx=None):
class Operand (line 721) | class Operand(Helper):
class Mul (line 731) | class Mul(BinExpr):
class Div (line 736) | class Div(BinExpr):
class FloorDiv (line 741) | class FloorDiv(BinExpr):
class Add (line 748) | class Add(BinExpr):
class Sub (line 753) | class Sub(BinExpr):
class Mod (line 758) | class Mod(BinExpr):
class Pow (line 763) | class Pow(BinExpr):
class And (line 768) | class And(BinExpr):
method as_const (line 772) | def as_const(self, eval_ctx=None):
class Or (line 777) | class Or(BinExpr):
method as_const (line 781) | def as_const(self, eval_ctx=None):
class Not (line 786) | class Not(UnaryExpr):
class Neg (line 791) | class Neg(UnaryExpr):
class Pos (line 796) | class Pos(UnaryExpr):
class EnvironmentAttribute (line 804) | class EnvironmentAttribute(Expr):
class ExtensionAttribute (line 811) | class ExtensionAttribute(Expr):
class ImportedName (line 821) | class ImportedName(Expr):
class InternalName (line 830) | class InternalName(Expr):
method __init__ (line 839) | def __init__(self):
class MarkSafe (line 844) | class MarkSafe(Expr):
method as_const (line 848) | def as_const(self, eval_ctx=None):
class MarkSafeIfAutoescape (line 853) | class MarkSafeIfAutoescape(Expr):
method as_const (line 861) | def as_const(self, eval_ctx=None):
class ContextReference (line 871) | class ContextReference(Expr):
class Continue (line 884) | class Continue(Stmt):
class Break (line 888) | class Break(Stmt):
class Scope (line 892) | class Scope(Stmt):
class EvalContextModifier (line 897) | class EvalContextModifier(Stmt):
class ScopedEvalContextModifier (line 908) | class ScopedEvalContextModifier(EvalContextModifier):
function _failing_new (line 917) | def _failing_new(*args, **kwargs):
FILE: lib/jinja2/optimizer.py
function optimize (line 23) | def optimize(node, environment):
class Optimizer (line 30) | class Optimizer(NodeTransformer):
method __init__ (line 32) | def __init__(self, environment):
method visit_If (line 35) | def visit_If(self, node):
method fold (line 54) | def fold(self, node):
FILE: lib/jinja2/parser.py
class Parser (line 23) | class Parser(object):
method __init__ (line 28) | def __init__(self, environment, source, name=None, filename=None,
method fail (line 43) | def fail(self, msg, lineno=None, exc=TemplateSyntaxError):
method _fail_ut_eof (line 52) | def _fail_ut_eof(self, name, end_token_stack, lineno):
method fail_unknown_tag (line 83) | def fail_unknown_tag(self, name, lineno=None):
method fail_eof (line 90) | def fail_eof(self, end_tokens=None, lineno=None):
method is_tuple_end (line 97) | def is_tuple_end(self, extra_end_rules=None):
method free_identifier (line 105) | def free_identifier(self, lineno=None):
method parse_statement (line 112) | def parse_statement(self):
method parse_statements (line 140) | def parse_statements(self, end_tokens, drop_needle=False):
method parse_set (line 167) | def parse_set(self):
method parse_for (line 178) | def parse_for(self):
method parse_if (line 197) | def parse_if(self):
method parse_block (line 218) | def parse_block(self):
method parse_extends (line 235) | def parse_extends(self):
method parse_import_context (line 240) | def parse_import_context(self, node, default):
method parse_include (line 249) | def parse_include(self):
method parse_import (line 260) | def parse_import(self):
method parse_from (line 267) | def parse_from(self):
method parse_signature (line 306) | def parse_signature(self, node):
method parse_call_block (line 322) | def parse_call_block(self):
method parse_filter_block (line 336) | def parse_filter_block(self):
method parse_macro (line 343) | def parse_macro(self):
method parse_print (line 351) | def parse_print(self):
method parse_assign_target (line 360) | def parse_assign_target(self, with_tuple=True, name_only=False,
method parse_expression (line 384) | def parse_expression(self, with_condexpr=True):
method parse_condexpr (line 393) | def parse_condexpr(self):
method parse_or (line 406) | def parse_or(self):
method parse_and (line 415) | def parse_and(self):
method parse_not (line 424) | def parse_not(self):
method parse_compare (line 430) | def parse_compare(self):
method parse_add (line 452) | def parse_add(self):
method parse_sub (line 462) | def parse_sub(self):
method parse_concat (line 472) | def parse_concat(self):
method parse_mul (line 482) | def parse_mul(self):
method parse_div (line 492) | def parse_div(self):
method parse_floordiv (line 502) | def parse_floordiv(self):
method parse_mod (line 512) | def parse_mod(self):
method parse_pow (line 522) | def parse_pow(self):
method parse_unary (line 532) | def parse_unary(self, with_filter=True):
method parse_primary (line 548) | def parse_primary(self):
method parse_tuple (line 582) | def parse_tuple(self, simplified=False, with_condexpr=True,
method parse_list (line 637) | def parse_list(self):
method parse_dict (line 649) | def parse_dict(self):
method parse_postfix (line 664) | def parse_postfix(self, node):
method parse_filter_expr (line 677) | def parse_filter_expr(self, node):
method parse_subscript (line 692) | def parse_subscript(self, node):
method parse_subscribed (line 718) | def parse_subscribed(self):
method parse_call (line 749) | def parse_call(self, node):
method parse_filter (line 796) | def parse_filter(self, node, start_inline=False):
method parse_test (line 816) | def parse_test(self, node):
method subparse (line 847) | def subparse(self, end_tokens=None):
method parse (line 895) | def parse(self):
FILE: lib/jinja2/runtime.py
function markup_join (line 39) | def markup_join(seq):
function unicode_join (line 50) | def unicode_join(seq):
function new_context (line 55) | def new_context(environment, template_name, blocks, vars=None,
class TemplateReference (line 76) | class TemplateReference(object):
method __init__ (line 79) | def __init__(self, context):
method __getitem__ (line 82) | def __getitem__(self, name):
method __repr__ (line 86) | def __repr__(self):
class Context (line 93) | class Context(object):
method __init__ (line 115) | def __init__(self, environment, parent, name, blocks):
method super (line 128) | def super(self, name, current):
method get (line 140) | def get(self, key, default=None):
method resolve (line 149) | def resolve(self, key):
method get_exported (line 159) | def get_exported(self):
method get_all (line 163) | def get_all(self):
method call (line 170) | def call(__self, __obj, *args, **kwargs):
method derived (line 202) | def derived(self, locals=None):
method _all (line 211) | def _all(meth):
method __contains__ (line 228) | def __contains__(self, name):
method __getitem__ (line 231) | def __getitem__(self, key):
method __repr__ (line 240) | def __repr__(self):
class BlockReference (line 256) | class BlockReference(object):
method __init__ (line 259) | def __init__(self, name, context, stack, depth):
method super (line 266) | def super(self):
method __call__ (line 276) | def __call__(self):
class LoopContext (line 283) | class LoopContext(object):
method __init__ (line 286) | def __init__(self, iterable, recurse=None, depth0=0):
method cycle (line 302) | def cycle(self, *args):
method __len__ (line 315) | def __len__(self):
method __iter__ (line 318) | def __iter__(self):
method _safe_next (line 321) | def _safe_next(self):
method loop (line 328) | def loop(self, iterable):
method length (line 340) | def length(self):
method __repr__ (line 352) | def __repr__(self):
class LoopContextIterator (line 361) | class LoopContextIterator(object):
method __init__ (line 365) | def __init__(self, context):
method __iter__ (line 368) | def __iter__(self):
method __next__ (line 371) | def __next__(self):
class Macro (line 381) | class Macro(object):
method __init__ (line 384) | def __init__(self, environment, func, name, arguments, defaults,
method __call__ (line 397) | def __call__(self, *args, **kwargs):
method __repr__ (line 438) | def __repr__(self):
class Undefined (line 446) | class Undefined(object):
method __init__ (line 463) | def __init__(self, hint=None, obj=missing, name=None, exc=UndefinedErr...
method _fail_with_undefined_error (line 470) | def _fail_with_undefined_error(self, *args, **kwargs):
method __getattr__ (line 492) | def __getattr__(self, name):
method __eq__ (line 504) | def __eq__(self, other):
method __ne__ (line 507) | def __ne__(self, other):
method __hash__ (line 510) | def __hash__(self):
method __str__ (line 513) | def __str__(self):
method __len__ (line 516) | def __len__(self):
method __iter__ (line 519) | def __iter__(self):
method __nonzero__ (line 523) | def __nonzero__(self):
method __repr__ (line 527) | def __repr__(self):
function make_logging_undefined (line 531) | def make_logging_undefined(logger=None, base=None):
class DebugUndefined (line 613) | class DebugUndefined(Undefined):
method __str__ (line 628) | def __str__(self):
class StrictUndefined (line 640) | class StrictUndefined(Undefined):
FILE: lib/jinja2/sandbox.py
function safe_range (line 97) | def safe_range(*args):
function unsafe (line 108) | def unsafe(f):
function is_internal_attribute (line 121) | def is_internal_attribute(obj, attr):
function modifies_known_mutable (line 151) | def modifies_known_mutable(obj, attr):
class SandboxedEnvironment (line 179) | class SandboxedEnvironment(Environment):
method intercept_unop (line 243) | def intercept_unop(self, operator):
method __init__ (line 261) | def __init__(self, *args, **kwargs):
method is_safe_attribute (line 267) | def is_safe_attribute(self, obj, attr, value):
method is_safe_callable (line 276) | def is_safe_callable(self, obj):
method call_binop (line 285) | def call_binop(self, context, operator, left, right):
method call_unop (line 294) | def call_unop(self, context, operator, arg):
method getitem (line 303) | def getitem(self, obj, argument):
method getattr (line 324) | def getattr(self, obj, attribute):
method unsafe_undefined (line 341) | def unsafe_undefined(self, obj, attribute):
method call (line 349) | def call(__self, __context, __obj, *args, **kwargs):
class ImmutableSandboxedEnvironment (line 358) | class ImmutableSandboxedEnvironment(SandboxedEnvironment):
method is_safe_attribute (line 364) | def is_safe_attribute(self, obj, attr, value):
FILE: lib/jinja2/tests.py
function test_odd (line 24) | def test_odd(value):
function test_even (line 29) | def test_even(value):
function test_divisibleby (line 34) | def test_divisibleby(value, num):
function test_defined (line 39) | def test_defined(value):
function test_undefined (line 56) | def test_undefined(value):
function test_none (line 61) | def test_none(value):
function test_lower (line 66) | def test_lower(value):
function test_upper (line 71) | def test_upper(value):
function test_string (line 76) | def test_string(value):
function test_mapping (line 81) | def test_mapping(value):
function test_number (line 89) | def test_number(value):
function test_sequence (line 94) | def test_sequence(value):
function test_equalto (line 106) | def test_equalto(value, other):
function test_sameas (line 128) | def test_sameas(value, other):
function test_iterable (line 141) | def test_iterable(value):
function test_escaped (line 150) | def test_escaped(value):
FILE: lib/jinja2/utils.py
function contextfunction (line 41) | def contextfunction(f):
function evalcontextfunction (line 57) | def evalcontextfunction(f):
function environmentfunction (line 70) | def environmentfunction(f):
function internalcode (line 80) | def internalcode(f):
function is_undefined (line 86) | def is_undefined(obj):
function consume (line 102) | def consume(iterable):
function clear_caches (line 108) | def clear_caches():
function import_string (line 120) | def import_string(import_name, silent=False):
function open_if_exists (line 146) | def open_if_exists(filename, mode='rb'):
function object_type_repr (line 157) | def object_type_repr(obj):
function pformat (line 174) | def pformat(obj, verbose=False):
function urlize (line 186) | def urlize(text, trim_url_limit=None, nofollow=False, target=None):
function generate_lorem_ipsum (line 237) | def generate_lorem_ipsum(n=5, html=True, min=20, max=100):
function unicode_urlencode (line 286) | def unicode_urlencode(obj, charset='utf-8', for_qs=False):
class LRUCache (line 305) | class LRUCache(object):
method __init__ (line 312) | def __init__(self, capacity):
method _postinit (line 318) | def _postinit(self):
method __getstate__ (line 326) | def __getstate__(self):
method __setstate__ (line 333) | def __setstate__(self, d):
method __getnewargs__ (line 337) | def __getnewargs__(self):
method copy (line 340) | def copy(self):
method get (line 347) | def get(self, key, default=None):
method setdefault (line 354) | def setdefault(self, key, default=None):
method clear (line 368) | def clear(self):
method __contains__ (line 377) | def __contains__(self, key):
method __len__ (line 381) | def __len__(self):
method __repr__ (line 385) | def __repr__(self):
method __getitem__ (line 391) | def __getitem__(self, key):
method __setitem__ (line 413) | def __setitem__(self, key, value):
method __delitem__ (line 428) | def __delitem__(self, key):
method items (line 443) | def items(self):
method iteritems (line 449) | def iteritems(self):
method values (line 453) | def values(self):
method itervalue (line 457) | def itervalue(self):
method keys (line 461) | def keys(self):
method iterkeys (line 465) | def iterkeys(self):
method __reversed__ (line 473) | def __reversed__(self):
class Cycler (line 491) | class Cycler(object):
method __init__ (line 494) | def __init__(self, *items):
method reset (line 500) | def reset(self):
method current (line 505) | def current(self):
method __next__ (line 509) | def __next__(self):
class Joiner (line 516) | class Joiner(object):
method __init__ (line 519) | def __init__(self, sep=u', '):
method __call__ (line 523) | def __call__(self):
FILE: lib/jinja2/visitor.py
class NodeVisitor (line 14) | class NodeVisitor(object):
method get_visitor (line 26) | def get_visitor(self, node):
method visit (line 34) | def visit(self, node, *args, **kwargs):
method generic_visit (line 41) | def generic_visit(self, node, *args, **kwargs):
class NodeTransformer (line 47) | class NodeTransformer(NodeVisitor):
method generic_visit (line 58) | def generic_visit(self, node, *args, **kwargs):
method visit_list (line 80) | def visit_list(self, node, *args, **kwargs):
FILE: lib/markupsafe/__init__.py
class Markup (line 25) | class Markup(text_type):
method __new__ (line 70) | def __new__(cls, base=u'', encoding=None, errors='strict'):
method __html__ (line 77) | def __html__(self):
method __add__ (line 80) | def __add__(self, other):
method __radd__ (line 85) | def __radd__(self, other):
method __mul__ (line 90) | def __mul__(self, num):
method __mod__ (line 96) | def __mod__(self, arg):
method __repr__ (line 103) | def __repr__(self):
method join (line 109) | def join(self, seq):
method split (line 113) | def split(self, *args, **kwargs):
method rsplit (line 117) | def rsplit(self, *args, **kwargs):
method splitlines (line 121) | def splitlines(self, *args, **kwargs):
method unescape (line 126) | def unescape(self):
method striptags (line 148) | def striptags(self):
method escape (line 160) | def escape(cls, s):
method make_simple_escaping_wrapper (line 170) | def make_simple_escaping_wrapper(name):
method partition (line 188) | def partition(self, sep):
method rpartition (line 191) | def rpartition(self, sep):
method format (line 197) | def format(*args, **kwargs):
method __html_format__ (line 203) | def __html_format__(self, format_spec):
class _MagicFormatMapping (line 216) | class _MagicFormatMapping(Mapping):
method __init__ (line 224) | def __init__(self, args, kwargs):
method __getitem__ (line 229) | def __getitem__(self, key):
method __iter__ (line 240) | def __iter__(self):
method __len__ (line 243) | def __len__(self):
class EscapeFormatter (line 248) | class EscapeFormatter(string.Formatter):
method __init__ (line 250) | def __init__(self, escape):
method format_field (line 253) | def format_field(self, value, format_spec):
function _escape_argspec (line 267) | def _escape_argspec(obj, iterable, escape):
class _MarkupEscapeHelper (line 275) | class _MarkupEscapeHelper(object):
method __init__ (line 278) | def __init__(self, obj, escape):
FILE: lib/markupsafe/_native.py
function escape (line 15) | def escape(s):
function escape_silent (line 31) | def escape_silent(s):
function soft_unicode (line 40) | def soft_unicode(s):
FILE: lib/markupsafe/_speedups.c
type Py_ssize_t (line 18) | typedef int Py_ssize_t;
function init_constants (line 28) | static int
function PyObject (line 55) | static PyObject*
function PyObject (line 117) | static PyObject*
function PyObject (line 162) | static PyObject*
function PyObject (line 171) | static PyObject*
function PyMODINIT_FUNC (line 207) | PyMODINIT_FUNC
type PyModuleDef (line 218) | struct PyModuleDef
function PyMODINIT_FUNC (line 230) | PyMODINIT_FUNC
FILE: lib/markupsafe/tests.py
class MarkupTestCase (line 9) | class MarkupTestCase(unittest.TestCase):
method test_adding (line 11) | def test_adding(self):
method test_string_interpolation (line 17) | def test_string_interpolation(self):
method test_type_behavior (line 28) | def test_type_behavior(self):
method test_html_interop (line 36) | def test_html_interop(self):
method test_tuple_interpol (line 48) | def test_tuple_interpol(self):
method test_dict_interpol (line 54) | def test_dict_interpol(self):
method test_escaping (line 63) | def test_escaping(self):
method test_formatting (line 69) | def test_formatting(self):
method test_formatting_empty (line 84) | def test_formatting_empty(self):
method test_custom_formatting (line 88) | def test_custom_formatting(self):
method test_complex_custom_formatting (line 102) | def test_complex_custom_formatting(self):
method test_all_set (line 123) | def test_all_set(self):
method test_escape_silent (line 128) | def test_escape_silent(self):
method test_splitting (line 133) | def test_splitting(self):
method test_mul (line 147) | def test_mul(self):
class MarkupLeakTestCase (line 151) | class MarkupLeakTestCase(unittest.TestCase):
method test_markup_leaks (line 153) | def test_markup_leaks(self):
function suite (line 165) | def suite():
FILE: lib/werkzeug/__init__.py
class module (line 111) | class module(ModuleType):
method __getattr__ (line 115) | def __getattr__(self, name):
method __dir__ (line 125) | def __dir__(self):
FILE: lib/werkzeug/_compat.py
function fix_tuple_repr (line 38) | def fix_tuple_repr(obj):
function implements_iterator (line 48) | def implements_iterator(cls):
function implements_to_string (line 53) | def implements_to_string(cls):
function native_string_result (line 58) | def native_string_result(func):
function implements_bool (line 63) | def implements_bool(cls):
function make_literal_wrapper (line 75) | def make_literal_wrapper(reference):
function normalize_string_tuple (line 78) | def normalize_string_tuple(tup):
function try_coerce_native (line 86) | def try_coerce_native(s):
function wsgi_decoding_dance (line 97) | def wsgi_decoding_dance(s, charset='utf-8', errors='replace'):
function wsgi_encoding_dance (line 100) | def wsgi_encoding_dance(s, charset='utf-8', errors='replace'):
function to_bytes (line 105) | def to_bytes(x, charset=sys.getdefaultencoding(), errors='strict'):
function to_native (line 114) | def to_native(x, charset=sys.getdefaultencoding(), errors='strict'):
function reraise (line 135) | def reraise(tp, value, tb=None):
function make_literal_wrapper (line 155) | def make_literal_wrapper(reference):
function normalize_string_tuple (line 160) | def normalize_string_tuple(tup):
function wsgi_decoding_dance (line 175) | def wsgi_decoding_dance(s, charset='utf-8', errors='replace'):
function wsgi_encoding_dance (line 178) | def wsgi_encoding_dance(s, charset='utf-8', errors='replace'):
function to_bytes (line 183) | def to_bytes(x, charset=sys.getdefaultencoding(), errors='strict'):
function to_native (line 192) | def to_native(x, charset=sys.getdefaultencoding(), errors='strict'):
function to_unicode (line 198) | def to_unicode(x, charset=sys.getdefaultencoding(), errors='strict',
FILE: lib/werkzeug/_internal.py
class _Missing (line 57) | class _Missing(object):
method __repr__ (line 59) | def __repr__(self):
method __reduce__ (line 62) | def __reduce__(self):
function _get_environ (line 68) | def _get_environ(obj):
function _log (line 75) | def _log(type, message, *args, **kwargs):
function _parse_signature (line 90) | def _parse_signature(func):
function _date_to_unix (line 154) | def _date_to_unix(arg):
class _DictAccessorProperty (line 170) | class _DictAccessorProperty(object):
method __init__ (line 175) | def __init__(self, name, default=None, load_func=None, dump_func=None,
method __get__ (line 185) | def __get__(self, obj, type=None):
method __set__ (line 199) | def __set__(self, obj, value):
method __delete__ (line 206) | def __delete__(self, obj):
method __repr__ (line 211) | def __repr__(self):
function _cookie_quote (line 218) | def _cookie_quote(b):
function _cookie_unquote (line 235) | def _cookie_unquote(b):
function _cookie_parse_impl (line 271) | def _cookie_parse_impl(b):
function _encode_idna (line 290) | def _encode_idna(domain):
function _decode_idna (line 309) | def _decode_idna(domain):
function _make_cookie_domain (line 332) | def _make_cookie_domain(domain):
function _easteregg (line 349) | def _easteregg(app=None):
FILE: lib/werkzeug/_reloader.py
function _iter_module_files (line 12) | def _iter_module_files():
function _find_observable_paths (line 36) | def _find_observable_paths(extra_files=None):
function _find_common_roots (line 53) | def _find_common_roots(paths):
class ReloaderLoop (line 74) | class ReloaderLoop(object):
method __init__ (line 82) | def __init__(self, extra_files=None, interval=1):
method run (line 87) | def run(self):
method restart_with_reloader (line 90) | def restart_with_reloader(self):
method trigger_reload (line 113) | def trigger_reload(self, filename):
method log_reload (line 117) | def log_reload(self, filename):
class StatReloaderLoop (line 122) | class StatReloaderLoop(ReloaderLoop):
method run (line 125) | def run(self):
class WatchdogReloaderLoop (line 144) | class WatchdogReloaderLoop(ReloaderLoop):
method __init__ (line 146) | def __init__(self, *args, **kwargs):
method trigger_reload (line 188) | def trigger_reload(self, filename):
method run (line 195) | def run(self):
function run_with_reloader (line 243) | def run_with_reloader(main_func, extra_files=None, interval=1,
FILE: lib/werkzeug/contrib/atom.py
function _make_text_block (line 34) | def _make_text_block(name, content, content_type=None):
function format_iso8601 (line 45) | def format_iso8601(obj):
class AtomFeed (line 54) | class AtomFeed(object):
method __init__ (line 105) | def __init__(self, title=None, entries=None, **kwargs):
method add (line 140) | def add(self, *args, **kwargs):
method __repr__ (line 151) | def __repr__(self):
method generate (line 158) | def generate(self):
method to_string (line 214) | def to_string(self):
method get_response (line 218) | def get_response(self):
method __call__ (line 222) | def __call__(self, environ, start_response):
method __str__ (line 226) | def __str__(self):
class FeedEntry (line 231) | class FeedEntry(object):
method __init__ (line 277) | def __init__(self, title=None, content=None, feed_url=None, **kwargs):
method __repr__ (line 308) | def __repr__(self):
method generate (line 314) | def generate(self):
method to_string (line 350) | def to_string(self):
method __str__ (line 354) | def __str__(self):
FILE: lib/werkzeug/contrib/cache.py
function _items (line 75) | def _items(mappingorseq):
class BaseCache (line 91) | class BaseCache(object):
method __init__ (line 101) | def __init__(self, default_timeout=300):
method get (line 104) | def get(self, key):
method delete (line 112) | def delete(self, key):
method get_many (line 121) | def get_many(self, *keys):
method get_dict (line 134) | def get_dict(self, *keys):
method set (line 146) | def set(self, key, value, timeout=None):
method add (line 162) | def add(self, key, value, timeout=None):
method set_many (line 177) | def set_many(self, mapping, timeout=None):
method delete_many (line 193) | def delete_many(self, *keys):
method has (line 203) | def has(self, key):
method clear (line 218) | def clear(self):
method inc (line 226) | def inc(self, key, delta=1):
method dec (line 239) | def dec(self, key, delta=1):
class NullCache (line 253) | class NullCache(BaseCache):
class SimpleCache (line 262) | class SimpleCache(BaseCache):
method __init__ (line 276) | def __init__(self, threshold=500, default_timeout=300):
method _prune (line 282) | def _prune(self):
method _get_expiration (line 292) | def _get_expiration(self, timeout):
method get (line 299) | def get(self, key):
method set (line 307) | def set(self, key, value, timeout=None):
method add (line 314) | def add(self, key, value, timeout=None):
method delete (line 324) | def delete(self, key):
method has (line 327) | def has(self, key):
class MemcachedCache (line 337) | class MemcachedCache(BaseCache):
method __init__ (line 372) | def __init__(self, servers=None, default_timeout=300, key_prefix=None):
method _normalize_key (line 387) | def _normalize_key(self, key):
method _normalize_timeout (line 393) | def _normalize_timeout(self, timeout):
method get (line 400) | def get(self, key):
method get_dict (line 408) | def get_dict(self, *keys):
method add (line 428) | def add(self, key, value, timeout=None):
method set (line 433) | def set(self, key, value, timeout=None):
method get_many (line 438) | def get_many(self, *keys):
method set_many (line 442) | def set_many(self, mapping, timeout=None):
method delete (line 452) | def delete(self, key):
method delete_many (line 457) | def delete_many(self, *keys):
method has (line 465) | def has(self, key):
method clear (line 471) | def clear(self):
method inc (line 474) | def inc(self, key, delta=1):
method dec (line 478) | def dec(self, key, delta=1):
method import_preferred_memcache_lib (line 482) | def import_preferred_memcache_lib(self, servers):
class RedisCache (line 510) | class RedisCache(BaseCache):
method __init__ (line 547) | def __init__(self, host='localhost', port=6379, password=None,
method _get_expiration (line 564) | def _get_expiration(self, timeout):
method dump_object (line 571) | def dump_object(self, value):
method load_object (line 580) | def load_object(self, value):
method get (line 597) | def get(self, key):
method get_many (line 600) | def get_many(self, *keys):
method set (line 605) | def set(self, key, value, timeout=None):
method add (line 616) | def add(self, key, value, timeout=None):
method set_many (line 624) | def set_many(self, mapping, timeout=None):
method delete (line 639) | def delete(self, key):
method delete_many (line 642) | def delete_many(self, *keys):
method has (line 649) | def has(self, key):
method clear (line 652) | def clear(self):
method inc (line 662) | def inc(self, key, delta=1):
method dec (line 665) | def dec(self, key, delta=1):
class FileSystemCache (line 669) | class FileSystemCache(BaseCache):
method __init__ (line 688) | def __init__(self, cache_dir, threshold=500, default_timeout=300,
method _list_dir (line 701) | def _list_dir(self):
method _prune (line 707) | def _prune(self):
method clear (line 723) | def clear(self):
method _get_filename (line 731) | def _get_filename(self, key):
method get (line 737) | def get(self, key):
method add (line 750) | def add(self, key, value, timeout=None):
method set (line 756) | def set(self, key, value, timeout=None):
method delete (line 776) | def delete(self, key):
method has (line 784) | def has(self, key):
FILE: lib/werkzeug/contrib/fixers.py
class CGIRootFix (line 30) | class CGIRootFix(object):
method __init__ (line 44) | def __init__(self, app, app_root='/'):
method __call__ (line 48) | def __call__(self, environ, start_response):
class PathInfoFromRequestUriFix (line 65) | class PathInfoFromRequestUriFix(object):
method __init__ (line 81) | def __init__(self, app):
method __call__ (line 84) | def __call__(self, environ, start_response):
class ProxyFix (line 97) | class ProxyFix(object):
method __init__ (line 120) | def __init__(self, app, num_proxies=1):
method get_remote_addr (line 124) | def get_remote_addr(self, forwarded_for):
method __call__ (line 134) | def __call__(self, environ, start_response):
class HeaderRewriterFix (line 155) | class HeaderRewriterFix(object):
method __init__ (line 172) | def __init__(self, app, remove_headers=None, add_headers=None):
method __call__ (line 177) | def __call__(self, environ, start_response):
class InternetExplorerFix (line 188) | class InternetExplorerFix(object):
method __init__ (line 211) | def __init__(self, app, fix_vary=True, fix_attach=True):
method fix_headers (line 216) | def fix_headers(self, environ, headers, status=None):
method run_fixed (line 243) | def run_fixed(self, environ, start_response):
method __call__ (line 250) | def __call__(self, environ, start_response):
FILE: lib/werkzeug/contrib/iterio.py
function _mixed_join (line 50) | def _mixed_join(iterable, sentinel):
function _newline (line 59) | def _newline(reference_string):
class IterIO (line 66) | class IterIO(object):
method __new__ (line 94) | def __new__(cls, obj, sentinel=''):
method __iter__ (line 101) | def __iter__(self):
method tell (line 104) | def tell(self):
method isatty (line 109) | def isatty(self):
method seek (line 114) | def seek(self, pos, mode=0):
method truncate (line 119) | def truncate(self, size=None):
method write (line 124) | def write(self, s):
method writelines (line 129) | def writelines(self, list):
method read (line 134) | def read(self, n=-1):
method readlines (line 139) | def readlines(self, sizehint=0):
method readline (line 144) | def readline(self, length=None):
method flush (line 149) | def flush(self):
method __next__ (line 154) | def __next__(self):
class IterI (line 163) | class IterI(IterIO):
method __new__ (line 167) | def __new__(cls, func, sentinel=''):
method close (line 188) | def close(self):
method write (line 193) | def write(self, s):
method writelines (line 200) | def writelines(self, list):
method flush (line 204) | def flush(self):
method _flush_impl (line 209) | def _flush_impl(self):
class IterO (line 218) | class IterO(IterIO):
method __new__ (line 222) | def __new__(cls, gen, sentinel=''):
method __iter__ (line 231) | def __iter__(self):
method _buf_append (line 234) | def _buf_append(self, string):
method close (line 242) | def close(self):
method seek (line 248) | def seek(self, pos, mode=0):
method read (line 272) | def read(self, n=-1):
method readline (line 302) | def readline(self, length=None):
method readlines (line 342) | def readlines(self, sizehint=0):
FILE: lib/werkzeug/contrib/jsrouting.py
function dumps (line 18) | def dumps(*args):
function render_template (line 26) | def render_template(name_parts, rules, converters):
function generate_map (line 172) | def generate_map(map, name='url_map'):
function generate_adapter (line 219) | def generate_adapter(adapter, name='url_for', map_name='url_map'):
function js_to_url_function (line 238) | def js_to_url_function(converter):
function NumberConverter_js_to_url (line 252) | def NumberConverter_js_to_url(conv):
FILE: lib/werkzeug/contrib/limiter.py
class StreamLimitMiddleware (line 20) | class StreamLimitMiddleware(object):
method __init__ (line 33) | def __init__(self, app, maximum_size=1024 * 1024 * 10):
method __call__ (line 38) | def __call__(self, environ, start_response):
FILE: lib/werkzeug/contrib/lint.py
class WSGIWarning (line 31) | class WSGIWarning(Warning):
class HTTPWarning (line 36) | class HTTPWarning(Warning):
function check_string (line 41) | def check_string(context, obj, stacklevel=3):
class InputStream (line 47) | class InputStream(object):
method __init__ (line 49) | def __init__(self, stream):
method read (line 52) | def read(self, *args):
method readline (line 64) | def readline(self, *args):
method __iter__ (line 78) | def __iter__(self):
method close (line 85) | def close(self):
class ErrorStream (line 91) | class ErrorStream(object):
method __init__ (line 93) | def __init__(self, stream):
method write (line 96) | def write(self, s):
method flush (line 100) | def flush(self):
method writelines (line 103) | def writelines(self, seq):
method close (line 107) | def close(self):
class GuardedWrite (line 113) | class GuardedWrite(object):
method __init__ (line 115) | def __init__(self, write, chunks):
method __call__ (line 119) | def __call__(self, s):
class GuardedIterator (line 125) | class GuardedIterator(object):
method __init__ (line 127) | def __init__(self, iterator, headers_set, chunks):
method __iter__ (line 134) | def __iter__(self):
method next (line 137) | def next(self):
method close (line 149) | def close(self):
method __del__ (line 179) | def __del__(self):
class LintMiddleware (line 188) | class LintMiddleware(object):
method __init__ (line 213) | def __init__(self, app):
method check_environ (line 216) | def check_environ(self, environ):
method check_start_response (line 240) | def check_start_response(self, status, headers, exc_info):
method check_headers (line 276) | def check_headers(self, headers):
method check_iterator (line 290) | def check_iterator(self, app_iter):
method __call__ (line 297) | def __call__(self, *args, **kwargs):
FILE: lib/werkzeug/contrib/profiler.py
class MergeStream (line 33) | class MergeStream(object):
method __init__ (line 43) | def __init__(self, *streams):
method write (line 48) | def write(self, data):
class ProfilerMiddleware (line 53) | class ProfilerMiddleware(object):
method __init__ (line 77) | def __init__(self, app, stream=None,
method __call__ (line 88) | def __call__(self, environ, start_response):
function make_action (line 130) | def make_action(app_factory, hostname='localhost', port=5000,
FILE: lib/werkzeug/contrib/securecookie.py
class UnquoteError (line 105) | class UnquoteError(Exception):
class SecureCookie (line 110) | class SecureCookie(ModificationTrackingDict):
method __init__ (line 150) | def __init__(self, data=None, secret_key=None, new=True):
method __repr__ (line 159) | def __repr__(self):
method should_save (line 167) | def should_save(self):
method quote (line 174) | def quote(cls, value):
method unquote (line 187) | def unquote(cls, value):
method serialize (line 205) | def serialize(self, expires=None):
method unserialize (line 233) | def unserialize(cls, string, secret_key):
method load_cookie (line 288) | def load_cookie(cls, request, key='session', secret_key=None):
method save_cookie (line 305) | def save_cookie(self, response, key='session', expires=None,
FILE: lib/werkzeug/contrib/sessions.py
function _urandom (line 74) | def _urandom():
function generate_key (line 80) | def generate_key(salt=None):
class ModificationTrackingDict (line 90) | class ModificationTrackingDict(CallbackDict):
method __init__ (line 93) | def __init__(self, *args, **kwargs):
method copy (line 100) | def copy(self):
method __copy__ (line 110) | def __copy__(self):
class Session (line 114) | class Session(ModificationTrackingDict):
method __init__ (line 122) | def __init__(self, data, sid, new=False):
method __repr__ (line 127) | def __repr__(self):
method should_save (line 135) | def should_save(self):
class SessionStore (line 145) | class SessionStore(object):
method __init__ (line 155) | def __init__(self, session_class=None):
method is_valid_key (line 160) | def is_valid_key(self, key):
method generate_key (line 164) | def generate_key(self, salt=None):
method new (line 168) | def new(self):
method save (line 172) | def save(self, session):
method save_if_modified (line 175) | def save_if_modified(self, session):
method delete (line 180) | def delete(self, session):
method get (line 183) | def get(self, sid):
class FilesystemSessionStore (line 195) | class FilesystemSessionStore(SessionStore):
method __init__ (line 218) | def __init__(self, path=None, filename_template='werkzeug_%s.sess',
method get_session_filename (line 233) | def get_session_filename(self, sid):
method save (line 241) | def save(self, session):
method delete (line 256) | def delete(self, session):
method get (line 263) | def get(self, sid):
method list (line 282) | def list(self):
class SessionMiddleware (line 301) | class SessionMiddleware(object):
method __init__ (line 318) | def __init__(self, app, store, cookie_name='session_id',
method __call__ (line 333) | def __call__(self, environ, start_response):
FILE: lib/werkzeug/contrib/testtools.py
class ContentAccessors (line 23) | class ContentAccessors(object):
method xml (line 30) | def xml(self):
method lxml (line 45) | def lxml(self):
method json (line 59) | def json(self):
class TestResponse (line 71) | class TestResponse(Response, ContentAccessors):
FILE: lib/werkzeug/contrib/wrappers.py
function is_known_charset (line 35) | def is_known_charset(charset):
class JSONRequestMixin (line 44) | class JSONRequestMixin(object):
method json (line 54) | def json(self):
class ProtobufRequestMixin (line 64) | class ProtobufRequestMixin(object):
method parse_protobuf (line 81) | def parse_protobuf(self, proto_type):
class RoutingArgsRequestMixin (line 99) | class RoutingArgsRequestMixin(object):
method _get_routing_args (line 107) | def _get_routing_args(self):
method _set_routing_args (line 110) | def _set_routing_args(self, value):
method _get_routing_vars (line 121) | def _get_routing_vars(self):
method _set_routing_vars (line 130) | def _set_routing_vars(self, value):
class ReverseSlashBehaviorRequestMixin (line 142) | class ReverseSlashBehaviorRequestMixin(object):
method path (line 167) | def path(self):
method script_root (line 176) | def script_root(self):
class DynamicCharsetRequestMixin (line 183) | class DynamicCharsetRequestMixin(object):
method unknown_charset (line 215) | def unknown_charset(self, charset):
method charset (line 227) | def charset(self):
class DynamicCharsetResponseMixin (line 240) | class DynamicCharsetResponseMixin(object):
method _get_charset (line 264) | def _get_charset(self):
method _set_charset (line 272) | def _set_charset(self, charset):
FILE: lib/werkzeug/datastructures.py
function is_immutable (line 27) | def is_immutable(self):
function iter_multi_items (line 31) | def iter_multi_items(mapping):
function native_itermethods (line 50) | def native_itermethods(names):
class ImmutableListMixin (line 69) | class ImmutableListMixin(object):
method __hash__ (line 80) | def __hash__(self):
method __reduce_ex__ (line 86) | def __reduce_ex__(self, protocol):
method __delitem__ (line 89) | def __delitem__(self, key):
method __delslice__ (line 92) | def __delslice__(self, i, j):
method __iadd__ (line 95) | def __iadd__(self, other):
method __setitem__ (line 99) | def __setitem__(self, key, value):
method __setslice__ (line 102) | def __setslice__(self, i, j, value):
method append (line 105) | def append(self, item):
method extend (line 109) | def extend(self, iterable):
method insert (line 112) | def insert(self, pos, value):
method pop (line 115) | def pop(self, index=-1):
method reverse (line 118) | def reverse(self):
method sort (line 121) | def sort(self, cmp=None, key=None, reverse=None):
class ImmutableList (line 125) | class ImmutableList(ImmutableListMixin, list):
method __repr__ (line 134) | def __repr__(self):
class ImmutableDictMixin (line 141) | class ImmutableDictMixin(object):
method fromkeys (line 152) | def fromkeys(cls, keys, value=None):
method __reduce_ex__ (line 157) | def __reduce_ex__(self, protocol):
method _iter_hashitems (line 160) | def _iter_hashitems(self):
method __hash__ (line 163) | def __hash__(self):
method setdefault (line 169) | def setdefault(self, key, default=None):
method update (line 172) | def update(self, *args, **kwargs):
method pop (line 175) | def pop(self, key, default=None):
method popitem (line 178) | def popitem(self):
method __setitem__ (line 181) | def __setitem__(self, key, value):
method __delitem__ (line 184) | def __delitem__(self, key):
method clear (line 187) | def clear(self):
class ImmutableMultiDictMixin (line 191) | class ImmutableMultiDictMixin(ImmutableDictMixin):
method __reduce_ex__ (line 200) | def __reduce_ex__(self, protocol):
method _iter_hashitems (line 203) | def _iter_hashitems(self):
method add (line 206) | def add(self, key, value):
method popitemlist (line 209) | def popitemlist(self):
method poplist (line 212) | def poplist(self, key):
method setlist (line 215) | def setlist(self, key, new_list):
method setlistdefault (line 218) | def setlistdefault(self, key, default_list=None):
class UpdateDictMixin (line 222) | class UpdateDictMixin(object):
method calls_update (line 233) | def calls_update(name):
method setdefault (line 242) | def setdefault(self, key, default=None):
method pop (line 249) | def pop(self, key, default=_missing):
class TypeConversionDict (line 267) | class TypeConversionDict(dict):
method get (line 276) | def get(self, key, default=None, type=None):
class ImmutableTypeConversionDict (line 306) | class ImmutableTypeConversionDict(ImmutableDictMixin, TypeConversionDict):
method copy (line 314) | def copy(self):
method __copy__ (line 321) | def __copy__(self):
class MultiDict (line 326) | class MultiDict(TypeConversionDict):
method __init__ (line 368) | def __init__(self, mapping=None):
method __getstate__ (line 386) | def __getstate__(self):
method __setstate__ (line 389) | def __setstate__(self, value):
method __getitem__ (line 393) | def __getitem__(self, key):
method __setitem__ (line 404) | def __setitem__(self, key, value):
method add (line 412) | def add(self, key, value):
method getlist (line 422) | def getlist(self, key, type=None):
method setlist (line 448) | def setlist(self, key, new_list):
method setdefault (line 466) | def setdefault(self, key, default=None):
method setlistdefault (line 480) | def setlistdefault(self, key, default_list=None):
method items (line 504) | def items(self, multi=False):
method lists (line 519) | def lists(self):
method keys (line 526) | def keys(self):
method values (line 531) | def values(self):
method listvalues (line 536) | def listvalues(self):
method copy (line 547) | def copy(self):
method deepcopy (line 551) | def deepcopy(self, memo=None):
method to_dict (line 555) | def to_dict(self, flat=True):
method update (line 569) | def update(self, other_dict):
method pop (line 590) | def pop(self, key, default=_missing):
method popitem (line 611) | def popitem(self):
method poplist (line 619) | def poplist(self, key):
method popitemlist (line 629) | def popitemlist(self):
method __copy__ (line 636) | def __copy__(self):
method __deepcopy__ (line 639) | def __deepcopy__(self, memo):
method __repr__ (line 642) | def __repr__(self):
class _omd_bucket (line 646) | class _omd_bucket(object):
method __init__ (line 655) | def __init__(self, omd, key, value):
method unlink (line 667) | def unlink(self, omd):
class OrderedMultiDict (line 679) | class OrderedMultiDict(MultiDict):
method __init__ (line 696) | def __init__(self, mapping=None):
method __eq__ (line 702) | def __eq__(self, other):
method __ne__ (line 727) | def __ne__(self, other):
method __reduce_ex__ (line 730) | def __reduce_ex__(self, protocol):
method __getstate__ (line 733) | def __getstate__(self):
method __setstate__ (line 736) | def __setstate__(self, values):
method __getitem__ (line 741) | def __getitem__(self, key):
method __setitem__ (line 746) | def __setitem__(self, key, value):
method __delitem__ (line 750) | def __delitem__(self, key):
method keys (line 753) | def keys(self):
method values (line 758) | def values(self):
method items (line 761) | def items(self, multi=False):
method lists (line 775) | def lists(self):
method listvalues (line 784) | def listvalues(self):
method add (line 788) | def add(self, key, value):
method getlist (line 791) | def getlist(self, key, type=None):
method setlist (line 806) | def setlist(self, key, new_list):
method setlistdefault (line 811) | def setlistdefault(self, key, default_list=None):
method update (line 815) | def update(self, mapping):
method poplist (line 819) | def poplist(self, key):
method pop (line 825) | def pop(self, key, default=_missing):
method popitem (line 836) | def popitem(self):
method popitemlist (line 845) | def popitemlist(self):
function _options_header_vkw (line 855) | def _options_header_vkw(value, kw):
function _unicodify_header_value (line 860) | def _unicodify_header_value(value):
class Headers (line 869) | class Headers(object):
method __init__ (line 903) | def __init__(self, defaults=None):
method __getitem__ (line 911) | def __getitem__(self, key, _get_mode=False):
method __eq__ (line 930) | def __eq__(self, other):
method __ne__ (line 934) | def __ne__(self, other):
method get (line 937) | def get(self, key, default=None, type=None, as_bytes=False):
method getlist (line 976) | def getlist(self, key, type=None, as_bytes=False):
method get_all (line 1006) | def get_all(self, name):
method items (line 1014) | def items(self, lower=False):
method keys (line 1020) | def keys(self, lower=False):
method values (line 1024) | def values(self):
method extend (line 1028) | def extend(self, iterable):
method __delitem__ (line 1043) | def __delitem__(self, key, _index_operation=True):
method remove (line 1054) | def remove(self, key):
method pop (line 1061) | def pop(self, key=None, default=_missing):
method popitem (line 1083) | def popitem(self):
method __contains__ (line 1087) | def __contains__(self, key):
method __iter__ (line 1097) | def __iter__(self):
method __len__ (line 1101) | def __len__(self):
method add (line 1104) | def add(self, _key, _value, **kw):
method _validate_value (line 1126) | def _validate_value(self, value):
method add_header (line 1133) | def add_header(self, _key, _value, **_kw):
method clear (line 1141) | def clear(self):
method set (line 1145) | def set(self, _key, _value, **kw):
method setdefault (line 1179) | def setdefault(self, key, value):
method __setitem__ (line 1192) | def __setitem__(self, key, value):
method to_list (line 1206) | def to_list(self, charset='iso-8859-1'):
method to_wsgi_list (line 1213) | def to_wsgi_list(self):
method copy (line 1225) | def copy(self):
method __copy__ (line 1228) | def __copy__(self):
method __str__ (line 1231) | def __str__(self):
method __repr__ (line 1239) | def __repr__(self):
class ImmutableHeadersMixin (line 1246) | class ImmutableHeadersMixin(object):
method __delitem__ (line 1257) | def __delitem__(self, key):
method __setitem__ (line 1260) | def __setitem__(self, key, value):
method add (line 1264) | def add(self, item):
method extend (line 1268) | def extend(self, iterable):
method insert (line 1271) | def insert(self, pos, value):
method pop (line 1274) | def pop(self, index=-1):
method popitem (line 1277) | def popitem(self):
method setdefault (line 1280) | def setdefault(self, key, default):
class EnvironHeaders (line 1284) | class EnvironHeaders(ImmutableHeadersMixin, Headers):
method __init__ (line 1296) | def __init__(self, environ):
method __eq__ (line 1299) | def __eq__(self, other):
method __getitem__ (line 1302) | def __getitem__(self, key, _get_mode=False):
method __len__ (line 1310) | def __len__(self):
method __iter__ (line 1315) | def __iter__(self):
method copy (line 1325) | def copy(self):
class CombinedMultiDict (line 1330) | class CombinedMultiDict(ImmutableMultiDictMixin, MultiDict):
method __reduce_ex__ (line 1354) | def __reduce_ex__(self, protocol):
method __init__ (line 1357) | def __init__(self, dicts=None):
method fromkeys (line 1361) | def fromkeys(cls):
method __getitem__ (line 1365) | def __getitem__(self, key):
method get (line 1371) | def get(self, key, default=None, type=None):
method getlist (line 1382) | def getlist(self, key, type=None):
method _keys_impl (line 1388) | def _keys_impl(self):
method keys (line 1400) | def keys(self):
method items (line 1405) | def items(self, multi=False):
method values (line 1415) | def values(self):
method lists (line 1419) | def lists(self):
method listvalues (line 1426) | def listvalues(self):
method copy (line 1429) | def copy(self):
method to_dict (line 1433) | def to_dict(self, flat=True):
method __len__ (line 1448) | def __len__(self):
method __contains__ (line 1451) | def __contains__(self, key):
method __repr__ (line 1459) | def __repr__(self):
class FileMultiDict (line 1463) | class FileMultiDict(MultiDict):
method add_file (line 1472) | def add_file(self, name, file, filename=None, content_type=None):
class ImmutableDict (line 1496) | class ImmutableDict(ImmutableDictMixin, dict):
method __repr__ (line 1503) | def __repr__(self):
method copy (line 1509) | def copy(self):
method __copy__ (line 1516) | def __copy__(self):
class ImmutableMultiDict (line 1520) | class ImmutableMultiDict(ImmutableMultiDictMixin, MultiDict):
method copy (line 1527) | def copy(self):
method __copy__ (line 1534) | def __copy__(self):
class ImmutableOrderedMultiDict (line 1538) | class ImmutableOrderedMultiDict(ImmutableMultiDictMixin, OrderedMultiDict):
method _iter_hashitems (line 1545) | def _iter_hashitems(self):
method copy (line 1548) | def copy(self):
method __copy__ (line 1555) | def __copy__(self):
class Accept (line 1560) | class Accept(ImmutableList):
method __init__ (line 1590) | def __init__(self, values=()):
method _value_matches (line 1604) | def _value_matches(self, value, item):
method __getitem__ (line 1608) | def __getitem__(self, key):
method quality (line 1617) | def quality(self, key):
method __contains__ (line 1629) | def __contains__(self, value):
method __repr__ (line 1635) | def __repr__(self):
method index (line 1641) | def index(self, key):
method find (line 1657) | def find(self, key):
method values (line 1667) | def values(self):
method to_header (line 1672) | def to_header(self):
method __str__ (line 1681) | def __str__(self):
method best_match (line 1684) | def best_match(self, matches, default=None):
method best (line 1705) | def best(self):
class MIMEAccept (line 1711) | class MIMEAccept(Accept):
method _value_matches (line 1717) | def _value_matches(self, value, item):
method accept_html (line 1744) | def accept_html(self):
method accept_xhtml (line 1753) | def accept_xhtml(self):
method accept_json (line 1761) | def accept_json(self):
class LanguageAccept (line 1766) | class LanguageAccept(Accept):
method _value_matches (line 1770) | def _value_matches(self, value, item):
class CharsetAccept (line 1776) | class CharsetAccept(Accept):
method _value_matches (line 1780) | def _value_matches(self, value, item):
function cache_property (line 1789) | def cache_property(key, empty, type):
class _CacheControl (line 1798) | class _CacheControl(UpdateDictMixin, dict):
method __init__ (line 1836) | def __init__(self, values=(), on_update=None):
method _get_cache_value (line 1841) | def _get_cache_value(self, key, empty, type):
method _set_cache_value (line 1856) | def _set_cache_value(self, key, value, type):
method _del_cache_value (line 1871) | def _del_cache_value(self, key):
method to_header (line 1876) | def to_header(self):
method __str__ (line 1880) | def __str__(self):
method __repr__ (line 1883) | def __repr__(self):
class RequestCacheControl (line 1892) | class RequestCacheControl(ImmutableDictMixin, _CacheControl):
class ResponseCacheControl (line 1913) | class ResponseCacheControl(_CacheControl):
class CallbackDict (line 1941) | class CallbackDict(UpdateDictMixin, dict):
method __init__ (line 1947) | def __init__(self, initial=None, on_update=None):
method __repr__ (line 1951) | def __repr__(self):
class HeaderSet (line 1958) | class HeaderSet(object):
method __init__ (line 1972) | def __init__(self, headers=None, on_update=None):
method add (line 1977) | def add(self, header):
method remove (line 1981) | def remove(self, header):
method update (line 2002) | def update(self, iterable):
method discard (line 2017) | def discard(self, header):
method find (line 2027) | def find(self, header):
method index (line 2038) | def index(self, header):
method clear (line 2049) | def clear(self):
method as_set (line 2056) | def as_set(self, preserve_casing=False):
method to_header (line 2069) | def to_header(self):
method __getitem__ (line 2073) | def __getitem__(self, idx):
method __delitem__ (line 2076) | def __delitem__(self, idx):
method __setitem__ (line 2082) | def __setitem__(self, idx, value):
method __contains__ (line 2090) | def __contains__(self, header):
method __len__ (line 2093) | def __len__(self):
method __iter__ (line 2096) | def __iter__(self):
method __nonzero__ (line 2099) | def __nonzero__(self):
method __str__ (line 2102) | def __str__(self):
method __repr__ (line 2105) | def __repr__(self):
class ETags (line 2112) | class ETags(object):
method __init__ (line 2118) | def __init__(self, strong_etags=None, weak_etags=None, star_tag=False):
method as_set (line 2123) | def as_set(self, include_weak=False):
method is_weak (line 2131) | def is_weak(self, etag):
method contains_weak (line 2135) | def contains_weak(self, etag):
method contains (line 2139) | def contains(self, etag):
method contains_raw (line 2148) | def contains_raw(self, etag):
method to_header (line 2157) | def to_header(self):
method __call__ (line 2166) | def __call__(self, etag=None, data=None, include_weak=False):
method __bool__ (line 2176) | def __bool__(self):
method __str__ (line 2181) | def __str__(self):
method __iter__ (line 2184) | def __iter__(self):
method __contains__ (line 2187) | def __contains__(self, etag):
method __repr__ (line 2190) | def __repr__(self):
class IfRange (line 2194) | class IfRange(object):
method __init__ (line 2203) | def __init__(self, etag=None, date=None):
method to_header (line 2210) | def to_header(self):
method __str__ (line 2218) | def __str__(self):
method __repr__ (line 2221) | def __repr__(self):
class Range (line 2225) | class Range(object):
method __init__ (line 2234) | def __init__(self, units, ranges):
method range_for_length (line 2241) | def range_for_length(self, length):
method make_content_range (line 2256) | def make_content_range(self, length):
method to_header (line 2264) | def to_header(self):
method __str__ (line 2274) | def __str__(self):
method __repr__ (line 2277) | def __repr__(self):
class ContentRange (line 2281) | class ContentRange(object):
method __init__ (line 2288) | def __init__(self, units, start, stop, length=None, on_update=None):
method _callback_property (line 2294) | def _callback_property(name):
method set (line 2314) | def set(self, start, stop, length=None, units='bytes'):
method unset (line 2325) | def unset(self):
method to_header (line 2331) | def to_header(self):
method __nonzero__ (line 2347) | def __nonzero__(self):
method __str__ (line 2352) | def __str__(self):
method __repr__ (line 2355) | def __repr__(self):
class Authorization (line 2359) | class Authorization(ImmutableDictMixin, dict):
method __init__ (line 2373) | def __init__(self, auth_type, data=None):
method qop (line 2409) | def qop(self):
class WWWAuthenticate (line 2420) | class WWWAuthenticate(UpdateDictMixin, dict):
method __init__ (line 2427) | def __init__(self, auth_type=None, values=None, on_update=None):
method set_basic (line 2433) | def set_basic(self, realm='authentication required'):
method set_digest (line 2440) | def set_digest(self, realm, nonce, qop=('auth',), opaque=None,
method to_header (line 2460) | def to_header(self):
method __str__ (line 2470) | def __str__(self):
method __repr__ (line 2473) | def __repr__(self):
method auth_property (line 2479) | def auth_property(name, doc=None):
method _set_property (line 2497) | def _set_property(name, doc=None):
method _get_stale (line 2536) | def _get_stale(self):
method _set_stale (line 2541) | def _set_stale(self, value):
class FileStorage (line 2557) | class FileStorage(object):
method __init__ (line 2566) | def __init__(self, stream=None, filename=None, name=None,
method _parse_content_type (line 2598) | def _parse_content_type(self):
method content_type (line 2604) | def content_type(self):
method content_length (line 2609) | def content_length(self):
method mimetype (line 2614) | def mimetype(self):
method mimetype_params (line 2626) | def mimetype_params(self):
method save (line 2636) | def save(self, dst, buffer_size=16384):
method close (line 2661) | def close(self):
method __nonzero__ (line 2668) | def __nonzero__(self):
method __getattr__ (line 2672) | def __getattr__(self, name):
method __iter__ (line 2675) | def __iter__(self):
method __repr__ (line 2678) | def __repr__(self):
FILE: lib/werkzeug/debug/__init__.py
class _ConsoleFrame (line 38) | class _ConsoleFrame(object):
method __init__ (line 44) | def __init__(self, namespace):
function get_pin_and_cookie_name (line 49) | def get_pin_and_cookie_name(app):
class DebuggedApplication (line 113) | class DebuggedApplication(object):
method __init__ (line 143) | def __init__(self, app, evalex=False, request_key='werkzeug.request',
method _get_pin (line 177) | def _get_pin(self):
method _set_pin (line 182) | def _set_pin(self, value):
method pin_cookie_name (line 189) | def pin_cookie_name(self):
method debug_application (line 195) | def debug_application(self, environ, start_response):
method execute_command (line 239) | def execute_command(self, request, command, frame):
method display_console (line 243) | def display_console(self, request):
method paste_traceback (line 257) | def paste_traceback(self, request, traceback):
method get_resource (line 262) | def get_resource(self, request, filename):
method is_trusted (line 275) | def is_trusted(self, environ):
method pin_auth (line 284) | def pin_auth(self, request):
method log_pin_request (line 312) | def log_pin_request(self):
method __call__ (line 320) | def __call__(self, environ, start_response):
FILE: lib/werkzeug/debug/console.py
class HTMLStringO (line 23) | class HTMLStringO(object):
method __init__ (line 27) | def __init__(self):
method isatty (line 30) | def isatty(self):
method close (line 33) | def close(self):
method flush (line 36) | def flush(self):
method seek (line 39) | def seek(self, n, mode=0):
method readline (line 42) | def readline(self):
method reset (line 49) | def reset(self):
method _write (line 54) | def _write(self, x):
method write (line 59) | def write(self, x):
method writelines (line 62) | def writelines(self, x):
class ThreadedStream (line 66) | class ThreadedStream(object):
method push (line 70) | def push():
method fetch (line 76) | def fetch():
method displayhook (line 84) | def displayhook(obj):
method __setattr__ (line 96) | def __setattr__(self, name, value):
method __dir__ (line 99) | def __dir__(self):
method __getattribute__ (line 102) | def __getattribute__(self, name):
method __repr__ (line 111) | def __repr__(self):
class _ConsoleLoader (line 120) | class _ConsoleLoader(object):
method __init__ (line 122) | def __init__(self):
method register (line 125) | def register(self, code, source):
method get_source_by_code (line 132) | def get_source_by_code(self, code):
function _wrap_compiler (line 139) | def _wrap_compiler(console):
class _InteractiveConsole (line 149) | class _InteractiveConsole(code.InteractiveInterpreter):
method __init__ (line 151) | def __init__(self, globals, locals):
method runsource (line 161) | def runsource(self, source):
method runcode (line 178) | def runcode(self, code):
method showtraceback (line 184) | def showtraceback(self):
method showsyntaxerror (line 189) | def showsyntaxerror(self, filename=None):
method write (line 194) | def write(self, data):
class Console (line 198) | class Console(object):
method __init__ (line 202) | def __init__(self, globals=None, locals=None):
method eval (line 209) | def eval(self, code):
FILE: lib/werkzeug/debug/repr.py
function debug_repr (line 49) | def debug_repr(obj):
function dump (line 54) | def dump(obj=missing):
class _Helper (line 66) | class _Helper(object):
method __repr__ (line 72) | def __repr__(self):
method __call__ (line 75) | def __call__(self, topic=None):
function _add_subclass_info (line 97) | def _add_subclass_info(inner, obj, base):
class DebugReprGenerator (line 110) | class DebugReprGenerator(object):
method __init__ (line 112) | def __init__(self):
method _sequence_repr_maker (line 115) | def _sequence_repr_maker(left, right, base=object(), limit=8):
method regex_repr (line 143) | def regex_repr(self, obj):
method string_repr (line 155) | def string_repr(self, obj, limit=70):
method dict_repr (line 171) | def dict_repr(self, d, recursive, limit=5):
method object_repr (line 190) | def object_repr(self, obj):
method dispatch_repr (line 196) | def dispatch_repr(self, obj, recursive):
method fallback_repr (line 219) | def fallback_repr(self):
method repr (line 229) | def repr(self, obj):
method dump_object (line 244) | def dump_object(self, obj):
method dump_locals (line 266) | def dump_locals(self, d):
method render_object_dump (line 270) | def render_object_dump(self, items, title, repr=None):
FILE: lib/werkzeug/debug/shared/debugger.js
function initPinBox (line 95) | function initPinBox() {
function promptForPin (line 128) | function promptForPin() {
function openShell (line 144) | function openShell(consoleNode, target, frameID) {
FILE: lib/werkzeug/debug/shared/jquery.js
function r (line 2) | function r(a){var b="length"in a&&a.length,c=m.type(a);return"function"=...
function ga (line 2) | function ga(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)...
function ha (line 2) | function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLengt...
function ia (line 2) | function ia(a){return a[u]=!0,a}
function ja (line 2) | function ja(a){var b=n.createElement("div");try{return!!a(b)}catch(c){re...
function ka (line 2) | function ka(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[...
function la (line 2) | function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sou...
function ma (line 2) | function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"...
function na (line 2) | function na(a){return function(b){var c=b.nodeName.toLowerCase();return(...
function oa (line 2) | function oa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,...
function pa (line 2) | function pa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}
function qa (line 2) | function qa(){}
function ra (line 2) | function ra(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}
function sa (line 2) | function sa(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.firs...
function ta (line 2) | function ta(a){return a.length>1?function(b,c,d){var e=a.length;while(e-...
function ua (line 2) | function ua(a,b,c){for(var d=0,e=b.length;e>d;d++)ga(a,b[d],c);return c}
function va (line 2) | function va(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(...
function wa (line 2) | function wa(a,b,c,d,e,f){return d&&!d[u]&&(d=wa(d)),e&&!e[u]&&(e=wa(e,f)...
function xa (line 2) | function xa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.r...
function ya (line 2) | function ya(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var...
function w (line 2) | function w(a,b,c){if(m.isFunction(b))return m.grep(a,function(a,d){retur...
function D (line 2) | function D(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}
function G (line 2) | function G(a){var b=F[a]={};return m.each(a.match(E)||[],function(a,c){b...
function I (line 2) | function I(){y.addEventListener?(y.removeEventListener("DOMContentLoaded...
function J (line 2) | function J(){(y.addEventListener||"load"===event.type||"complete"===y.re...
function O (line 2) | function O(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace...
function P (line 2) | function P(a){var b;for(b in a)if(("data"!==b||!m.isEmptyObject(a[b]))&&...
function Q (line 4) | function Q(a,b,d,e){if(m.acceptData(a)){var f,g,h=m.expando,i=a.nodeType...
function R (line 4) | function R(a,b,c){if(m.acceptData(a)){var d,e,f=a.nodeType,g=f?m.cache:a...
function aa (line 4) | function aa(){return!0}
function ba (line 4) | function ba(){return!1}
function ca (line 4) | function ca(){try{return y.activeElement}catch(a){}}
function da (line 4) | function da(a){var b=ea.split("|"),c=a.createDocumentFragment();if(c.cre...
function ua (line 4) | function ua(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==K?a.getEl...
function va (line 4) | function va(a){W.test(a.type)&&(a.defaultChecked=a.checked)}
function wa (line 4) | function wa(a,b){return m.nodeName(a,"table")&&m.nodeName(11!==b.nodeTyp...
function xa (line 4) | function xa(a){return a.type=(null!==m.find.attr(a,"type"))+"/"+a.type,a}
function ya (line 4) | function ya(a){var b=pa.exec(a.type);return b?a.type=b[1]:a.removeAttrib...
function za (line 4) | function za(a,b){for(var c,d=0;null!=(c=a[d]);d++)m._data(c,"globalEval"...
function Aa (line 4) | function Aa(a,b){if(1===b.nodeType&&m.hasData(a)){var c,d,e,f=m._data(a)...
function Ba (line 4) | function Ba(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCas...
function Ea (line 4) | function Ea(b,c){var d,e=m(c.createElement(b)).appendTo(c.body),f=a.getD...
function Fa (line 4) | function Fa(a){var b=y,c=Da[a];return c||(c=Ea(a,b),"none"!==c&&c||(Ca=(...
function La (line 4) | function La(a,b){return{get:function(){var c=a();if(null!=c)return c?voi...
function i (line 4) | function i(){var b,c,d,i;c=y.getElementsByTagName("body")[0],c&&c.style&...
function Ua (line 4) | function Ua(a,b){if(b in a)return b;var c=b.charAt(0).toUpperCase()+b.sl...
function Va (line 4) | function Va(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.styl...
function Wa (line 4) | function Wa(a,b,c){var d=Pa.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[...
function Xa (line 4) | function Xa(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===...
function Ya (line 4) | function Ya(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f...
function Za (line 4) | function Za(a,b,c,d,e){
function fb (line 5) | function fb(){return setTimeout(function(){$a=void 0}),$a=m.now()}
function gb (line 5) | function gb(a,b){var c,d={height:a},e=0;for(b=b?1:0;4>e;e+=2-b)c=T[e],d[...
function hb (line 5) | function hb(a,b,c){for(var d,e=(eb[b]||[]).concat(eb["*"]),f=0,g=e.lengt...
function ib (line 5) | function ib(a,b,c){var d,e,f,g,h,i,j,l,n=this,o={},p=a.style,q=a.nodeTyp...
function jb (line 5) | function jb(a,b){var c,d,e,f,g;for(c in a)if(d=m.camelCase(c),e=b[d],f=a...
function kb (line 5) | function kb(a,b,c){var d,e,f=0,g=db.length,h=m.Deferred().always(functio...
function Lb (line 5) | function Lb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var ...
function Mb (line 5) | function Mb(a,b,c,d){var e={},f=a===Ib;function g(h){var i;return e[h]=!...
function Nb (line 5) | function Nb(a,b){var c,d,e=m.ajaxSettings.flatOptions||{};for(d in b)voi...
function Ob (line 5) | function Ob(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[...
function Pb (line 5) | function Pb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])fo...
function x (line 5) | function x(a,b,c,d){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),i=v...
function Vb (line 5) | function Vb(a,b,c,d){var e;if(m.isArray(b))m.each(b,function(b,e){c||Rb....
function Zb (line 5) | function Zb(){try{return new a.XMLHttpRequest}catch(b){}}
function $b (line 5) | function $b(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(...
function dc (line 5) | function dc(a){return m.isWindow(a)?a:9===a.nodeType?a.defaultView||a.pa...
FILE: lib/werkzeug/debug/tbtools.py
function render_console_html (line 159) | def render_console_html(secret, evalex_trusted=True):
function get_current_traceback (line 170) | def get_current_traceback(ignore_system_exceptions=False,
class Line (line 190) | class Line(object):
method __init__ (line 194) | def __init__(self, lineno, code):
method classes (line 200) | def classes(self):
method render (line 209) | def render(self):
class Traceback (line 217) | class Traceback(object):
method __init__ (line 220) | def __init__(self, exc_type, exc_value, tb):
method filter_hidden_frames (line 238) | def filter_hidden_frames(self):
method is_syntax_error (line 273) | def is_syntax_error(self):
method exception (line 278) | def exception(self):
method log (line 285) | def log(self, logfile=None):
method paste (line 294) | def paste(self):
method render_summary (line 317) | def render_summary(self, include_title=True):
method render_full (line 349) | def render_full(self, evalex=False, secret=None,
method generate_plaintext_traceback (line 367) | def generate_plaintext_traceback(self):
method plaintext (line 379) | def plaintext(self):
class Frame (line 386) | class Frame(object):
method __init__ (line 390) | def __init__(self, exc_type, exc_value, tb):
method render (line 417) | def render(self):
method render_line_context (line 427) | def render_line_context(self):
method get_annotated_lines (line 447) | def get_annotated_lines(self):
method eval (line 474) | def eval(self, code, mode='single'):
method sourcelines (line 483) | def sourcelines(self):
method get_context_lines (line 536) | def get_context_lines(self, context=5):
method current_line (line 546) | def current_line(self):
method console (line 553) | def console(self):
FILE: lib/werkzeug/exceptions.py
class HTTPException (line 75) | class HTTPException(Exception):
method __init__ (line 86) | def __init__(self, description=None, response=None):
method wrap (line 93) | def wrap(cls, exception, name=None):
method name (line 107) | def name(self):
method get_description (line 111) | def get_description(self, environ=None):
method get_body (line 115) | def get_body(self, environ=None):
method get_headers (line 128) | def get_headers(self, environ=None):
method get_response (line 132) | def get_response(self, environ=None):
method __call__ (line 148) | def __call__(self, environ, start_response):
method __str__ (line 158) | def __str__(self):
method __repr__ (line 161) | def __repr__(self):
class BadRequest (line 165) | class BadRequest(HTTPException):
class ClientDisconnected (line 179) | class ClientDisconnected(BadRequest):
class SecurityError (line 195) | class SecurityError(BadRequest):
class Unauthorized (line 204) | class Unauthorized(HTTPException):
class Forbidden (line 220) | class Forbidden(HTTPException):
class NotFound (line 234) | class NotFound(HTTPException):
class MethodNotAllowed (line 248) | class MethodNotAllowed(HTTPException):
method __init__ (line 262) | def __init__(self, valid_methods=None, description=None):
method get_headers (line 268) | def get_headers(self, environ):
class NotAcceptable (line 275) | class NotAcceptable(HTTPException):
class RequestTimeout (line 292) | class RequestTimeout(HTTPException):
class Conflict (line 305) | class Conflict(HTTPException):
class Gone (line 321) | class Gone(HTTPException):
class LengthRequired (line 335) | class LengthRequired(HTTPException):
class PreconditionFailed (line 349) | class PreconditionFailed(HTTPException):
class RequestEntityTooLarge (line 363) | class RequestEntityTooLarge(HTTPException):
class RequestURITooLarge (line 376) | class RequestURITooLarge(HTTPException):
class UnsupportedMediaType (line 389) | class UnsupportedMediaType(HTTPException):
class RequestedRangeNotSatisfiable (line 403) | class RequestedRangeNotSatisfiable(HTTPException):
class ExpectationFailed (line 418) | class ExpectationFailed(HTTPException):
class ImATeapot (line 432) | class ImATeapot(HTTPException):
class UnprocessableEntity (line 447) | class UnprocessableEntity(HTTPException):
class PreconditionRequired (line 461) | class PreconditionRequired(HTTPException):
class TooManyRequests (line 480) | class TooManyRequests(HTTPException):
class RequestHeaderFieldsTooLarge (line 496) | class RequestHeaderFieldsTooLarge(HTTPException):
class InternalServerError (line 510) | class InternalServerError(HTTPException):
class NotImplemented (line 525) | class NotImplemented(HTTPException):
class BadGateway (line 539) | class BadGateway(HTTPException):
class ServiceUnavailable (line 554) | class ServiceUnavailable(HTTPException):
class GatewayTimeout (line 568) | class GatewayTimeout(HTTPException):
class HTTPVersionNotSupported (line 581) | class HTTPVersionNotSupported(HTTPException):
function _find_exceptions (line 598) | def _find_exceptions():
class Aborter (line 615) | class Aborter(object):
method __init__ (line 626) | def __init__(self, mapping=None, extra=None):
method __call__ (line 633) | def __call__(self, code, *args, **kwargs):
FILE: lib/werkzeug/filesystem.py
function _is_ascii_encoding (line 21) | def _is_ascii_encoding(encoding):
class BrokenFilesystemWarning (line 35) | class BrokenFilesystemWarning(RuntimeWarning, UnicodeWarning):
function get_filesystem_encoding (line 43) | def get_filesystem_encoding():
FILE: lib/werkzeug/formparser.py
function default_stream_factory (line 38) | def default_stream_factory(total_content_length, filename, content_type,
function parse_form_data (line 46) | def parse_form_data(environ, stream_factory=None, charset='utf-8',
function exhaust_stream (line 95) | def exhaust_stream(f):
class FormDataParser (line 113) | class FormDataParser(object):
method __init__ (line 142) | def __init__(self, stream_factory=None, charset='utf-8',
method get_parse_func (line 158) | def get_parse_func(self, mimetype, options):
method parse_from_environ (line 161) | def parse_from_environ(self, environ):
method parse (line 173) | def parse(self, stream, mimetype, content_length, options=None):
method _parse_multipart (line 203) | def _parse_multipart(self, stream, mimetype, content_length, options):
method _parse_urlencoded (line 216) | def _parse_urlencoded(self, stream, mimetype, content_length, options):
function is_valid_multipart_boundary (line 233) | def is_valid_multipart_boundary(boundary):
function _line_parse (line 238) | def _line_parse(line):
function parse_multipart_headers (line 249) | def parse_multipart_headers(iterable):
class MultiPartParser (line 285) | class MultiPartParser(object):
method __init__ (line 287) | def __init__(self, stream_factory=None, charset='utf-8', errors='repla...
method _fix_ie_filename (line 308) | def _fix_ie_filename(self, filename):
method _find_terminator (line 317) | def _find_terminator(self, iterator):
method fail (line 330) | def fail(self, message):
method get_part_encoding (line 333) | def get_part_encoding(self, headers):
method get_part_charset (line 339) | def get_part_charset(self, headers):
method start_file_streaming (line 347) | def start_file_streaming(self, filename, headers, total_content_length):
method in_memory_threshold_reached (line 360) | def in_memory_threshold_reached(self, bytes):
method validate_boundary (line 363) | def validate_boundary(self, boundary):
method parse_lines (line 375) | def parse_lines(self, file, boundary, content_length):
method parse_parts (line 473) | def parse_parts(self, file, boundary, content_length):
method parse (line 517) | def parse(self, file, boundary, content_length):
FILE: lib/werkzeug/http.py
function wsgi_to_bytes (line 139) | def wsgi_to_bytes(data):
function bytes_to_wsgi (line 148) | def bytes_to_wsgi(data):
function quote_header_value (line 156) | def quote_header_value(value, extra_chars='', allow_token=True):
function unquote_header_value (line 176) | def unquote_header_value(value, is_filename=False):
function dump_options_header (line 202) | def dump_options_header(header, options):
function dump_header (line 219) | def dump_header(iterable, allow_token=True):
function parse_list_header (line 250) | def parse_list_header(value):
function parse_dict_header (line 280) | def parse_dict_header(value, cls=dict):
function parse_options_header (line 321) | def parse_options_header(value, multiple=False):
function parse_accept_header (line 374) | def parse_accept_header(value, cls=None):
function parse_cache_control_header (line 407) | def parse_cache_control_header(value, on_update=None, cls=None):
function parse_set_header (line 431) | def parse_set_header(value, on_update=None):
function parse_authorization_header (line 461) | def parse_authorization_header(value):
function parse_www_authenticate_header (line 496) | def parse_www_authenticate_header(value, on_update=None):
function parse_if_range_header (line 517) | def parse_if_range_header(value):
function parse_range_header (line 532) | def parse_range_header(value, make_inclusive=True):
function parse_content_range_header (line 575) | def parse_content_range_header(value, on_update=None):
function quote_etag (line 620) | def quote_etag(etag, weak=False):
function unquote_etag (line 634) | def unquote_etag(etag):
function parse_etags (line 657) | def parse_etags(value):
function generate_etag (line 686) | def generate_etag(data):
function parse_date (line 691) | def parse_date(value):
function _dump_date (line 724) | def _dump_date(d, delim):
function cookie_date (line 741) | def cookie_date(expires=None):
function http_date (line 756) | def http_date(timestamp=None):
function is_resource_modified (line 770) | def is_resource_modified(environ, etag=None, data=None, last_modified=No...
function remove_entity_headers (line 808) | def remove_entity_headers(headers, allowed=('expires', 'content-location...
function remove_hop_by_hop_headers (line 826) | def remove_hop_by_hop_headers(headers):
function is_entity_header (line 838) | def is_entity_header(header):
function is_hop_by_hop_header (line 849) | def is_hop_by_hop_header(header):
function parse_cookie (line 860) | def parse_cookie(header, charset='utf-8', errors='replace', cls=None):
function dump_cookie (line 903) | def dump_cookie(key, value='', max_age=None, expires=None, path='/',
function is_byte_range_valid (line 992) | def is_byte_range_valid(start, stop, length):
FILE: lib/werkzeug/local.py
function release_local (line 27) | def release_local(local):
class Local (line 50) | class Local(object):
method __init__ (line 53) | def __init__(self):
method __iter__ (line 57) | def __iter__(self):
method __call__ (line 60) | def __call__(self, proxy):
method __release_local__ (line 64) | def __release_local__(self):
method __getattr__ (line 67) | def __getattr__(self, name):
method __setattr__ (line 73) | def __setattr__(self, name, value):
method __delattr__ (line 81) | def __delattr__(self, name):
class LocalStack (line 88) | class LocalStack(object):
method __init__ (line 116) | def __init__(self):
method __release_local__ (line 119) | def __release_local__(self):
method _get__ident_func__ (line 122) | def _get__ident_func__(self):
method _set__ident_func__ (line 125) | def _set__ident_func__(self, value):
method __call__ (line 130) | def __call__(self):
method push (line 138) | def push(self, obj):
method pop (line 146) | def pop(self):
method top (line 160) | def top(self):
class LocalManager (line 170) | class LocalManager(object):
method __init__ (line 188) | def __init__(self, locals=None, ident_func=None):
method get_ident (line 202) | def get_ident(self):
method cleanup (line 215) | def cleanup(self):
method make_middleware (line 222) | def make_middleware(self, app):
method middleware (line 230) | def middleware(self, func):
method __repr__ (line 245) | def __repr__(self):
class LocalProxy (line 253) | class LocalProxy(object):
method __init__ (line 291) | def __init__(self, local, name=None):
method _get_current_object (line 295) | def _get_current_object(self):
method __dict__ (line 308) | def __dict__(self):
method __repr__ (line 314) | def __repr__(self):
method __bool__ (line 321) | def __bool__(self):
method __unicode__ (line 327) | def __unicode__(self):
method __dir__ (line 333) | def __dir__(self):
method __getattr__ (line 339) | def __getattr__(self, name):
method __setitem__ (line 344) | def __setitem__(self, key, value):
method __delitem__ (line 347) | def __delitem__(self, key):
method __setslice__ (line 353) | def __setslice__(self, i, j, seq):
method __delslice__ (line 356) | def __delslice__(self, i, j):
FILE: lib/werkzeug/posixemulation.py
function _rename (line 42) | def _rename(src, dst):
function _rename_atomic (line 64) | def _rename_atomic(src, dst):
function rename (line 87) | def rename(src, dst):
FILE: lib/werkzeug/routing.py
function _pythonize (line 148) | def _pythonize(value):
function parse_converter_args (line 161) | def parse_converter_args(argstr):
function parse_rule (line 180) | def parse_rule(rule):
class RoutingException (line 212) | class RoutingException(Exception):
class RequestRedirect (line 221) | class RequestRedirect(HTTPException, RoutingException):
method __init__ (line 230) | def __init__(self, new_url):
method get_response (line 234) | def get_response(self, environ):
class RequestSlash (line 238) | class RequestSlash(RoutingException):
class RequestAliasRedirect (line 243) | class RequestAliasRedirect(RoutingException):
method __init__ (line 247) | def __init__(self, matched_values):
class BuildError (line 251) | class BuildError(RoutingException, LookupError):
method __init__ (line 257) | def __init__(self, endpoint, values, method, adapter=None):
method closest_rule (line 264) | def closest_rule(self, adapter):
method __str__ (line 279) | def __str__(self):
class ValidationError (line 308) | class ValidationError(ValueError):
class RuleFactory (line 315) | class RuleFactory(object):
method get_rules (line 322) | def get_rules(self, map):
class Subdomain (line 328) | class Subdomain(RuleFactory):
method __init__ (line 348) | def __init__(self, subdomain, rules):
method get_rules (line 352) | def get_rules(self, map):
class Submount (line 360) | class Submount(RuleFactory):
method __init__ (line 375) | def __init__(self, path, rules):
method get_rules (line 379) | def get_rules(self, map):
class EndpointPrefix (line 387) | class EndpointPrefix(RuleFactory):
method __init__ (line 401) | def __init__(self, prefix, rules):
method get_rules (line 405) | def get_rules(self, map):
class RuleTemplate (line 413) | class RuleTemplate(object):
method __init__ (line 433) | def __init__(self, rules):
method __call__ (line 436) | def __call__(self, *args, **kwargs):
class RuleTemplateFactory (line 440) | class RuleTemplateFactory(RuleFactory):
method __init__ (line 448) | def __init__(self, rules, context):
method get_rules (line 452) | def get_rules(self, map):
class Rule (line 479) | class Rule(RuleFactory):
method __init__ (line 594) | def __init__(self, string, defaults=None, subdomain=None, methods=None,
method empty (line 624) | def empty(self):
method get_empty_kwargs (line 634) | def get_empty_kwargs(self):
method get_rules (line 655) | def get_rules(self, map):
method refresh (line 658) | def refresh(self):
method bind (line 666) | def bind(self, map, rebind=False):
method get_converter (line 682) | def get_converter(self, variable_name, converter_name, args, kwargs):
method compile (line 691) | def compile(self):
method match (line 743) | def match(self, path):
method build (line 785) | def build(self, values, append_unknown=True):
method provides_defaults_for (line 818) | def provides_defaults_for(self, rule):
method suitable_for (line 827) | def suitable_for(self, values, method=None):
method match_compare_key (line 855) | def match_compare_key(self):
method build_compare_key (line 871) | def build_compare_key(self):
method __eq__ (line 879) | def __eq__(self, other):
method __ne__ (line 883) | def __ne__(self, other):
method __str__ (line 886) | def __str__(self):
method __repr__ (line 890) | def __repr__(self):
class BaseConverter (line 909) | class BaseConverter(object):
method __init__ (line 915) | def __init__(self, map):
method to_python (line 918) | def to_python(self, value):
method to_url (line 921) | def to_url(self, value):
class UnicodeConverter (line 925) | class UnicodeConverter(BaseConverter):
method __init__ (line 944) | def __init__(self, map, minlength=1, maxlength=None, length=None):
class AnyConverter (line 960) | class AnyConverter(BaseConverter):
method __init__ (line 972) | def __init__(self, map, *items):
class PathConverter (line 977) | class PathConverter(BaseConverter):
class NumberConverter (line 991) | class NumberConverter(BaseConverter):
method __init__ (line 999) | def __init__(self, map, fixed_digits=0, min=None, max=None):
method to_python (line 1005) | def to_python(self, value):
method to_url (line 1014) | def to_url(self, value):
class IntegerConverter (line 1021) | class IntegerConverter(NumberConverter):
class FloatConverter (line 1041) | class FloatConverter(NumberConverter):
method __init__ (line 1056) | def __init__(self, map, min=None, max=None):
class UUIDConverter (line 1060) | class UUIDConverter(BaseConverter):
method to_python (line 1073) | def to_python(self, value):
method to_url (line 1076) | def to_url(self, value):
class Map (line 1092) | class Map(object):
method __init__ (line 1131) | def __init__(self, rules=None, default_subdomain='', charset='utf-8',
method is_endpoint_expecting (line 1157) | def is_endpoint_expecting(self, endpoint, *arguments):
method iter_rules (line 1177) | def iter_rules(self, endpoint=None):
method add (line 1189) | def add(self, rulefactory):
method bind (line 1201) | def bind(self, server_name, script_name=None, subdomain=None,
method bind_to_environ (line 1239) | def bind_to_environ(self, environ, server_name=None, subdomain=None):
method update (line 1325) | def update(self):
method __repr__ (line 1341) | def __repr__(self):
class MapAdapter (line 1346) | class MapAdapter(object):
method __init__ (line 1352) | def __init__(self, map, server_name, script_name, subdomain,
method dispatch (line 1366) | def dispatch(self, view_func, path_info=None, method=None,
method match (line 1421) | def match(self, path_info=None, method=None, return_rule=False,
method test (line 1561) | def test(self, path_info=None, method=None):
method allowed_methods (line 1578) | def allowed_methods(self, path_info=None):
method get_host (line 1591) | def get_host(self, domain_part):
method get_default_redirect (line 1607) | def get_default_redirect(self, rule, method, values, query_args):
method encode_query_args (line 1627) | def encode_query_args(self, query_args):
method make_redirect_url (line 1632) | def make_redirect_url(self, path_info, query_args=None, domain_part=No...
method make_alias_redirect_url (line 1648) | def make_alias_redirect_url(self, path, endpoint, values, method, quer...
method _partial_build (line 1658) | def _partial_build(self, endpoint, values, method, append_unknown):
method build (line 1679) | def build(self, endpoint, values=None, method=None, force_external=False,
FILE: lib/werkzeug/script.py
function run (line 98) | def run(namespace=None, action_prefix='action_', args=None):
function fail (line 180) | def fail(message, code=-1):
function find_actions (line 186) | def find_actions(namespace, action_prefix):
function print_usage (line 195) | def print_usage(actions):
function analyse_action (line 221) | def analyse_action(func):
function make_shell (line 247) | def make_shell(init_func=None, banner=None, use_ipython=True):
function make_runserver (line 284) | def make_runserver(app_factory, hostname='localhost', port=5000,
FILE: lib/werkzeug/security.py
function _find_hashlib_algorithms (line 36) | def _find_hashlib_algorithms():
function pbkdf2_hex (line 49) | def pbkdf2_hex(data, salt, iterations=DEFAULT_PBKDF2_ITERATIONS,
function pbkdf2_bin (line 71) | def pbkdf2_bin(data, salt, iterations=DEFAULT_PBKDF2_ITERATIONS,
function safe_str_cmp (line 124) | def safe_str_cmp(a, b):
function gen_salt (line 154) | def gen_salt(length):
function _hash_internal (line 161) | def _hash_internal(method, salt, password):
function generate_password_hash (line 204) | def generate_password_hash(password, method='pbkdf2:sha1', salt_length=8):
function check_password_hash (line 234) | def check_password_hash(pwhash, password):
function safe_join (line 251) | def safe_join(directory, filename):
FILE: lib/werkzeug/serving.py
class _SslDummy (line 48) | class _SslDummy(object):
method __getattr__ (line 49) | def __getattr__(self, name):
function _get_openssl_crypto_module (line 54) | def _get_openssl_crypto_module():
class WSGIRequestHandler (line 82) | class WSGIRequestHandler(BaseHTTPRequestHandler, object):
method server_version (line 87) | def server_version(self):
method make_environ (line 90) | def make_environ(self):
method run_wsgi (line 132) | def run_wsgi(self):
method handle (line 211) | def handle(self):
method initiate_shutdown (line 225) | def initiate_shutdown(self):
method connection_dropped (line 239) | def connection_dropped(self, error, environ=None):
method handle_one_request (line 244) | def handle_one_request(self):
method send_response (line 252) | def send_response(self, code, message=None):
method version_string (line 261) | def version_string(self):
method address_string (line 264) | def address_string(self):
method log_request (line 267) | def log_request(self, code='-', size='-'):
method log_error (line 270) | def log_error(self, *args):
method log_message (line 273) | def log_message(self, format, *args):
method log (line 276) | def log(self, type, message, *args):
function generate_adhoc_ssl_pair (line 286) | def generate_adhoc_ssl_pair(cn=None):
function make_ssl_devcert (line 315) | def make_ssl_devcert(base_path, host=None, cn=None):
function generate_adhoc_ssl_context (line 349) | def generate_adhoc_ssl_context():
function load_ssl_context (line 369) | def load_ssl_context(cert_file, pkey_file=None, protocol=None):
class _SSLContext (line 387) | class _SSLContext(object):
method __init__ (line 392) | def __init__(self, protocol):
method load_cert_chain (line 398) | def load_cert_chain(self, certfile, keyfile=None, password=None):
method wrap_socket (line 403) | def wrap_socket(self, sock, **kwargs):
function is_ssl_error (line 409) | def is_ssl_error(error=None):
function select_ip_version (line 423) | def select_ip_version(host, port):
class BaseWSGIServer (line 442) | class BaseWSGIServer(HTTPServer, object):
method __init__ (line 449) | def __init__(self, host, port, app, handler=None,
method log (line 484) | def log(self, type, message, *args):
method serve_forever (line 487) | def serve_forever(self):
method handle_error (line 504) | def handle_error(self, request, client_address):
method get_request (line 510) | def get_request(self):
class ThreadedWSGIServer (line 515) | class ThreadedWSGIServer(ThreadingMixIn, BaseWSGIServer):
class ForkingWSGIServer (line 521) | class ForkingWSGIServer(ForkingMixIn, BaseWSGIServer):
method __init__ (line 526) | def __init__(self, host, port, app, processes=40, handler=None,
function make_server (line 533) | def make_server(host=None, port=None, app=None, threaded=False, processe...
function is_running_from_reloader (line 553) | def is_running_from_reloader():
function run_simple (line 562) | def run_simple(hostname, port, application, use_reloader=False,
function run_with_reloader (line 683) | def run_with_reloader(*args, **kwargs):
function main (line 690) | def main():
FILE: lib/werkzeug/test.py
function stream_encode_multipart (line 41) | def stream_encode_multipart(values, use_tempfile=True, threshold=1024 * ...
function encode_multipart (line 114) | def encode_multipart(values, boundary=None, charset='utf-8'):
function File (line 123) | def File(fd, filename=None, mimetype=None):
class _TestCookieHeaders (line 131) | class _TestCookieHeaders(object):
method __init__ (line 136) | def __init__(self, headers):
method getheaders (line 139) | def getheaders(self, name):
method get_all (line 147) | def get_all(self, name, default=None):
class _TestCookieResponse (line 155) | class _TestCookieResponse(object):
method __init__ (line 161) | def __init__(self, headers):
method info (line 164) | def info(self):
class _TestCookieJar (line 168) | class _TestCookieJar(CookieJar):
method inject_wsgi (line 174) | def inject_wsgi(self, environ):
method extract_wsgi (line 184) | def extract_wsgi(self, environ, headers):
function _iter_data (line 194) | def _iter_data(data):
class EnvironBuilder (line 212) | class EnvironBuilder(object):
method __init__ (line 284) | def __init__(self, path='/', base_url=None, query_string=None,
method _add_file_from_data (line 342) | def _add_file_from_data(self, key, value):
method _get_base_url (line 359) | def _get_base_url(self):
method _set_base_url (line 363) | def _set_base_url(self, value):
method _get_content_type (line 383) | def _get_content_type(self):
method _set_content_type (line 393) | def _set_content_type(self, value):
method _get_content_length (line 405) | def _get_content_length(self):
method _set_content_length (line 408) | def _set_content_length(self, value):
method form_property (line 420) | def form_property(name, storage, doc):
method _get_input_stream (line 446) | def _get_input_stream(self):
method _set_input_stream (line 449) | def _set_input_stream(self, value):
method _get_query_string (line 458) | def _get_query_string(self):
method _set_query_string (line 465) | def _set_query_string(self, value):
method _get_args (line 474) | def _get_args(self):
method _set_args (line 481) | def _set_args(self, value):
method server_name (line 490) | def server_name(self):
method server_port (line 495) | def server_port(self):
method __del__ (line 504) | def __del__(self):
method close (line 510) | def close(self):
method get_environ (line 528) | def get_environ(self):
method get_request (line 588) | def get_request(self, cls=None):
class ClientRedirectError (line 599) | class ClientRedirectError(Exception):
class Client (line 607) | class Client(object):
method __init__ (line 635) | def __init__(self, application, response_wrapper=None, use_cookies=True,
method set_cookie (line 645) | def set_cookie(self, server_name, key, value='', max_age=None,
method delete_cookie (line 659) | def delete_cookie(self, server_name, key, path='/', domain=None):
method run_wsgi_app (line 664) | def run_wsgi_app(self, environ, buffered=False):
method resolve_redirect (line 673) | def resolve_redirect(self, response, new_location, environ, buffered=F...
method open (line 710) | def open(self, *args, **kwargs):
method get (line 775) | def get(self, *args, **kw):
method patch (line 780) | def patch(self, *args, **kw):
method post (line 785) | def post(self, *args, **kw):
method head (line 790) | def head(self, *args, **kw):
method put (line 795) | def put(self, *args, **kw):
method delete (line 800) | def delete(self, *args, **kw):
method options (line 805) | def options(self, *args, **kw):
method trace (line 810) | def trace(self, *args, **kw):
method __repr__ (line 815) | def __repr__(self):
function create_environ (line 822) | def create_environ(*args, **kwargs):
function run_wsgi_app (line 844) | def run_wsgi_app(app, environ, buffered=False):
FILE: lib/werkzeug/testapp.py
function iter_sys_path (line 136) | def iter_sys_path():
function render_testapp (line 153) | def render_testapp(req):
function test_app (line 206) | def test_app(environ, start_response):
FILE: lib/werkzeug/urls.py
class BaseURL (line 47) | class BaseURL(_URLTuple):
method replace (line 52) | def replace(self, **kwargs):
method host (line 58) | def host(self):
method ascii_host (line 66) | def ascii_host(self):
method port (line 78) | def port(self):
method auth (line 90) | def auth(self):
method username (line 97) | def username(self):
method raw_username (line 106) | def raw_username(self):
method password (line 113) | def password(self):
method raw_password (line 122) | def raw_password(self):
method decode_query (line 128) | def decode_query(self, *args, **kwargs):
method join (line 135) | def join(self, *args, **kwargs):
method to_url (line 142) | def to_url(self):
method decode_netloc (line 149) | def decode_netloc(self):
method to_uri_tuple (line 166) | def to_uri_tuple(self):
method to_iri_tuple (line 176) | def to_iri_tuple(self):
method get_file_location (line 187) | def get_file_location(self, pathformat=None):
method _split_netloc (line 245) | def _split_netloc(self):
method _split_auth (line 250) | def _split_auth(self):
method _split_host (line 258) | def _split_host(self):
class URL (line 280) | class URL(BaseURL):
method __str__ (line 292) | def __str__(self):
method encode_netloc (line 295) | def encode_netloc(self):
method encode (line 311) | def encode(self, charset='utf-8', errors='replace'):
class BytesURL (line 324) | class BytesURL(BaseURL):
method __str__ (line 333) | def __str__(self):
method encode_netloc (line 336) | def encode_netloc(self):
method decode (line 340) | def decode(self, charset='utf-8', errors='replace'):
function _unquote_to_bytes (line 353) | def _unquote_to_bytes(string, unsafe=''):
function _url_encode_impl (line 374) | def _url_encode_impl(obj, charset, encode_keys, sort, key):
function _url_unquote_legacy (line 388) | def _url_unquote_legacy(value, unsafe=''):
function url_parse (line 396) | def url_parse(url, scheme=None, allow_fragments=True):
function url_quote (line 444) | def url_quote(string, charset='utf-8', errors='strict', safe='/:', unsaf...
function url_quote_plus (line 473) | def url_quote_plus(string, charset='utf-8', errors='strict', safe=''):
function url_unparse (line 484) | def url_unparse(components):
function url_unquote (line 515) | def url_unquote(string, charset='utf-8', errors='replace', unsafe=''):
function url_unquote_plus (line 531) | def url_unquote_plus(s, charset='utf-8', errors='replace'):
function url_fix (line 551) | def url_fix(s, charset='utf-8'):
function uri_to_iri (line 582) | def uri_to_iri(uri, charset='utf-8', errors='replace'):
function iri_to_uri (line 614) | def iri_to_uri(iri, charset='utf-8', errors='strict', safe_conversion=Fa...
function url_decode (line 679) | def url_decode(s, charset='utf-8', decode_keys=False, include_empty=True,
function url_decode_stream (line 729) | def url_decode_stream(stream, charset='utf-8', decode_keys=False,
function _url_decode_impl (line 769) | def _url_decode_impl(pair_iter, charset, decode_keys, include_empty, err...
function url_encode (line 788) | def url_encode(obj, charset='utf-8', encode_keys=False, sort=False, key=...
function url_encode_stream (line 814) | def url_encode_stream(obj, stream=None, charset='utf-8', encode_keys=False,
function url_join (line 844) | def url_join(base, url, allow_fragments=True):
class Href (line 912) | class Href(object):
method __init__ (line 964) | def __init__(self, base='./', charset='utf-8', sort=False, key=None):
method __getattr__ (line 972) | def __getattr__(self, name):
method __call__ (line 980) | def __call__(self, *path, **query):
FILE: lib/werkzeug/useragents.py
class UserAgentParser (line 17) | class UserAgentParser(object):
method __init__ (line 68) | def __init__(self):
method __call__ (line 73) | def __call__(self, user_agent):
class UserAgent (line 95) | class UserAgent(object):
method __init__ (line 164) | def __init__(self, environ_or_string):
method to_header (line 171) | def to_header(self):
method __str__ (line 174) | def __str__(self):
method __nonzero__ (line 177) | def __nonzero__(self):
method __repr__ (line 182) | def __repr__(self):
FILE: lib/werkzeug/utils.py
class cached_property (line 35) | class cached_property(property):
method __init__ (line 59) | def __init__(self, func, name=None, doc=None):
method __set__ (line 65) | def __set__(self, obj, value):
method __get__ (line 68) | def __get__(self, obj, type=None):
class environ_property (line 78) | class environ_property(_DictAccessorProperty):
method lookup (line 102) | def lookup(self, obj):
class header_property (line 106) | class header_property(_DictAccessorProperty):
method lookup (line 110) | def lookup(self, obj):
class HTMLBuilder (line 114) | class HTMLBuilder(object):
method __init__ (line 156) | def __init__(self, dialect):
method __call__ (line 159) | def __call__(self, s):
method __getattr__ (line 162) | def __getattr__(self, tag):
method __repr__ (line 204) | def __repr__(self):
function get_content_type (line 215) | def get_content_type(mimetype, charset):
function format_string (line 233) | def format_string(string, context):
function secure_filename (line 253) | def secure_filename(filename):
function escape (line 298) | def escape(s, quote=None):
function unescape (line 323) | def unescape(s):
function redirect (line 344) | def redirect(location, code=302, Response=None):
function append_slash_redirect (line 384) | def append_slash_redirect(environ, code=301):
function import_string (line 399) | def import_string(import_name, silent=False):
function find_modules (line 446) | def find_modules(import_path, include_packages=False, recursive=False):
function validate_arguments (line 478) | def validate_arguments(func, args, kwargs, drop_extra=True):
function bind_arguments (line 531) | def bind_arguments(func, args, kwargs):
class ArgumentValidationError (line 564) | class ArgumentValidationError(ValueError):
method __init__ (line 568) | def __init__(self, missing=None, extra=None, extra_positional=None):
class ImportStringError (line 579) | class ImportStringError(ImportError):
method __init__ (line 588) | def __init__(self, import_name, exception):
method __repr__ (line 618) | def __repr__(self):
FILE: lib/werkzeug/wrappers.py
function _run_wsgi_app (line 51) | def _run_wsgi_app(*args):
function _warn_if_string (line 60) | def _warn_if_string(iterable):
function _assert_not_shallow (line 73) | def _assert_not_shallow(request):
function _iter_encoded (line 80) | def _iter_encoded(iterable, charset):
class BaseRequest (line 88) | class BaseRequest(object):
method __init__ (line 210) | def __init__(self, environ, populate_request=True, shallow=False):
method __repr__ (line 216) | def __repr__(self):
method url_charset (line 233) | def url_charset(self):
method from_values (line 242) | def from_values(cls, *args, **kwargs):
method application (line 270) | def application(cls, f):
method _get_file_stream (line 294) | def _get_file_stream(self, total_content_length, content_type, filenam...
method want_form_data_parsed (line 319) | def want_form_data_parsed(self):
method make_form_data_parser (line 327) | def make_form_data_parser(self):
method _load_form_data (line 340) | def _load_form_data(self):
method _get_stream_for_parsing (line 371) | def _get_stream_for_parsing(self):
method close (line 383) | def close(self):
method __enter__ (line 394) | def __enter__(self):
method __exit__ (line 397) | def __exit__(self, exc_type, exc_value, tb):
method stream (line 401) | def stream(self):
method args (line 424) | def args(self):
method data (line 436) | def data(self):
method get_data (line 448) | def get_data(self, cache=True, as_text=False, parse_form_data=False):
method form (line 485) | def form(self):
method values (line 496) | def values(self):
method files (line 506) | def files(self):
method cookies (line 524) | def cookies(self):
method headers (line 531) | def headers(self):
method path (line 538) | def path(self):
method full_path (line 548) | def full_path(self):
method script_root (line 553) | def script_root(self):
method url (line 560) | def url(self):
method base_url (line 568) | def base_url(self):
method url_root (line 576) | def url_root(self):
method host_url (line 585) | def host_url(self):
method host (line 593) | def host(self):
method access_route (line 608) | def access_route(self):
method remote_addr (line 620) | def remote_addr(self):
class BaseResponse (line 654) | class BaseResponse(object):
method __init__ (line 756) | def __init__(self, response=None, status=None, headers=None,
method call_on_close (line 792) | def call_on_close(self, func):
method __repr__ (line 803) | def __repr__(self):
method fo
Condensed preview — 194 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (2,264K chars).
[
{
"path": ".gitignore",
"chars": 73,
"preview": "*.pyc\n# don't include third-party dependencies.\n!lib/README.md\n.DS_Store\n"
},
{
"path": ".playground",
"chars": 174,
"preview": "{\n \"template_name\" : \"Flask web framework\",\n \"template_description\" : \"Skeleton app based on Flask microframework (htt"
},
{
"path": "CONTRIB.md",
"chars": 3045,
"preview": "# How to become a contributor and submit your own code\n\n## Contributor License Agreements\n\nWe'd love to accept your samp"
},
{
"path": "LICENSE",
"chars": 11357,
"preview": " Apache License\n Version 2.0, January 2004\n "
},
{
"path": "README.md",
"chars": 3155,
"preview": "\n\nThis project is no longer actively developed "
},
{
"path": "app.yaml",
"chars": 1347,
"preview": "# This file specifies your Python application's runtime configuration\n# including URL routing, versions, static file upl"
},
{
"path": "appengine_config.py",
"chars": 370,
"preview": "\"\"\"\n`appengine_config.py` is automatically loaded when Google App Engine\nstarts a new instance of your application. This"
},
{
"path": "lib/Flask-0.10.dist-info/DESCRIPTION.rst",
"chars": 694,
"preview": "Flask\n-----\n\nFlask is a microframework for Python based on Werkzeug, Jinja 2 and good\nintentions. And before you ask: It"
},
{
"path": "lib/Flask-0.10.dist-info/METADATA",
"chars": 1557,
"preview": "Metadata-Version: 2.0\nName: Flask\nVersion: 0.10\nSummary: A microframework based on Werkzeug, Jinja2 and good intentions\n"
},
{
"path": "lib/Flask-0.10.dist-info/RECORD",
"chars": 10635,
"preview": "flask/__init__.py,sha256=Hmok7MXSW0QTF-6TCFPfRqpHlVq1zOihqSMnHfXysvo,1672\r\nflask/_compat.py,sha256=ug9fCmzhMFE1ecCpZLvbH"
},
{
"path": "lib/Flask-0.10.dist-info/WHEEL",
"chars": 92,
"preview": "Wheel-Version: 1.0\nGenerator: bdist_wheel (0.24.0)\nRoot-Is-Purelib: true\nTag: py2-none-any\n\n"
},
{
"path": "lib/Flask-0.10.dist-info/metadata.json",
"chars": 1011,
"preview": "{\"license\": \"BSD\", \"name\": \"Flask\", \"metadata_version\": \"2.0\", \"generator\": \"bdist_wheel (0.24.0)\", \"summary\": \"A microf"
},
{
"path": "lib/Flask-0.10.dist-info/top_level.txt",
"chars": 6,
"preview": "flask\n"
},
{
"path": "lib/Jinja2-2.8.dist-info/DESCRIPTION.rst",
"chars": 975,
"preview": "Jinja2\n~~~~~~\n\nJinja2 is a template engine written in pure Python. It provides a\n`Django`_ inspired non-XML syntax but "
},
{
"path": "lib/Jinja2-2.8.dist-info/METADATA",
"chars": 2061,
"preview": "Metadata-Version: 2.0\nName: Jinja2\nVersion: 2.8\nSummary: A small but fast and easy to use stand-alone template engine wr"
},
{
"path": "lib/Jinja2-2.8.dist-info/RECORD",
"chars": 2814,
"preview": "jinja2/__init__.py,sha256=c59bnaAFo63I7lYUZlO2UKHj8LPG3JACKnCrwWgvjGY,2326\r\njinja2/_compat.py,sha256=O4FnYOMi4HRBfoCKkX1"
},
{
"path": "lib/Jinja2-2.8.dist-info/WHEEL",
"chars": 110,
"preview": "Wheel-Version: 1.0\nGenerator: bdist_wheel (0.24.0)\nRoot-Is-Purelib: true\nTag: py2-none-any\nTag: py3-none-any\n\n"
},
{
"path": "lib/Jinja2-2.8.dist-info/entry_points.txt",
"chars": 72,
"preview": "\n [babel.extractors]\n jinja2 = jinja2.ext:babel_extract[i18n]\n "
},
{
"path": "lib/Jinja2-2.8.dist-info/metadata.json",
"chars": 1275,
"preview": "{\"license\": \"BSD\", \"name\": \"Jinja2\", \"metadata_version\": \"2.0\", \"generator\": \"bdist_wheel (0.24.0)\", \"summary\": \"A small"
},
{
"path": "lib/Jinja2-2.8.dist-info/top_level.txt",
"chars": 7,
"preview": "jinja2\n"
},
{
"path": "lib/MarkupSafe-0.23.dist-info/DESCRIPTION.rst",
"chars": 3091,
"preview": "MarkupSafe\n==========\n\nImplements a unicode subclass that supports HTML strings:\n\n>>> from markupsafe import Markup, esc"
},
{
"path": "lib/MarkupSafe-0.23.dist-info/METADATA",
"chars": 3879,
"preview": "Metadata-Version: 2.0\nName: MarkupSafe\nVersion: 0.23\nSummary: Implements a XML/HTML/XHTML Markup safe string for Python\n"
},
{
"path": "lib/MarkupSafe-0.23.dist-info/RECORD",
"chars": 1197,
"preview": "markupsafe/__init__.py,sha256=zFQpANILi3mCCALiPd6ZJdlW6ibu_hTKzikMXKXVtaM,10338\r\nmarkupsafe/_compat.py,sha256=r1HE0CpcAZ"
},
{
"path": "lib/MarkupSafe-0.23.dist-info/WHEEL",
"chars": 109,
"preview": "Wheel-Version: 1.0\nGenerator: bdist_wheel (0.24.0)\nRoot-Is-Purelib: false\nTag: cp27-none-macosx_10_10_intel\n\n"
},
{
"path": "lib/MarkupSafe-0.23.dist-info/metadata.json",
"chars": 901,
"preview": "{\"summary\": \"Implements a XML/HTML/XHTML Markup safe string for Python\", \"metadata_version\": \"2.0\", \"license\": \"BSD\", \"e"
},
{
"path": "lib/MarkupSafe-0.23.dist-info/top_level.txt",
"chars": 11,
"preview": "markupsafe\n"
},
{
"path": "lib/README.md",
"chars": 70,
"preview": "This directory contains third-party dependencies installed with `pip`."
},
{
"path": "lib/Werkzeug-0.11.dist-info/DESCRIPTION.rst",
"chars": 1595,
"preview": "Werkzeug\n========\n\nWerkzeug started as simple collection of various utilities for WSGI\napplications and has become one o"
},
{
"path": "lib/Werkzeug-0.11.dist-info/METADATA",
"chars": 2597,
"preview": "Metadata-Version: 2.0\nName: Werkzeug\nVersion: 0.11\nSummary: The Swiss Army knife of Python web development\nHome-page: ht"
},
{
"path": "lib/Werkzeug-0.11.dist-info/RECORD",
"chars": 5552,
"preview": "Werkzeug-0.11.dist-info/DESCRIPTION.rst,sha256=5sTwZ_Sj5aeEN8mlcOdNJ_ng40HiGazGmILLyTMX8o0,1595\r\nWerkzeug-0.11.dist-info"
},
{
"path": "lib/Werkzeug-0.11.dist-info/WHEEL",
"chars": 110,
"preview": "Wheel-Version: 1.0\nGenerator: bdist_wheel (0.26.0)\nRoot-Is-Purelib: true\nTag: py2-none-any\nTag: py3-none-any\n\n"
},
{
"path": "lib/Werkzeug-0.11.dist-info/metadata.json",
"chars": 1093,
"preview": "{\"generator\": \"bdist_wheel (0.26.0)\", \"summary\": \"The Swiss Army knife of Python web development\", \"classifiers\": [\"Deve"
},
{
"path": "lib/Werkzeug-0.11.dist-info/top_level.txt",
"chars": 9,
"preview": "werkzeug\n"
},
{
"path": "lib/flask/__init__.py",
"chars": 1672,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n flask\n ~~~~~\n\n A microframework based on Werkzeug. It's extensively documented\n "
},
{
"path": "lib/flask/_compat.py",
"chars": 2164,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n flask._compat\n ~~~~~~~~~~~~~\n\n Some py2/py3 compatibility support based on a strip"
},
{
"path": "lib/flask/app.py",
"chars": 76786,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n flask.app\n ~~~~~~~~~\n\n This module implements the central WSGI application object."
},
{
"path": "lib/flask/blueprints.py",
"chars": 16320,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n flask.blueprints\n ~~~~~~~~~~~~~~~~\n\n Blueprints are the recommended way to impleme"
},
{
"path": "lib/flask/config.py",
"chars": 6234,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n flask.config\n ~~~~~~~~~~~~\n\n Implements the configuration related objects.\n\n :c"
},
{
"path": "lib/flask/ctx.py",
"chars": 14266,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n flask.ctx\n ~~~~~~~~~\n\n Implements the objects required to keep the context.\n\n :"
},
{
"path": "lib/flask/debughelpers.py",
"chars": 3508,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n flask.debughelpers\n ~~~~~~~~~~~~~~~~~~\n\n Various helpers to make the development e"
},
{
"path": "lib/flask/ext/__init__.py",
"chars": 842,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n flask.ext\n ~~~~~~~~~\n\n Redirect imports for extensions. This module basically mak"
},
{
"path": "lib/flask/exthook.py",
"chars": 5087,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n flask.exthook\n ~~~~~~~~~~~~~\n\n Redirect imports for extensions. This module basic"
},
{
"path": "lib/flask/globals.py",
"chars": 1137,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n flask.globals\n ~~~~~~~~~~~~~\n\n Defines all the global objects that are proxies to "
},
{
"path": "lib/flask/helpers.py",
"chars": 33793,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n flask.helpers\n ~~~~~~~~~~~~~\n\n Implements various helpers.\n\n :copyright: (c) 20"
},
{
"path": "lib/flask/json.py",
"chars": 7530,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n flask.jsonimpl\n ~~~~~~~~~~~~~~\n\n Implementation helpers for the JSON support in Fl"
},
{
"path": "lib/flask/logging.py",
"chars": 1398,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n flask.logging\n ~~~~~~~~~~~~~\n\n Implements the logging support for Flask.\n\n :cop"
},
{
"path": "lib/flask/module.py",
"chars": 1363,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n flask.module\n ~~~~~~~~~~~~\n\n Implements a class that represents module blueprints."
},
{
"path": "lib/flask/sessions.py",
"chars": 12882,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n flask.sessions\n ~~~~~~~~~~~~~~\n\n Implements cookie based sessions based on itsdang"
},
{
"path": "lib/flask/signals.py",
"chars": 2140,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n flask.signals\n ~~~~~~~~~~~~~\n\n Implements signals based on blinker if available, o"
},
{
"path": "lib/flask/templating.py",
"chars": 4707,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n flask.templating\n ~~~~~~~~~~~~~~~~\n\n Implements the bridge to Jinja2.\n\n :copyri"
},
{
"path": "lib/flask/testing.py",
"chars": 5003,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n flask.testing\n ~~~~~~~~~~~~~\n\n Implements test support helpers. This module is la"
},
{
"path": "lib/flask/testsuite/__init__.py",
"chars": 7022,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n flask.testsuite\n ~~~~~~~~~~~~~~~\n\n Tests Flask itself. The majority of Flask is a"
},
{
"path": "lib/flask/testsuite/appctx.py",
"chars": 3116,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n flask.testsuite.appctx\n ~~~~~~~~~~~~~~~~~~~~~~\n\n Tests the application context.\n\n "
},
{
"path": "lib/flask/testsuite/basic.py",
"chars": 42743,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n flask.testsuite.basic\n ~~~~~~~~~~~~~~~~~~~~~\n\n The basic functionality.\n\n :copy"
},
{
"path": "lib/flask/testsuite/blueprints.py",
"chars": 28089,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n flask.testsuite.blueprints\n ~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n Blueprints (and currently"
},
{
"path": "lib/flask/testsuite/config.py",
"chars": 11820,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n flask.testsuite.config\n ~~~~~~~~~~~~~~~~~~~~~~\n\n Configuration and instances.\n\n "
},
{
"path": "lib/flask/testsuite/deprecations.py",
"chars": 511,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n flask.testsuite.deprecations\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n Tests deprecation sup"
},
{
"path": "lib/flask/testsuite/examples.py",
"chars": 942,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n flask.testsuite.examples\n ~~~~~~~~~~~~~~~~~~~~~~~~\n\n Tests the examples.\n\n :cop"
},
{
"path": "lib/flask/testsuite/ext.py",
"chars": 5156,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n flask.testsuite.ext\n ~~~~~~~~~~~~~~~~~~~\n\n Tests the extension import thing.\n\n "
},
{
"path": "lib/flask/testsuite/helpers.py",
"chars": 21637,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n flask.testsuite.helpers\n ~~~~~~~~~~~~~~~~~~~~~~~\n\n Various helpers.\n\n :copyrigh"
},
{
"path": "lib/flask/testsuite/regression.py",
"chars": 3198,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n flask.testsuite.regression\n ~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n Tests regressions.\n\n :"
},
{
"path": "lib/flask/testsuite/reqctx.py",
"chars": 5960,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n flask.testsuite.reqctx\n ~~~~~~~~~~~~~~~~~~~~~~\n\n Tests the request context.\n\n :"
},
{
"path": "lib/flask/testsuite/signals.py",
"chars": 4807,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n flask.testsuite.signals\n ~~~~~~~~~~~~~~~~~~~~~~~\n\n Signalling.\n\n :copyright: (c"
},
{
"path": "lib/flask/testsuite/static/index.html",
"chars": 22,
"preview": "<h1>Hello World!</h1>\n"
},
{
"path": "lib/flask/testsuite/subclassing.py",
"chars": 1214,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n flask.testsuite.subclassing\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n Test that certain behav"
},
{
"path": "lib/flask/testsuite/templates/_macro.html",
"chars": 55,
"preview": "{% macro hello(name) %}Hello {{ name }}!{% endmacro %}\n"
},
{
"path": "lib/flask/testsuite/templates/context_template.html",
"chars": 36,
"preview": "<p>{{ value }}|{{ injected_value }}\n"
},
{
"path": "lib/flask/testsuite/templates/escaping_template.html",
"chars": 147,
"preview": "{{ text }}\n{{ html }}\n{% autoescape false %}{{ text }}\n{{ html }}{% endautoescape %}\n{% autoescape true %}{{ text }}\n{{ "
},
{
"path": "lib/flask/testsuite/templates/mail.txt",
"chars": 14,
"preview": "{{ foo}} Mail\n"
},
{
"path": "lib/flask/testsuite/templates/nested/nested.txt",
"chars": 11,
"preview": "I'm nested\n"
},
{
"path": "lib/flask/testsuite/templates/simple_template.html",
"chars": 23,
"preview": "<h1>{{ whiskey }}</h1>\n"
},
{
"path": "lib/flask/testsuite/templates/template_filter.html",
"chars": 25,
"preview": "{{ value|super_reverse }}"
},
{
"path": "lib/flask/testsuite/templates/template_test.html",
"chars": 51,
"preview": "{% if value is boolean %}\n Success!\n{% endif %}\n"
},
{
"path": "lib/flask/testsuite/templating.py",
"chars": 11237,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n flask.testsuite.templating\n ~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n Template functionality\n\n "
},
{
"path": "lib/flask/testsuite/test_apps/blueprintapp/__init__.py",
"chars": 200,
"preview": "from flask import Flask\n\napp = Flask(__name__)\nfrom blueprintapp.apps.admin import admin\nfrom blueprintapp.apps.frontend"
},
{
"path": "lib/flask/testsuite/test_apps/blueprintapp/apps/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "lib/flask/testsuite/test_apps/blueprintapp/apps/admin/__init__.py",
"chars": 362,
"preview": "from flask import Blueprint, render_template\n\nadmin = Blueprint('admin', __name__, url_prefix='/admin',\n "
},
{
"path": "lib/flask/testsuite/test_apps/blueprintapp/apps/admin/static/css/test.css",
"chars": 18,
"preview": "/* nested file */\n"
},
{
"path": "lib/flask/testsuite/test_apps/blueprintapp/apps/admin/static/test.txt",
"chars": 11,
"preview": "Admin File\n"
},
{
"path": "lib/flask/testsuite/test_apps/blueprintapp/apps/admin/templates/admin/index.html",
"chars": 21,
"preview": "Hello from the Admin\n"
},
{
"path": "lib/flask/testsuite/test_apps/blueprintapp/apps/frontend/__init__.py",
"chars": 204,
"preview": "from flask import Blueprint, render_template\n\nfrontend = Blueprint('frontend', __name__, template_folder='templates')\n\n\n"
},
{
"path": "lib/flask/testsuite/test_apps/blueprintapp/apps/frontend/templates/frontend/index.html",
"chars": 24,
"preview": "Hello from the Frontend\n"
},
{
"path": "lib/flask/testsuite/test_apps/config_module_app.py",
"chars": 101,
"preview": "import os\nimport flask\nhere = os.path.abspath(os.path.dirname(__file__))\napp = flask.Flask(__name__)\n"
},
{
"path": "lib/flask/testsuite/test_apps/config_package_app/__init__.py",
"chars": 101,
"preview": "import os\nimport flask\nhere = os.path.abspath(os.path.dirname(__file__))\napp = flask.Flask(__name__)\n"
},
{
"path": "lib/flask/testsuite/test_apps/flask_broken/__init__.py",
"chars": 48,
"preview": "import flask.ext.broken.b\nimport missing_module\n"
},
{
"path": "lib/flask/testsuite/test_apps/flask_broken/b.py",
"chars": 0,
"preview": ""
},
{
"path": "lib/flask/testsuite/test_apps/flask_newext_package/__init__.py",
"chars": 26,
"preview": "ext_id = 'newext_package'\n"
},
{
"path": "lib/flask/testsuite/test_apps/flask_newext_package/submodule.py",
"chars": 35,
"preview": "def test_function():\n return 42\n"
},
{
"path": "lib/flask/testsuite/test_apps/flask_newext_simple.py",
"chars": 25,
"preview": "ext_id = 'newext_simple'\n"
},
{
"path": "lib/flask/testsuite/test_apps/flaskext/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "lib/flask/testsuite/test_apps/flaskext/oldext_package/__init__.py",
"chars": 26,
"preview": "ext_id = 'oldext_package'\n"
},
{
"path": "lib/flask/testsuite/test_apps/flaskext/oldext_package/submodule.py",
"chars": 35,
"preview": "def test_function():\n return 42\n"
},
{
"path": "lib/flask/testsuite/test_apps/flaskext/oldext_simple.py",
"chars": 25,
"preview": "ext_id = 'oldext_simple'\n"
},
{
"path": "lib/flask/testsuite/test_apps/importerror.py",
"chars": 46,
"preview": "# NoImportsTestCase\nraise NotImplementedError\n"
},
{
"path": "lib/flask/testsuite/test_apps/lib/python2.5/site-packages/site_app.py",
"chars": 42,
"preview": "import flask\n\napp = flask.Flask(__name__)\n"
},
{
"path": "lib/flask/testsuite/test_apps/lib/python2.5/site-packages/site_package/__init__.py",
"chars": 42,
"preview": "import flask\n\napp = flask.Flask(__name__)\n"
},
{
"path": "lib/flask/testsuite/test_apps/main_app.py",
"chars": 90,
"preview": "import flask\n\n# Test Flask initialization with main module.\napp = flask.Flask('__main__')\n"
},
{
"path": "lib/flask/testsuite/test_apps/moduleapp/__init__.py",
"chars": 188,
"preview": "from flask import Flask\n\napp = Flask(__name__)\nfrom moduleapp.apps.admin import admin\nfrom moduleapp.apps.frontend impor"
},
{
"path": "lib/flask/testsuite/test_apps/moduleapp/apps/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "lib/flask/testsuite/test_apps/moduleapp/apps/admin/__init__.py",
"chars": 259,
"preview": "from flask import Module, render_template\n\n\nadmin = Module(__name__, url_prefix='/admin')\n\n\n@admin.route('/')\ndef index("
},
{
"path": "lib/flask/testsuite/test_apps/moduleapp/apps/admin/static/css/test.css",
"chars": 18,
"preview": "/* nested file */\n"
},
{
"path": "lib/flask/testsuite/test_apps/moduleapp/apps/admin/static/test.txt",
"chars": 11,
"preview": "Admin File\n"
},
{
"path": "lib/flask/testsuite/test_apps/moduleapp/apps/admin/templates/index.html",
"chars": 21,
"preview": "Hello from the Admin\n"
},
{
"path": "lib/flask/testsuite/test_apps/moduleapp/apps/frontend/__init__.py",
"chars": 158,
"preview": "from flask import Module, render_template\n\n\nfrontend = Module(__name__)\n\n\n@frontend.route('/')\ndef index():\n return r"
},
{
"path": "lib/flask/testsuite/test_apps/moduleapp/apps/frontend/templates/index.html",
"chars": 24,
"preview": "Hello from the Frontend\n"
},
{
"path": "lib/flask/testsuite/test_apps/path/installed_package/__init__.py",
"chars": 42,
"preview": "import flask\n\napp = flask.Flask(__name__)\n"
},
{
"path": "lib/flask/testsuite/test_apps/subdomaintestmodule/__init__.py",
"chars": 74,
"preview": "from flask import Module\n\n\nmod = Module(__name__, 'foo', subdomain='foo')\n"
},
{
"path": "lib/flask/testsuite/test_apps/subdomaintestmodule/static/hello.txt",
"chars": 16,
"preview": "Hello Subdomain\n"
},
{
"path": "lib/flask/testsuite/testing.py",
"chars": 7411,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n flask.testsuite.testing\n ~~~~~~~~~~~~~~~~~~~~~~~\n\n Test client and more.\n\n :cop"
},
{
"path": "lib/flask/testsuite/views.py",
"chars": 5068,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n flask.testsuite.views\n ~~~~~~~~~~~~~~~~~~~~~\n\n Pluggable views.\n\n :copyright: ("
},
{
"path": "lib/flask/views.py",
"chars": 5642,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n flask.views\n ~~~~~~~~~~~\n\n This module provides class-based views inspired by the "
},
{
"path": "lib/flask/wrappers.py",
"chars": 6709,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n flask.wrappers\n ~~~~~~~~~~~~~~\n\n Implements the WSGI wrappers (request and respons"
},
{
"path": "lib/itsdangerous-0.24.dist-info/DESCRIPTION.rst",
"chars": 10,
"preview": "UNKNOWN\n\n\n"
},
{
"path": "lib/itsdangerous-0.24.dist-info/METADATA",
"chars": 442,
"preview": "Metadata-Version: 2.0\nName: itsdangerous\nVersion: 0.24\nSummary: Various helpers to pass trusted data to untrusted enviro"
},
{
"path": "lib/itsdangerous-0.24.dist-info/RECORD",
"chars": 608,
"preview": "itsdangerous.py,sha256=l7u6oqIepEllYDR7hRmoE7z47Ry6vtFCF6EAbJt-ilI,31840\r\nitsdangerous-0.24.dist-info/DESCRIPTION.rst,sh"
},
{
"path": "lib/itsdangerous-0.24.dist-info/WHEEL",
"chars": 92,
"preview": "Wheel-Version: 1.0\nGenerator: bdist_wheel (0.24.0)\nRoot-Is-Purelib: true\nTag: py2-none-any\n\n"
},
{
"path": "lib/itsdangerous-0.24.dist-info/metadata.json",
"chars": 586,
"preview": "{\"summary\": \"Various helpers to pass trusted data to untrusted environments and back.\", \"metadata_version\": \"2.0\", \"exte"
},
{
"path": "lib/itsdangerous-0.24.dist-info/top_level.txt",
"chars": 13,
"preview": "itsdangerous\n"
},
{
"path": "lib/itsdangerous.py",
"chars": 31840,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n itsdangerous\n ~~~~~~~~~~~~\n\n A module that implements various functions to deal wi"
},
{
"path": "lib/jinja2/__init__.py",
"chars": 2326,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n jinja2\n ~~~~~~\n\n Jinja2 is a template engine written in pure Python. It provides "
},
{
"path": "lib/jinja2/_compat.py",
"chars": 3109,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n jinja2._compat\n ~~~~~~~~~~~~~~\n\n Some py2/py3 compatibility support based on a str"
},
{
"path": "lib/jinja2/_stringdefs.py",
"chars": 404291,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n jinja2._stringdefs\n ~~~~~~~~~~~~~~~~~~\n\n Strings of all Unicode characters of a ce"
},
{
"path": "lib/jinja2/bccache.py",
"chars": 12793,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n jinja2.bccache\n ~~~~~~~~~~~~~~\n\n This module implements the bytecode cache system "
},
{
"path": "lib/jinja2/compiler.py",
"chars": 63846,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n jinja2.compiler\n ~~~~~~~~~~~~~~~\n\n Compiles nodes into python code.\n\n :copyrigh"
},
{
"path": "lib/jinja2/constants.py",
"chars": 1626,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n jinja.constants\n ~~~~~~~~~~~~~~~\n\n Various constants.\n\n :copyright: (c) 2010 by"
},
{
"path": "lib/jinja2/debug.py",
"chars": 11553,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n jinja2.debug\n ~~~~~~~~~~~~\n\n Implements the debug interface for Jinja. This modul"
},
{
"path": "lib/jinja2/defaults.py",
"chars": 1057,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n jinja2.defaults\n ~~~~~~~~~~~~~~~\n\n Jinja default filters and tags.\n\n :copyright"
},
{
"path": "lib/jinja2/environment.py",
"chars": 48120,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n jinja2.environment\n ~~~~~~~~~~~~~~~~~~\n\n Provides a class that holds runtime and p"
},
{
"path": "lib/jinja2/exceptions.py",
"chars": 4428,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n jinja2.exceptions\n ~~~~~~~~~~~~~~~~~\n\n Jinja exceptions.\n\n :copyright: (c) 2010"
},
{
"path": "lib/jinja2/ext.py",
"chars": 25072,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n jinja2.ext\n ~~~~~~~~~~\n\n Jinja extensions allow to add custom tags similar to the "
},
{
"path": "lib/jinja2/filters.py",
"chars": 30115,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n jinja2.filters\n ~~~~~~~~~~~~~~\n\n Bundled jinja filters.\n\n :copyright: (c) 2010 "
},
{
"path": "lib/jinja2/lexer.py",
"chars": 28423,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n jinja2.lexer\n ~~~~~~~~~~~~\n\n This module implements a Jinja / Python combination l"
},
{
"path": "lib/jinja2/loaders.py",
"chars": 17380,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n jinja2.loaders\n ~~~~~~~~~~~~~~\n\n Jinja loader classes.\n\n :copyright: (c) 2010 b"
},
{
"path": "lib/jinja2/meta.py",
"chars": 4198,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n jinja2.meta\n ~~~~~~~~~~~\n\n This module implements various functions that exposes i"
},
{
"path": "lib/jinja2/nodes.py",
"chars": 28954,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n jinja2.nodes\n ~~~~~~~~~~~~\n\n This module implements additional nodes derived from "
},
{
"path": "lib/jinja2/optimizer.py",
"chars": 2302,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n jinja2.optimizer\n ~~~~~~~~~~~~~~~~\n\n The jinja optimizer is currently trying to co"
},
{
"path": "lib/jinja2/parser.py",
"chars": 35442,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n jinja2.parser\n ~~~~~~~~~~~~~\n\n Implements the template parser.\n\n :copyright: (c"
},
{
"path": "lib/jinja2/runtime.py",
"chars": 22530,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n jinja2.runtime\n ~~~~~~~~~~~~~~\n\n Runtime helpers.\n\n :copyright: (c) 2010 by the"
},
{
"path": "lib/jinja2/sandbox.py",
"chars": 13327,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n jinja2.sandbox\n ~~~~~~~~~~~~~~\n\n Adds a sandbox layer to Jinja as it was the defau"
},
{
"path": "lib/jinja2/tests.py",
"chars": 4131,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n jinja2.tests\n ~~~~~~~~~~~~\n\n Jinja test functions. Used with the \"is\" operator.\n\n "
},
{
"path": "lib/jinja2/utils.py",
"chars": 16560,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n jinja2.utils\n ~~~~~~~~~~~~\n\n Utility functions.\n\n :copyright: (c) 2010 by the J"
},
{
"path": "lib/jinja2/visitor.py",
"chars": 3316,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n jinja2.visitor\n ~~~~~~~~~~~~~~\n\n This module implements a visitor for the nodes.\n\n"
},
{
"path": "lib/markupsafe/__init__.py",
"chars": 10338,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n markupsafe\n ~~~~~~~~~~\n\n Implements a Markup string.\n\n :copyright: (c) 2010 by "
},
{
"path": "lib/markupsafe/_compat.py",
"chars": 565,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n markupsafe._compat\n ~~~~~~~~~~~~~~~~~~\n\n Compatibility module for different Python"
},
{
"path": "lib/markupsafe/_constants.py",
"chars": 4795,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n markupsafe._constants\n ~~~~~~~~~~~~~~~~~~~~~\n\n Highlevel implementation of the Mar"
},
{
"path": "lib/markupsafe/_native.py",
"chars": 1187,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n markupsafe._native\n ~~~~~~~~~~~~~~~~~~\n\n Native Python implementation the C module"
},
{
"path": "lib/markupsafe/_speedups.c",
"chars": 5939,
"preview": "/**\n * markupsafe._speedups\n * ~~~~~~~~~~~~~~~~~~~~\n *\n * This module implements functions for automatic escaping in C f"
},
{
"path": "lib/markupsafe/tests.py",
"chars": 6107,
"preview": "# -*- coding: utf-8 -*-\nimport gc\nimport sys\nimport unittest\nfrom markupsafe import Markup, escape, escape_silent\nfrom m"
},
{
"path": "lib/werkzeug/__init__.py",
"chars": 6917,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n werkzeug\n ~~~~~~~~\n\n Werkzeug is the Swiss Army knife of Python web development.\n\n"
},
{
"path": "lib/werkzeug/_compat.py",
"chars": 6311,
"preview": "# flake8: noqa\n# This whole file is full of lint errors\nimport codecs\nimport sys\nimport operator\nimport functools\nimport"
},
{
"path": "lib/werkzeug/_internal.py",
"chars": 13709,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n werkzeug._internal\n ~~~~~~~~~~~~~~~~~~\n\n This module provides internally used help"
},
{
"path": "lib/werkzeug/_reloader.py",
"chars": 8548,
"preview": "import os\nimport sys\nimport time\nimport subprocess\nimport threading\nfrom itertools import chain\n\nfrom werkzeug._internal"
},
{
"path": "lib/werkzeug/contrib/__init__.py",
"chars": 623,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n werkzeug.contrib\n ~~~~~~~~~~~~~~~~\n\n Contains user-submitted code that other users"
},
{
"path": "lib/werkzeug/contrib/atom.py",
"chars": 15588,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n werkzeug.contrib.atom\n ~~~~~~~~~~~~~~~~~~~~~\n\n This module provides a class called"
},
{
"path": "lib/werkzeug/contrib/cache.py",
"chars": 27983,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n werkzeug.contrib.cache\n ~~~~~~~~~~~~~~~~~~~~~~\n\n The main problem with dynamic Web"
},
{
"path": "lib/werkzeug/contrib/fixers.py",
"chars": 10183,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n werkzeug.contrib.fixers\n ~~~~~~~~~~~~~~~~~~~~~~~\n\n .. versionadded:: 0.5\n\n This"
},
{
"path": "lib/werkzeug/contrib/iterio.py",
"chars": 10814,
"preview": "# -*- coding: utf-8 -*-\nr\"\"\"\n werkzeug.contrib.iterio\n ~~~~~~~~~~~~~~~~~~~~~~~\n\n This module implements a :clas"
},
{
"path": "lib/werkzeug/contrib/jsrouting.py",
"chars": 8564,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n werkzeug.contrib.jsrouting\n ~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n Addon module that allows "
},
{
"path": "lib/werkzeug/contrib/limiter.py",
"chars": 1334,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n werkzeug.contrib.limiter\n ~~~~~~~~~~~~~~~~~~~~~~~~\n\n A middleware that limits inco"
},
{
"path": "lib/werkzeug/contrib/lint.py",
"chars": 12322,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n werkzeug.contrib.lint\n ~~~~~~~~~~~~~~~~~~~~~\n\n .. versionadded:: 0.5\n\n This mod"
},
{
"path": "lib/werkzeug/contrib/profiler.py",
"chars": 5151,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n werkzeug.contrib.profiler\n ~~~~~~~~~~~~~~~~~~~~~~~~~\n\n This module provides a simp"
},
{
"path": "lib/werkzeug/contrib/securecookie.py",
"chars": 12206,
"preview": "# -*- coding: utf-8 -*-\nr\"\"\"\n werkzeug.contrib.securecookie\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n This module implem"
},
{
"path": "lib/werkzeug/contrib/sessions.py",
"chars": 12577,
"preview": "# -*- coding: utf-8 -*-\nr\"\"\"\n werkzeug.contrib.sessions\n ~~~~~~~~~~~~~~~~~~~~~~~~~\n\n This module contains some "
},
{
"path": "lib/werkzeug/contrib/testtools.py",
"chars": 2453,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n werkzeug.contrib.testtools\n ~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n This module implements ex"
},
{
"path": "lib/werkzeug/contrib/wrappers.py",
"chars": 10337,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n werkzeug.contrib.wrappers\n ~~~~~~~~~~~~~~~~~~~~~~~~~\n\n Extra wrappers or mixins co"
},
{
"path": "lib/werkzeug/datastructures.py",
"chars": 87447,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n werkzeug.datastructures\n ~~~~~~~~~~~~~~~~~~~~~~~\n\n This module provides mixins and"
},
{
"path": "lib/werkzeug/debug/__init__.py",
"chars": 13126,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n werkzeug.debug\n ~~~~~~~~~~~~~~\n\n WSGI application traceback debugger.\n\n :copyri"
},
{
"path": "lib/werkzeug/debug/console.py",
"chars": 5599,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n werkzeug.debug.console\n ~~~~~~~~~~~~~~~~~~~~~~\n\n Interactive console support.\n\n "
},
{
"path": "lib/werkzeug/debug/repr.py",
"chars": 9354,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n werkzeug.debug.repr\n ~~~~~~~~~~~~~~~~~~~\n\n This module implements object represent"
},
{
"path": "lib/werkzeug/debug/shared/FONT_LICENSE",
"chars": 4673,
"preview": "-------------------------------\nUBUNTU FONT LICENCE Version 1.0\n-------------------------------\n\nPREAMBLE\nThis licence a"
},
{
"path": "lib/werkzeug/debug/shared/debugger.js",
"chars": 6187,
"preview": "$(function() {\n if (!EVALEX_TRUSTED) {\n initPinBox();\n }\n\n /**\n * if we are in console mode, show the console.\n "
},
{
"path": "lib/werkzeug/debug/shared/jquery.js",
"chars": 95957,
"preview": "/*! jQuery v1.11.3 | (c) 2005, 2015 jQuery Foundation, Inc. | jquery.org/license */\n!function(a,b){\"object\"==typeof modu"
},
{
"path": "lib/werkzeug/debug/shared/style.css",
"chars": 6230,
"preview": "@font-face {\n font-family: 'Ubuntu';\n font-style: normal;\n font-weight: normal;\n src: local('Ubuntu'), local('Ubuntu"
},
{
"path": "lib/werkzeug/debug/tbtools.py",
"chars": 18402,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n werkzeug.debug.tbtools\n ~~~~~~~~~~~~~~~~~~~~~~\n\n This module provides various trac"
},
{
"path": "lib/werkzeug/exceptions.py",
"chars": 18609,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n werkzeug.exceptions\n ~~~~~~~~~~~~~~~~~~~\n\n This module implements a number of Pyth"
},
{
"path": "lib/werkzeug/filesystem.py",
"chars": 2174,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n werkzeug.filesystem\n ~~~~~~~~~~~~~~~~~~~\n\n Various utilities for the local filesys"
},
{
"path": "lib/werkzeug/formparser.py",
"chars": 21207,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n werkzeug.formparser\n ~~~~~~~~~~~~~~~~~~~\n\n This module implements the form parsing"
},
{
"path": "lib/werkzeug/http.py",
"chars": 35029,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n werkzeug.http\n ~~~~~~~~~~~~~\n\n Werkzeug comes with a bunch of utilities that help "
},
{
"path": "lib/werkzeug/local.py",
"chars": 14123,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n werkzeug.local\n ~~~~~~~~~~~~~~\n\n This module implements context-local objects.\n\n "
},
{
"path": "lib/werkzeug/posixemulation.py",
"chars": 3519,
"preview": "# -*- coding: utf-8 -*-\nr\"\"\"\n werkzeug.posixemulation\n ~~~~~~~~~~~~~~~~~~~~~~~\n\n Provides a POSIX emulation for"
},
{
"path": "lib/werkzeug/routing.py",
"chars": 66260,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n werkzeug.routing\n ~~~~~~~~~~~~~~~~\n\n When it comes to combining multiple controlle"
},
{
"path": "lib/werkzeug/script.py",
"chars": 11365,
"preview": "# -*- coding: utf-8 -*-\nr'''\n werkzeug.script\n ~~~~~~~~~~~~~~~\n\n .. admonition:: Deprecated Functionality\n\n "
},
{
"path": "lib/werkzeug/security.py",
"chars": 8971,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n werkzeug.security\n ~~~~~~~~~~~~~~~~~\n\n Security related helpers such as secure pas"
},
{
"path": "lib/werkzeug/serving.py",
"chars": 27228,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n werkzeug.serving\n ~~~~~~~~~~~~~~~~\n\n There are many ways to serve a WSGI applicati"
},
{
"path": "lib/werkzeug/test.py",
"chars": 34152,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n werkzeug.test\n ~~~~~~~~~~~~~\n\n This module implements a client to WSGI application"
},
{
"path": "lib/werkzeug/testapp.py",
"chars": 9396,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n werkzeug.testapp\n ~~~~~~~~~~~~~~~~\n\n Provide a small test application that can be "
},
{
"path": "lib/werkzeug/urls.py",
"chars": 36627,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n werkzeug.urls\n ~~~~~~~~~~~~~\n\n ``werkzeug.urls`` used to provide several wrapper f"
},
{
"path": "lib/werkzeug/useragents.py",
"chars": 5418,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n werkzeug.useragents\n ~~~~~~~~~~~~~~~~~~~\n\n This module provides a helper to inspec"
},
{
"path": "lib/werkzeug/utils.py",
"chars": 22972,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n werkzeug.utils\n ~~~~~~~~~~~~~~\n\n This module implements various utilities for WSGI"
},
{
"path": "lib/werkzeug/wrappers.py",
"chars": 77011,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n werkzeug.wrappers\n ~~~~~~~~~~~~~~~~~\n\n The wrappers are simple request and respons"
},
{
"path": "lib/werkzeug/wsgi.py",
"chars": 37881,
"preview": "# -*- coding: utf-8 -*-\n\"\"\"\n werkzeug.wsgi\n ~~~~~~~~~~~~~\n\n This module implements WSGI related helpers.\n\n :"
},
{
"path": "main.py",
"chars": 635,
"preview": "\"\"\"`main` is the top level module for your Flask application.\"\"\"\n\n# Import the Flask Framework\nfrom flask import Flask\na"
},
{
"path": "requirements.txt",
"chars": 275,
"preview": "# This requirements file lists all third-party dependencies for this project.\n#\n# Run 'pip install -r requirements.txt -"
}
]
// ... and 1 more files (download for full content)
About this extraction
This page contains the full source code of the GoogleCloudPlatform/appengine-flask-skeleton GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 194 files (2.0 MB), approximately 541.2k tokens, and a symbol index with 2864 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.