├── .gitignore ├── Makefile ├── README.md ├── licenses ├── Blinker-license.txt ├── Click-license.txt ├── Flask-Cache-license.txt ├── Flask-DebugToolbar-license.txt ├── Flask-WTF-license.txt ├── Flask-license.txt ├── Font-Awesome-license.txt ├── Jinja2-license.txt ├── Parsley-license.txt ├── WTForms-ParsleyJS-license.txt ├── WTForms-license.txt ├── Werkzeug-license.txt ├── itsdangerous-license.txt └── simplejson-license.txt ├── requirements_dev.txt └── src ├── app.yaml ├── appengine_config.py ├── application ├── __init__.py ├── decorators.py ├── forms.py ├── generate_keys.py ├── models.py ├── settings.py ├── static │ ├── css │ │ └── main.css │ ├── img │ │ ├── favicon.ico │ │ └── favicon.png │ ├── js │ │ └── main.js │ └── robots.txt ├── templates │ ├── 404.html │ ├── 500.html │ ├── base.html │ ├── edit_example.html │ ├── includes │ │ ├── flash_message.html │ │ └── nav.html │ ├── list_examples.html │ ├── list_examples_cached.html │ └── new_example.html ├── urls.py └── views │ ├── __init__.py │ ├── admin │ ├── __init__.py │ ├── admin_delete_example.py │ ├── admin_edit_example.py │ ├── admin_list_examples.py │ ├── admin_list_examples_cached.py │ └── admin_secret.py │ └── public │ ├── __init__.py │ ├── public_index.py │ ├── public_say_hello.py │ └── public_warmup.py ├── apptest.py ├── index.yaml ├── lib ├── __init__.py ├── blinker │ ├── __init__.py │ ├── _saferef.py │ ├── _utilities.py │ └── base.py ├── click │ ├── __init__.py │ ├── _bashcomplete.py │ ├── _compat.py │ ├── _termui_impl.py │ ├── _textwrap.py │ ├── _unicodefun.py │ ├── _winconsole.py │ ├── core.py │ ├── decorators.py │ ├── exceptions.py │ ├── formatting.py │ ├── globals.py │ ├── parser.py │ ├── termui.py │ ├── testing.py │ ├── types.py │ └── utils.py ├── flask │ ├── __init__.py │ ├── __main__.py │ ├── _compat.py │ ├── app.py │ ├── blueprints.py │ ├── cli.py │ ├── config.py │ ├── ctx.py │ ├── debughelpers.py │ ├── ext │ │ └── __init__.py │ ├── exthook.py │ ├── globals.py │ ├── helpers.py │ ├── json.py │ ├── logging.py │ ├── sessions.py │ ├── signals.py │ ├── templating.py │ ├── testing.py │ ├── views.py │ └── wrappers.py ├── flask_cache │ ├── __init__.py │ ├── _compat.py │ ├── backends.py │ └── jinja2ext.py ├── flask_debugtoolbar │ ├── __init__.py │ ├── compat.py │ ├── panels │ │ ├── __init__.py │ │ ├── config_vars.py │ │ ├── headers.py │ │ ├── logger.py │ │ ├── profiler.py │ │ ├── request_vars.py │ │ ├── route_list.py │ │ ├── sqlalchemy.py │ │ ├── template.py │ │ ├── timer.py │ │ └── versions.py │ ├── static │ │ ├── codemirror │ │ │ ├── codemirror.css │ │ │ ├── codemirror.js │ │ │ ├── mode │ │ │ │ ├── clike │ │ │ │ │ ├── clike.js │ │ │ │ │ └── index.html │ │ │ │ ├── clojure │ │ │ │ │ ├── clojure.js │ │ │ │ │ └── index.html │ │ │ │ ├── coffeescript │ │ │ │ │ ├── LICENSE │ │ │ │ │ ├── coffeescript.js │ │ │ │ │ └── index.html │ │ │ │ ├── css │ │ │ │ │ ├── css.js │ │ │ │ │ └── index.html │ │ │ │ ├── diff │ │ │ │ │ ├── diff.css │ │ │ │ │ ├── diff.js │ │ │ │ │ └── index.html │ │ │ │ ├── ecl │ │ │ │ │ ├── ecl.js │ │ │ │ │ └── index.html │ │ │ │ ├── gfm │ │ │ │ │ ├── gfm.js │ │ │ │ │ └── index.html │ │ │ │ ├── go │ │ │ │ │ ├── go.js │ │ │ │ │ └── index.html │ │ │ │ ├── groovy │ │ │ │ │ ├── groovy.js │ │ │ │ │ └── index.html │ │ │ │ ├── haskell │ │ │ │ │ ├── haskell.js │ │ │ │ │ └── index.html │ │ │ │ ├── htmlembedded │ │ │ │ │ ├── htmlembedded.js │ │ │ │ │ └── index.html │ │ │ │ ├── htmlmixed │ │ │ │ │ ├── htmlmixed.js │ │ │ │ │ └── index.html │ │ │ │ ├── javascript │ │ │ │ │ ├── index.html │ │ │ │ │ └── javascript.js │ │ │ │ ├── jinja2 │ │ │ │ │ ├── index.html │ │ │ │ │ └── jinja2.js │ │ │ │ ├── less │ │ │ │ │ ├── index.html │ │ │ │ │ └── less.js │ │ │ │ ├── lua │ │ │ │ │ ├── index.html │ │ │ │ │ └── lua.js │ │ │ │ ├── markdown │ │ │ │ │ ├── index.html │ │ │ │ │ └── markdown.js │ │ │ │ ├── mysql │ │ │ │ │ ├── index.html │ │ │ │ │ └── mysql.js │ │ │ │ ├── ntriples │ │ │ │ │ ├── index.html │ │ │ │ │ └── ntriples.js │ │ │ │ ├── pascal │ │ │ │ │ ├── LICENSE │ │ │ │ │ ├── index.html │ │ │ │ │ └── pascal.js │ │ │ │ ├── perl │ │ │ │ │ ├── LICENSE │ │ │ │ │ ├── index.html │ │ │ │ │ └── perl.js │ │ │ │ ├── php │ │ │ │ │ ├── index.html │ │ │ │ │ └── php.js │ │ │ │ ├── plsql │ │ │ │ │ ├── index.html │ │ │ │ │ └── plsql.js │ │ │ │ ├── properties │ │ │ │ │ ├── index.html │ │ │ │ │ └── properties.js │ │ │ │ ├── python │ │ │ │ │ ├── LICENSE.txt │ │ │ │ │ ├── index.html │ │ │ │ │ └── python.js │ │ │ │ ├── r │ │ │ │ │ ├── LICENSE │ │ │ │ │ ├── index.html │ │ │ │ │ └── r.js │ │ │ │ ├── rpm │ │ │ │ │ ├── changes │ │ │ │ │ │ ├── changes.js │ │ │ │ │ │ └── index.html │ │ │ │ │ └── spec │ │ │ │ │ │ ├── index.html │ │ │ │ │ │ ├── spec.css │ │ │ │ │ │ └── spec.js │ │ │ │ ├── rst │ │ │ │ │ ├── index.html │ │ │ │ │ └── rst.js │ │ │ │ ├── ruby │ │ │ │ │ ├── LICENSE │ │ │ │ │ ├── index.html │ │ │ │ │ └── ruby.js │ │ │ │ ├── rust │ │ │ │ │ ├── index.html │ │ │ │ │ └── rust.js │ │ │ │ ├── scheme │ │ │ │ │ ├── index.html │ │ │ │ │ └── scheme.js │ │ │ │ ├── smalltalk │ │ │ │ │ ├── index.html │ │ │ │ │ └── smalltalk.js │ │ │ │ ├── smarty │ │ │ │ │ ├── index.html │ │ │ │ │ └── smarty.js │ │ │ │ ├── sparql │ │ │ │ │ ├── index.html │ │ │ │ │ └── sparql.js │ │ │ │ ├── stex │ │ │ │ │ ├── index.html │ │ │ │ │ ├── stex.js │ │ │ │ │ └── test.html │ │ │ │ ├── tiddlywiki │ │ │ │ │ ├── index.html │ │ │ │ │ ├── tiddlywiki.css │ │ │ │ │ └── tiddlywiki.js │ │ │ │ ├── vbscript │ │ │ │ │ ├── index.html │ │ │ │ │ └── vbscript.js │ │ │ │ ├── velocity │ │ │ │ │ ├── index.html │ │ │ │ │ └── velocity.js │ │ │ │ ├── verilog │ │ │ │ │ ├── index.html │ │ │ │ │ └── verilog.js │ │ │ │ ├── xml │ │ │ │ │ ├── index.html │ │ │ │ │ └── xml.js │ │ │ │ ├── xmlpure │ │ │ │ │ ├── index.html │ │ │ │ │ └── xmlpure.js │ │ │ │ ├── xquery │ │ │ │ │ ├── LICENSE │ │ │ │ │ ├── index.html │ │ │ │ │ ├── test │ │ │ │ │ │ ├── index.html │ │ │ │ │ │ ├── testBase.js │ │ │ │ │ │ ├── testEmptySequenceKeyword.js │ │ │ │ │ │ ├── testMultiAttr.js │ │ │ │ │ │ ├── testNamespaces.js │ │ │ │ │ │ ├── testProcessingInstructions.js │ │ │ │ │ │ └── testQuotes.js │ │ │ │ │ └── xquery.js │ │ │ │ └── yaml │ │ │ │ │ ├── index.html │ │ │ │ │ └── yaml.js │ │ │ ├── theme │ │ │ │ ├── cobalt.css │ │ │ │ ├── eclipse.css │ │ │ │ ├── elegant.css │ │ │ │ ├── lesser-dark.css │ │ │ │ ├── monokai.css │ │ │ │ ├── neat.css │ │ │ │ ├── night.css │ │ │ │ ├── rubyblue.css │ │ │ │ └── xq-dark.css │ │ │ └── util │ │ │ │ ├── closetag.js │ │ │ │ ├── dialog.css │ │ │ │ ├── dialog.js │ │ │ │ ├── foldcode.js │ │ │ │ ├── formatting.js │ │ │ │ ├── javascript-hint.js │ │ │ │ ├── match-highlighter.js │ │ │ │ ├── overlay.js │ │ │ │ ├── runmode.js │ │ │ │ ├── search.js │ │ │ │ ├── searchcursor.js │ │ │ │ ├── simple-hint.css │ │ │ │ └── simple-hint.js │ │ ├── css │ │ │ └── toolbar.css │ │ ├── img │ │ │ ├── asc.gif │ │ │ ├── back.png │ │ │ ├── back_hover.png │ │ │ ├── bg.gif │ │ │ ├── close.png │ │ │ ├── close_hover.png │ │ │ ├── desc.gif │ │ │ ├── djdt_vertical.png │ │ │ ├── indicator.png │ │ │ ├── panel_bg.png │ │ │ ├── tick-red.png │ │ │ └── tick.png │ │ └── js │ │ │ ├── jquery.js │ │ │ ├── jquery.tablesorter.js │ │ │ └── toolbar.js │ ├── templates │ │ ├── base.html │ │ ├── panels │ │ │ ├── config_vars.html │ │ │ ├── headers.html │ │ │ ├── logger.html │ │ │ ├── profiler.html │ │ │ ├── request_vars.html │ │ │ ├── route_list.html │ │ │ ├── sqlalchemy.html │ │ │ ├── sqlalchemy_error.html │ │ │ ├── sqlalchemy_select.html │ │ │ ├── template.html │ │ │ ├── template_editor.html │ │ │ ├── timer.html │ │ │ └── versions.html │ │ └── redirect.html │ ├── toolbar.py │ └── utils.py ├── flask_wtf │ ├── __init__.py │ ├── _compat.py │ ├── csrf.py │ ├── file.py │ ├── form.py │ ├── html5.py │ ├── i18n.py │ └── recaptcha │ │ ├── __init__.py │ │ ├── fields.py │ │ ├── validators.py │ │ └── widgets.py ├── gae_mini_profiler │ ├── .gitignore │ ├── README.md │ ├── __init__.py │ ├── appstats_profiler.py │ ├── cleanup.py │ ├── config.py │ ├── cookies.py │ ├── instrumented_profiler.py │ ├── main.py │ ├── profiler.py │ ├── sampling_profiler.py │ ├── static │ │ ├── css │ │ │ └── profiler.css │ │ └── js │ │ │ ├── profiler.js │ │ │ └── template.tmpl │ ├── templates │ │ ├── includes.html │ │ └── shared.html │ ├── templatetags.py │ ├── unformatter │ │ ├── __init__.py │ │ └── examples.txt │ └── util.py ├── itsdangerous.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 │ │ │ ├── console.png │ │ │ ├── debugger.js │ │ │ ├── jquery.js │ │ │ ├── less.png │ │ │ ├── more.png │ │ │ ├── source.png │ │ │ ├── style.css │ │ │ └── ubuntu.ttf │ │ └── 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 └── wtforms │ ├── __init__.py │ ├── compat.py │ ├── csrf │ ├── __init__.py │ ├── core.py │ └── session.py │ ├── ext │ ├── __init__.py │ ├── appengine │ │ ├── __init__.py │ │ ├── db.py │ │ ├── fields.py │ │ └── ndb.py │ ├── csrf │ │ ├── __init__.py │ │ ├── fields.py │ │ ├── form.py │ │ └── session.py │ ├── dateutil │ │ ├── __init__.py │ │ └── fields.py │ ├── django │ │ ├── __init__.py │ │ ├── fields.py │ │ ├── i18n.py │ │ ├── orm.py │ │ └── templatetags │ │ │ ├── __init__.py │ │ │ └── wtforms.py │ ├── i18n │ │ ├── __init__.py │ │ ├── form.py │ │ └── utils.py │ └── sqlalchemy │ │ ├── __init__.py │ │ ├── fields.py │ │ └── orm.py │ ├── fields │ ├── __init__.py │ ├── core.py │ ├── html5.py │ └── simple.py │ ├── form.py │ ├── i18n.py │ ├── locale │ ├── README.md │ ├── ar │ │ └── LC_MESSAGES │ │ │ ├── wtforms.mo │ │ │ └── wtforms.po │ ├── ca │ │ └── LC_MESSAGES │ │ │ ├── wtforms.mo │ │ │ └── wtforms.po │ ├── cs_CZ │ │ └── LC_MESSAGES │ │ │ ├── wtforms.mo │ │ │ └── wtforms.po │ ├── cy │ │ └── LC_MESSAGES │ │ │ ├── wtforms.mo │ │ │ └── wtforms.po │ ├── de │ │ └── LC_MESSAGES │ │ │ ├── wtforms.mo │ │ │ └── wtforms.po │ ├── de_CH │ │ └── LC_MESSAGES │ │ │ ├── wtforms.mo │ │ │ └── wtforms.po │ ├── el │ │ └── LC_MESSAGES │ │ │ ├── wtforms.mo │ │ │ └── wtforms.po │ ├── en │ │ └── LC_MESSAGES │ │ │ ├── wtforms.mo │ │ │ └── wtforms.po │ ├── es │ │ └── LC_MESSAGES │ │ │ ├── wtforms.mo │ │ │ └── wtforms.po │ ├── et │ │ └── LC_MESSAGES │ │ │ ├── wtforms.mo │ │ │ └── wtforms.po │ ├── fa │ │ └── LC_MESSAGES │ │ │ ├── wtforms.mo │ │ │ └── wtforms.po │ ├── fr │ │ └── LC_MESSAGES │ │ │ ├── wtforms.mo │ │ │ └── wtforms.po │ ├── it │ │ └── LC_MESSAGES │ │ │ ├── wtforms.mo │ │ │ └── wtforms.po │ ├── ja │ │ └── LC_MESSAGES │ │ │ ├── wtforms.mo │ │ │ └── wtforms.po │ ├── ko │ │ └── LC_MESSAGES │ │ │ ├── wtforms.mo │ │ │ └── wtforms.po │ ├── nb │ │ └── LC_MESSAGES │ │ │ ├── wtforms.mo │ │ │ └── wtforms.po │ ├── nl │ │ └── LC_MESSAGES │ │ │ ├── wtforms.mo │ │ │ └── wtforms.po │ ├── pl │ │ └── LC_MESSAGES │ │ │ ├── wtforms.mo │ │ │ └── wtforms.po │ ├── pt │ │ └── LC_MESSAGES │ │ │ ├── wtforms.mo │ │ │ └── wtforms.po │ ├── ru │ │ └── LC_MESSAGES │ │ │ ├── wtforms.mo │ │ │ └── wtforms.po │ ├── uk │ │ └── LC_MESSAGES │ │ │ ├── wtforms.mo │ │ │ └── wtforms.po │ ├── wtforms.pot │ ├── zh │ │ └── LC_MESSAGES │ │ │ ├── wtforms.mo │ │ │ └── wtforms.po │ └── zh_TW │ │ └── LC_MESSAGES │ │ ├── wtforms.mo │ │ └── wtforms.po │ ├── meta.py │ ├── utils.py │ ├── validators.py │ └── widgets │ ├── __init__.py │ ├── core.py │ └── html5.py ├── pkg_resources.py ├── run.py └── tests └── tests.py /.gitignore: -------------------------------------------------------------------------------- 1 | # Standard ignores 2 | *.pyc 3 | *.pyo 4 | *.DS_Store 5 | *.swp 6 | *.idea 7 | *.project 8 | *.pydevproject 9 | *.kpf 10 | venv 11 | 12 | # Don't store secret keys in version control 13 | secret_keys.py 14 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | VIRTUALENV="virtualenv" 2 | virtualenv_dir="venv" 3 | 4 | setup: venv deps 5 | 6 | venv: 7 | test -d venv || ($(VIRTUALENV) $(virtualenv_dir) || true) 8 | . $(virtualenv_dir)/bin/activate 9 | 10 | deps: 11 | pip install -Ur requirements_dev.txt 12 | 13 | keys: 14 | ./src/application/generate_keys.py 15 | 16 | -------------------------------------------------------------------------------- /licenses/Blinker-license.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) The Blinker authors and contributors 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a 4 | copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included 12 | in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 15 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /licenses/Click-license.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014 by Armin Ronacher. 2 | 3 | Click uses parts of optparse written by Gregory P. Ward and maintained by the 4 | Python software foundation. This is limited to code in the parser.py 5 | module: 6 | 7 | Copyright (c) 2001-2006 Gregory P. Ward. All rights reserved. 8 | Copyright (c) 2002-2006 Python Software Foundation. All rights reserved. 9 | 10 | Some rights reserved. 11 | 12 | Redistribution and use in source and binary forms, with or without 13 | modification, are permitted provided that the following conditions are 14 | met: 15 | 16 | * Redistributions of source code must retain the above copyright 17 | notice, this list of conditions and the following disclaimer. 18 | 19 | * Redistributions in binary form must reproduce the above 20 | copyright notice, this list of conditions and the following 21 | disclaimer in the documentation and/or other materials provided 22 | with the distribution. 23 | 24 | * The names of the contributors may not be used to endorse or 25 | promote products derived from this software without specific 26 | prior written permission. 27 | 28 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 31 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 32 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 33 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 34 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 35 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 36 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 37 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 38 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | -------------------------------------------------------------------------------- /licenses/Flask-Cache-license.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010 by Thadeus Burgess. 2 | 3 | Some rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are 7 | met: 8 | 9 | * Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above 13 | copyright notice, this list of conditions and the following 14 | disclaimer in the documentation and/or other materials provided 15 | with the distribution. 16 | 17 | * The names of the contributors may not be used to endorse or 18 | promote products derived from this software without specific 19 | prior written permission. 20 | 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | -------------------------------------------------------------------------------- /licenses/Flask-DebugToolbar-license.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) Rob Hudson and individual contributors. 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, 5 | are permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | 10 | 2. Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in the 12 | documentation and/or other materials provided with the distribution. 13 | 14 | 3. Neither the name of Django nor the names of its contributors may be used 15 | to endorse or promote products derived from this software without 16 | specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 22 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 25 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /licenses/Flask-WTF-license.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010 by Dan Jacob. 2 | 3 | Some rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are 7 | met: 8 | 9 | * Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above 13 | copyright notice, this list of conditions and the following 14 | disclaimer in the documentation and/or other materials provided 15 | with the distribution. 16 | 17 | * The names of the contributors may not be used to endorse or 18 | promote products derived from this software without specific 19 | prior written permission. 20 | 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | -------------------------------------------------------------------------------- /licenses/Flask-license.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 by Armin Ronacher and contributors. See AUTHORS 2 | for more details. 3 | 4 | Some rights reserved. 5 | 6 | Redistribution and use in source and binary forms of the software as well 7 | as documentation, with or without modification, are permitted provided 8 | that the following conditions are met: 9 | 10 | * Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | 13 | * Redistributions in binary form must reproduce the above 14 | copyright notice, this list of conditions and the following 15 | disclaimer in the documentation and/or other materials provided 16 | with the distribution. 17 | 18 | * The names of the contributors may not be used to endorse or 19 | promote products derived from this software without specific 20 | prior written permission. 21 | 22 | THIS SOFTWARE AND DOCUMENTATION IS PROVIDED BY THE COPYRIGHT HOLDERS AND 23 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT 24 | NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 25 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 26 | OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 27 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 28 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 29 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 30 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 31 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 32 | SOFTWARE AND DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 33 | DAMAGE. 34 | -------------------------------------------------------------------------------- /licenses/Font-Awesome-license.txt: -------------------------------------------------------------------------------- 1 | - The Font Awesome font is licensed under the [SIL Open Font License](http://scripts.sil.org/OFL). 2 | - Font Awesome CSS, LESS, and SASS files are licensed under the [MIT License](http://opensource.org/licenses/mit-license.html). 3 | - The Font Awesome pictograms are licensed under the [CC BY 3.0 License](http://creativecommons.org/licenses/by/3.0/) 4 | - Attribution is no longer required in Font Awesome 3.0, but much appreciated: 5 | 6 | > Font Awesome by Dave Gandy - http://fortawesome.github.com/Font-Awesome. -------------------------------------------------------------------------------- /licenses/Jinja2-license.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009 by the Jinja Team, see AUTHORS for more details. 2 | 3 | Some rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are 7 | met: 8 | 9 | * Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above 13 | copyright notice, this list of conditions and the following 14 | disclaimer in the documentation and/or other materials provided 15 | with the distribution. 16 | 17 | * The names of the contributors may not be used to endorse or 18 | promote products derived from this software without specific 19 | prior written permission. 20 | 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | 33 | -------------------------------------------------------------------------------- /licenses/Parsley-license.txt: -------------------------------------------------------------------------------- 1 | Copyright 2013 Guillaume Potier and contributors http://github.com/guillaumepotier/Parsley.js 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /licenses/WTForms-ParsleyJS-license.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013, Johannes Gehrs 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /licenses/WTForms-license.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014 by Thomas Johansson, James Crasta and others. 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, 5 | are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | * The names of the contributors may not be used to endorse or promote 15 | products derived from this software without specific prior written 16 | permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 22 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 25 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /licenses/Werkzeug-license.txt: -------------------------------------------------------------------------------- 1 | License 2 | 3 | Copyright (c) 2009 by the Werkzeug Team, see AUTHORS for more details. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are 7 | met: 8 | 9 | * Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above 13 | copyright notice, this list of conditions and the following 14 | disclaimer in the documentation and/or other materials provided 15 | with the distribution. 16 | 17 | * The names of the contributors may not be used to endorse or 18 | promote products derived from this software without specific 19 | prior written permission. 20 | 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | 33 | -------------------------------------------------------------------------------- /licenses/itsdangerous-license.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011 by Armin Ronacher and the Django Software Foundation. 2 | 3 | Some rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are 7 | met: 8 | 9 | * Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above 13 | copyright notice, this list of conditions and the following 14 | disclaimer in the documentation and/or other materials provided 15 | with the distribution. 16 | 17 | * The names of the contributors may not be used to endorse or 18 | promote products derived from this software without specific 19 | prior written permission. 20 | 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | -------------------------------------------------------------------------------- /licenses/simplejson-license.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2006 Bob Ippolito 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 7 | of the Software, and to permit persons to whom the Software is furnished to do 8 | so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. 20 | -------------------------------------------------------------------------------- /requirements_dev.txt: -------------------------------------------------------------------------------- 1 | # Development environment pip requirements file 2 | # Install via 'pip install -r requirements_dev.txt' 3 | 4 | click 5 | Pillow 6 | jinja2 7 | simplejson 8 | unittest2 9 | -------------------------------------------------------------------------------- /src/app.yaml: -------------------------------------------------------------------------------- 1 | application: flaskgithub 2 | version: 1 3 | runtime: python27 4 | api_version: 1 5 | threadsafe: true 6 | 7 | default_expiration: "5d" 8 | 9 | builtins: 10 | - appstats: on 11 | - admin_redirect: on 12 | - deferred: on 13 | - remote_api: on 14 | 15 | libraries: 16 | - name: jinja2 17 | version: "2.6" 18 | - name: markupsafe 19 | version: "0.15" 20 | 21 | inbound_services: 22 | - warmup 23 | 24 | handlers: 25 | - url: /favicon.ico 26 | static_files: application/static/img/favicon.ico 27 | upload: application/static/img/favicon.ico 28 | 29 | - url: /robots.txt 30 | static_files: application/static/robots.txt 31 | upload: application/static/robots.txt 32 | 33 | - url: /gae_mini_profiler/static 34 | static_dir: lib/gae_mini_profiler/static 35 | 36 | - url: /gae_mini_profiler/.* 37 | script: lib.gae_mini_profiler.main.application 38 | 39 | - url: /static 40 | static_dir: application/static 41 | 42 | - url: .* 43 | script: run.application.app -------------------------------------------------------------------------------- /src/appengine_config.py: -------------------------------------------------------------------------------- 1 | """ 2 | App Engine config 3 | 4 | """ 5 | 6 | 7 | def gae_mini_profiler_should_profile_production(): 8 | """Uncomment the first two lines to enable GAE Mini Profiler on production for admin accounts""" 9 | # from google.appengine.api import users 10 | # return users.is_current_user_admin() 11 | return False 12 | 13 | 14 | def webapp_add_wsgi_middleware(app): 15 | from google.appengine.ext.appstats import recording 16 | app = recording.appstats_wsgi_middleware(app) 17 | return app 18 | -------------------------------------------------------------------------------- /src/application/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Initialize Flask app 3 | 4 | """ 5 | from flask import Flask 6 | import os 7 | from flask_debugtoolbar import DebugToolbarExtension 8 | from werkzeug.debug import DebuggedApplication 9 | 10 | app = Flask('application') 11 | 12 | if os.getenv('FLASK_CONF') == 'TEST': 13 | app.config.from_object('application.settings.Testing') 14 | 15 | elif 'SERVER_SOFTWARE' in os.environ and os.environ['SERVER_SOFTWARE'].startswith('Dev'): 16 | # Development settings 17 | app.config.from_object('application.settings.Development') 18 | # Flask-DebugToolbar 19 | toolbar = DebugToolbarExtension(app) 20 | 21 | # Google app engine mini profiler 22 | # https://github.com/kamens/gae_mini_profiler 23 | app.wsgi_app = DebuggedApplication(app.wsgi_app, evalex=True) 24 | 25 | from gae_mini_profiler import profiler, templatetags 26 | 27 | @app.context_processor 28 | def inject_profiler(): 29 | return dict(profiler_includes=templatetags.profiler_includes()) 30 | app.wsgi_app = profiler.ProfilerWSGIMiddleware(app.wsgi_app) 31 | else: 32 | app.config.from_object('application.settings.Production') 33 | 34 | # Enable jinja2 loop controls extension 35 | app.jinja_env.add_extension('jinja2.ext.loopcontrols') 36 | 37 | # Pull in URL dispatch routes 38 | import urls 39 | -------------------------------------------------------------------------------- /src/application/decorators.py: -------------------------------------------------------------------------------- 1 | """ 2 | decorators.py 3 | 4 | Decorators for URL handlers 5 | 6 | """ 7 | 8 | from functools import wraps 9 | from google.appengine.api import users 10 | from flask import redirect, request, abort 11 | 12 | 13 | def login_required(func): 14 | """Requires standard login credentials""" 15 | @wraps(func) 16 | def decorated_view(*args, **kwargs): 17 | if not users.get_current_user(): 18 | return redirect(users.create_login_url(request.url)) 19 | return func(*args, **kwargs) 20 | return decorated_view 21 | 22 | 23 | def admin_required(func): 24 | """Requires App Engine admin credentials""" 25 | @wraps(func) 26 | def decorated_view(*args, **kwargs): 27 | if users.get_current_user(): 28 | if not users.is_current_user_admin(): 29 | abort(401) # Unauthorized 30 | return func(*args, **kwargs) 31 | return redirect(users.create_login_url(request.url)) 32 | return decorated_view 33 | -------------------------------------------------------------------------------- /src/application/forms.py: -------------------------------------------------------------------------------- 1 | """ 2 | forms.py 3 | 4 | Web forms based on Flask-WTForms 5 | 6 | See: http://flask.pocoo.org/docs/patterns/wtforms/ 7 | http://wtforms.simplecodes.com/ 8 | 9 | """ 10 | 11 | from flask_wtf import form 12 | from wtforms import fields, validators 13 | from wtforms.ext.appengine.ndb import model_form 14 | 15 | from models import ExampleModel 16 | 17 | 18 | class ClassicExampleForm(form.FlaskForm): 19 | example_name = fields.StringField('Name', validators=[validators.DataRequired()]) 20 | example_description = fields.TextAreaField('Description', validators=[validators.DataRequired()]) 21 | 22 | 23 | # App Engine ndb model form example 24 | ExampleForm = model_form(ExampleModel, form.FlaskForm, field_args={ 25 | 'example_name': dict(validators=[validators.DataRequired()]), 26 | 'example_description': dict(validators=[validators.DataRequired()]), 27 | }) 28 | -------------------------------------------------------------------------------- /src/application/generate_keys.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # encoding: utf-8 3 | """ 4 | generate_keys.py 5 | 6 | Generate CSRF and Session keys, output to secret_keys.py file 7 | 8 | Usage: 9 | generate_keys.py [-f] 10 | 11 | Outputs secret_keys.py file in current folder 12 | 13 | By default, an existing secret_keys file will not be replaced. 14 | Use the '-f' flag to force the new keys to be written to the file 15 | 16 | 17 | """ 18 | 19 | import string 20 | import os.path 21 | 22 | from optparse import OptionParser 23 | from random import choice 24 | from string import Template 25 | 26 | 27 | # File settings 28 | file_name = 'secret_keys.py' 29 | file_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), file_name) 30 | 31 | file_template = Template('''# CSRF- and Session keys 32 | 33 | CSRF_SECRET_KEY = '$csrf_key' 34 | SESSION_KEY = '$session_key' 35 | ''') 36 | 37 | 38 | # Get options from command line 39 | parser = OptionParser() 40 | parser.add_option( 41 | "-f", "--force", dest="force", 42 | help="force overwrite of existing secret_keys file", action="store_true") 43 | parser.add_option( 44 | "-r", "--randomness", dest="randomness", 45 | help="length (randomness) of generated key; default = 24", default=24) 46 | (options, args) = parser.parse_args() 47 | 48 | 49 | def generate_randomkey(length): 50 | """Generate random key, given a number of characters""" 51 | chars = string.letters + string.digits 52 | return ''.join([choice(chars) for i in range(int(length))]) 53 | 54 | 55 | def write_file(contents): 56 | with open(file_path, 'wb') as f: 57 | f.write(contents) 58 | 59 | 60 | def generate_keyfile(csrf_key, session_key): 61 | """Generate random keys for CSRF- and session key""" 62 | output = file_template.safe_substitute(dict( 63 | csrf_key=csrf_key, session_key=session_key 64 | )) 65 | if os.path.exists(file_path): 66 | if options.force is None: 67 | print "Warning: secret_keys.py file exists. Use 'generate_keys.py --force' to force overwrite." 68 | else: 69 | write_file(output) 70 | else: 71 | write_file(output) 72 | 73 | 74 | def main(): 75 | r = options.randomness 76 | csrf_key = generate_randomkey(r) 77 | session_key = generate_randomkey(r) 78 | generate_keyfile(csrf_key, session_key) 79 | 80 | 81 | if __name__ == "__main__": 82 | main() 83 | -------------------------------------------------------------------------------- /src/application/models.py: -------------------------------------------------------------------------------- 1 | """ 2 | models.py 3 | 4 | App Engine datastore models 5 | 6 | """ 7 | 8 | 9 | from google.appengine.ext import ndb 10 | 11 | 12 | class ExampleModel(ndb.Model): 13 | """Example Model""" 14 | example_name = ndb.StringProperty(required=True) 15 | example_description = ndb.TextProperty(required=True) 16 | added_by = ndb.UserProperty() 17 | timestamp = ndb.DateTimeProperty(auto_now_add=True) 18 | -------------------------------------------------------------------------------- /src/application/settings.py: -------------------------------------------------------------------------------- 1 | """ 2 | settings.py 3 | 4 | Configuration for Flask app 5 | 6 | Important: Place your keys in the secret_keys.py module, 7 | which should be kept out of version control. 8 | 9 | """ 10 | from secret_keys import CSRF_SECRET_KEY, SESSION_KEY 11 | 12 | 13 | class Config(object): 14 | # Set secret keys for CSRF protection 15 | SECRET_KEY = CSRF_SECRET_KEY 16 | CSRF_SESSION_KEY = SESSION_KEY 17 | # Flask-Cache settings 18 | CACHE_TYPE = 'gaememcached' 19 | 20 | 21 | class Development(Config): 22 | DEBUG = True 23 | # Flask-DebugToolbar settings 24 | DEBUG_TB_PROFILER_ENABLED = True 25 | DEBUG_TB_INTERCEPT_REDIRECTS = False 26 | CSRF_ENABLED = True 27 | 28 | 29 | class Testing(Config): 30 | TESTING = True 31 | DEBUG = True 32 | CSRF_ENABLED = True 33 | 34 | 35 | class Production(Config): 36 | DEBUG = False 37 | CSRF_ENABLED = True -------------------------------------------------------------------------------- /src/application/static/css/main.css: -------------------------------------------------------------------------------- 1 | 2 | /* Main stylesheet */ 3 | 4 | /* @section forms */ 5 | .btn.cancel { margin-left: 0.5rem; } 6 | .nowrap { white-space: nowrap; } 7 | 8 | /* Your customizations here */ 9 | -------------------------------------------------------------------------------- /src/application/static/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamalgill/flask-appengine-template/11760f83faccbb0d0afe416fc58e67ecfb4643c2/src/application/static/img/favicon.ico -------------------------------------------------------------------------------- /src/application/static/img/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamalgill/flask-appengine-template/11760f83faccbb0d0afe416fc58e67ecfb4643c2/src/application/static/img/favicon.png -------------------------------------------------------------------------------- /src/application/static/js/main.js: -------------------------------------------------------------------------------- 1 | var Utils = { 2 | renderFieldErrorTooltip: function (selector, msg, placement) { 3 | var elem; 4 | if (typeof placement === 'undefined') { 5 | placement = 'right'; // default to right-aligned tooltip 6 | } 7 | elem = $(selector); 8 | elem.tooltip({'title': msg, 'trigger': 'manual', 'placement': placement}); 9 | elem.tooltip('show'); 10 | elem.addClass('error'); 11 | elem.on('focus click', function(e) { 12 | elem.removeClass('error'); 13 | elem.tooltip('hide'); 14 | }); 15 | } 16 | }; 17 | 18 | /* Your custom JavaScript here */ 19 | -------------------------------------------------------------------------------- /src/application/static/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: -------------------------------------------------------------------------------- /src/application/templates/404.html: -------------------------------------------------------------------------------- 1 | 2 | not found 3 | 4 | 15 | 16 |
17 |

Not found

18 |

:(

19 |
-------------------------------------------------------------------------------- /src/application/templates/500.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | 3 | {% block content %} 4 |

Aw, snap

5 |

The server encountered an unexpected error.

6 |

Please try again later.

7 | {% endblock %} 8 | 9 | -------------------------------------------------------------------------------- /src/application/templates/edit_example.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | 3 | {% block content %} 4 |

Edit Example

5 |
7 |
8 | {{ form.hidden_tag() }} 9 | 10 |
11 |
{{ form.example_name.label }}
12 |
13 | {{ form.example_name|safe }} 14 | {% if form.example_name.errors %} 15 |
    16 | {% for error in form.example_name.errors %} 17 |
  • {{ error }}
  • 18 | {% endfor %} 19 |
20 | {% endif %} 21 |
22 |
23 |
 
24 |
25 |
{{ form.example_description.label }}
26 |
27 | {{ form.example_description|safe }} 28 | {% if form.example_description.errors %} 29 |
    30 | {% for error in form.example_description.errors %} 31 |
  • {{ error }}
  • 32 | {% endfor %} 33 |
34 | {% endif %} 35 |
36 |
37 |
 
38 |
39 |
40 | 41 | Cancel 42 |
43 |
44 |
45 |
46 | {% endblock content %} 47 | -------------------------------------------------------------------------------- /src/application/templates/includes/flash_message.html: -------------------------------------------------------------------------------- 1 | {% with messages = get_flashed_messages(with_categories=true) %} 2 | {% if messages %} 3 | {% if category == 'error' %} 4 | {% set icon = 'icon-exclamation-sign' %} 5 | {% elif category == 'success' %} 6 | {% set icon = 'icon-ok-sign' %} 7 | {% else %} 8 | {% set icon = 'icon-info-sign' %} 9 | {% endif %} 10 | {% for category, message in messages %} 11 |
12 |   13 | × 14 | {{ message }} 15 |
16 | {% endfor %} 17 | {% endif %} 18 | {% endwith %} 19 | -------------------------------------------------------------------------------- /src/application/templates/includes/nav.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/application/templates/list_examples_cached.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | 3 | {% block style_block %} 4 | 7 | {% endblock %} 8 | 9 | {% block content %} 10 | 11 |

All Examples

12 |
 
13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | {% for example in examples %} 25 | {% set example_id = example.key.id() %} 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | {% else %} 34 | 35 | {% endfor %} 36 | 37 |
IDNameDescriptionAdded byAdded on
{{ example_id }}{{ example.example_name }}{{ example.example_description }}{{ example.added_by }}{{ example.timestamp.strftime('%b %d, %Y %I:%M %p') }}
No examples yet
38 | 39 | {% endblock content %} 40 | -------------------------------------------------------------------------------- /src/application/templates/new_example.html: -------------------------------------------------------------------------------- 1 | 53 | 54 | -------------------------------------------------------------------------------- /src/application/urls.py: -------------------------------------------------------------------------------- 1 | """ 2 | urls.py 3 | 4 | URL dispatch route mappings and error handlers 5 | 6 | """ 7 | from flask import render_template 8 | 9 | from application import app 10 | 11 | from application.views.public.public_warmup import PublicWarmup 12 | from application.views.public.public_index import PublicIndex 13 | from application.views.public.public_say_hello import PublicSayHello 14 | 15 | from application.views.admin.admin_list_examples import AdminListExamples 16 | from application.views.admin.admin_list_examples_cached import AdminListExamplesCached 17 | from application.views.admin.admin_secret import AdminSecret 18 | from application.views.admin.admin_edit_example import AdminEditExample 19 | from application.views.admin.admin_delete_example import AdminDeleteExample 20 | 21 | 22 | # URL dispatch rules 23 | 24 | # App Engine warm up handler 25 | # See http://code.google.com/appengine/docs/python/config/appconfig.html#Warming_Requests 26 | app.add_url_rule('/_ah/warmup', 'public_warmup', view_func=PublicWarmup.as_view('public_warmup')) 27 | 28 | app.add_url_rule('/', 'public_index', view_func=PublicIndex.as_view('public_index')) 29 | 30 | app.add_url_rule('/hello/', 'public_say_hello', view_func=PublicSayHello.as_view('public_say_hello')) 31 | 32 | app.add_url_rule('/examples', 'list_examples', view_func=AdminListExamples.as_view('list_examples'), methods=['GET', 'POST']) 33 | 34 | app.add_url_rule('/examples/cached', 'cached_examples', view_func=AdminListExamplesCached.as_view('cached_examples')) 35 | 36 | app.add_url_rule('/admin_only', 'admin_only', view_func=AdminSecret.as_view('admin_only')) 37 | 38 | app.add_url_rule('/examples//edit', 'edit_example', view_func=AdminEditExample.as_view('edit_example'), methods=['GET', 'POST']) 39 | 40 | app.add_url_rule('/examples//delete', 'delete_example', view_func=AdminDeleteExample.as_view('delete_example'), methods=['POST']) 41 | 42 | # Error handlers 43 | 44 | # Handle 404 errors 45 | 46 | 47 | @app.errorhandler(404) 48 | def page_not_found(e): 49 | return render_template('404.html'), 404 50 | 51 | # Handle 500 errors 52 | 53 | 54 | @app.errorhandler(500) 55 | def server_error(e): 56 | return render_template('500.html'), 500 57 | -------------------------------------------------------------------------------- /src/application/views/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamalgill/flask-appengine-template/11760f83faccbb0d0afe416fc58e67ecfb4643c2/src/application/views/__init__.py -------------------------------------------------------------------------------- /src/application/views/admin/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamalgill/flask-appengine-template/11760f83faccbb0d0afe416fc58e67ecfb4643c2/src/application/views/admin/__init__.py -------------------------------------------------------------------------------- /src/application/views/admin/admin_delete_example.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from flask import flash, redirect, url_for, request 4 | from flask.views import View 5 | from flask_cache import Cache 6 | 7 | from google.appengine.runtime.apiproxy_errors import CapabilityDisabledError 8 | 9 | from application import app 10 | from models import ExampleModel 11 | from decorators import login_required 12 | 13 | cache = Cache(app) 14 | 15 | 16 | class AdminDeleteExample(View): 17 | 18 | @login_required 19 | def dispatch_request(self, example_id): 20 | example = ExampleModel.get_by_id(example_id) 21 | if request.method == "POST": 22 | try: 23 | example.key.delete() 24 | cache.clear() 25 | flash(u'Example %s successfully deleted.' % example_id, 'success') 26 | return redirect(url_for('list_examples')) 27 | except CapabilityDisabledError: 28 | flash(u'App Engine Datastore is currently in read-only mode.', 'info') 29 | return redirect(url_for('list_examples')) 30 | -------------------------------------------------------------------------------- /src/application/views/admin/admin_edit_example.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from flask import flash, redirect, url_for, render_template, request 4 | from flask.views import View 5 | 6 | from decorators import login_required 7 | from forms import ExampleForm 8 | from models import ExampleModel 9 | 10 | 11 | class AdminEditExample(View): 12 | 13 | @login_required 14 | def dispatch_request(self, example_id): 15 | example = ExampleModel.get_by_id(example_id) 16 | form = ExampleForm(obj=example) 17 | if request.method == "POST": 18 | if form.validate_on_submit(): 19 | example.example_name = form.data.get('example_name') 20 | example.example_description = form.data.get('example_description') 21 | example.put() 22 | flash(u'Example %s successfully saved.' % example_id, 'success') 23 | return redirect(url_for('list_examples')) 24 | return render_template('edit_example.html', example=example, form=form) 25 | -------------------------------------------------------------------------------- /src/application/views/admin/admin_list_examples.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from flask import flash, redirect, url_for, render_template 4 | from flask.views import View 5 | from flask_cache import Cache 6 | 7 | from google.appengine.api import users 8 | from google.appengine.runtime.apiproxy_errors import CapabilityDisabledError 9 | 10 | from application import app 11 | from decorators import login_required 12 | from forms import ExampleForm 13 | from models import ExampleModel 14 | 15 | cache = Cache(app) 16 | 17 | 18 | class AdminListExamples(View): 19 | 20 | @login_required 21 | def dispatch_request(self): 22 | examples = ExampleModel.query() 23 | form = ExampleForm() 24 | if form.validate_on_submit(): 25 | example = ExampleModel( 26 | example_name=form.example_name.data, 27 | example_description=form.example_description.data, 28 | added_by=users.get_current_user() 29 | ) 30 | try: 31 | example.put() 32 | example_id = example.key.id() 33 | cache.clear() 34 | flash(u'Example %s successfully saved.' % example_id, 'success') 35 | return redirect(url_for('list_examples')) 36 | except CapabilityDisabledError: 37 | flash(u'App Engine Datastore is currently in read-only mode.', 'info') 38 | return redirect(url_for('list_examples')) 39 | return render_template('list_examples.html', examples=examples, form=form) 40 | -------------------------------------------------------------------------------- /src/application/views/admin/admin_list_examples_cached.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from flask import render_template 4 | from flask.views import View 5 | from flask_cache import Cache 6 | 7 | from models import ExampleModel 8 | from decorators import login_required 9 | from application import app 10 | 11 | cache = Cache(app) 12 | 13 | 14 | class AdminListExamplesCached(View): 15 | 16 | @login_required 17 | @cache.cached(timeout=60) 18 | def dispatch_request(self): 19 | examples = ExampleModel.query() 20 | return render_template('list_examples_cached.html', examples=examples) 21 | -------------------------------------------------------------------------------- /src/application/views/admin/admin_secret.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from flask.views import View 4 | 5 | from decorators import admin_required 6 | 7 | 8 | class AdminSecret(View): 9 | 10 | @admin_required 11 | def dispatch_request(self): 12 | 13 | return 'Super-seekrit admin page.' 14 | -------------------------------------------------------------------------------- /src/application/views/public/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamalgill/flask-appengine-template/11760f83faccbb0d0afe416fc58e67ecfb4643c2/src/application/views/public/__init__.py -------------------------------------------------------------------------------- /src/application/views/public/public_index.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from flask import redirect, url_for 4 | from flask.views import View 5 | 6 | 7 | class PublicIndex(View): 8 | 9 | def dispatch_request(self): 10 | return redirect(url_for('list_examples')) 11 | -------------------------------------------------------------------------------- /src/application/views/public/public_say_hello.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from flask.views import View 4 | 5 | 6 | class PublicSayHello(View): 7 | 8 | def dispatch_request(self, username): 9 | return "Hello {}".format(username) 10 | -------------------------------------------------------------------------------- /src/application/views/public/public_warmup.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from flask.views import View 4 | 5 | 6 | class PublicWarmup(View): 7 | 8 | def dispatch_request(self): 9 | return "I'm ready" 10 | -------------------------------------------------------------------------------- /src/apptest.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | import os 3 | import sys 4 | import unittest2 5 | import warnings 6 | # silences Python's complaints about imports 7 | warnings.filterwarnings('ignore', category=UserWarning) 8 | 9 | USAGE = """ 10 | Path to your sdk must be the first argument. To run type: 11 | 12 | $ apptest.py path/to/your/appengine/installation 13 | 14 | Remember to set environment variable FLASK_CONF to TEST. 15 | Loading configuration depending on the value of 16 | environment variable allows you to add your own 17 | testing configuration in src/application/settings.py 18 | 19 | """ 20 | 21 | 22 | def main(sdk_path, test_path): 23 | sys.path.insert(0, sdk_path) 24 | import dev_appserver 25 | dev_appserver.fix_sys_path() 26 | sys.path.insert(1, os.path.join(os.path.abspath('.'), 'lib')) 27 | sys.path.insert(1, os.path.join(os.path.abspath('.'), 'application')) 28 | suite = unittest2.loader.TestLoader().discover(test_path) 29 | unittest2.TextTestRunner(verbosity=2).run(suite) 30 | 31 | 32 | if __name__ == '__main__': 33 | #See: http://code.google.com/appengine/docs/python/tools/localunittesting.html 34 | try: 35 | #Path to the SDK installation 36 | SDK_PATH = sys.argv[1] # ...or hardcoded path 37 | #Path to tests folder 38 | TEST_PATH = os.path.join(os.path.dirname(os.path.abspath(__name__)),'tests') 39 | main(SDK_PATH, TEST_PATH) 40 | except IndexError: 41 | # you probably forgot about path as first argument 42 | print USAGE -------------------------------------------------------------------------------- /src/index.yaml: -------------------------------------------------------------------------------- 1 | indexes: 2 | 3 | # AUTOGENERATED 4 | 5 | # This index.yaml is automatically updated whenever the dev_appserver 6 | # detects that a new type of query is run. If you want to manage the 7 | # index.yaml file manually, remove the above marker line (the line 8 | # saying "# AUTOGENERATED"). If you want to manage some indexes 9 | # manually, move them above the marker line. The index.yaml file is 10 | # automatically uploaded to the admin console when you next deploy 11 | # your application using appcfg.py. 12 | -------------------------------------------------------------------------------- /src/lib/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamalgill/flask-appengine-template/11760f83faccbb0d0afe416fc58e67ecfb4643c2/src/lib/__init__.py -------------------------------------------------------------------------------- /src/lib/blinker/__init__.py: -------------------------------------------------------------------------------- 1 | from blinker.base import ( 2 | ANY, 3 | NamedSignal, 4 | Namespace, 5 | Signal, 6 | WeakNamespace, 7 | receiver_connected, 8 | signal, 9 | ) 10 | 11 | __all__ = [ 12 | 'ANY', 13 | 'NamedSignal', 14 | 'Namespace', 15 | 'Signal', 16 | 'WeakNamespace', 17 | 'receiver_connected', 18 | 'signal', 19 | ] 20 | 21 | 22 | __version__ = '1.4' 23 | -------------------------------------------------------------------------------- /src/lib/click/_textwrap.py: -------------------------------------------------------------------------------- 1 | import textwrap 2 | from contextlib import contextmanager 3 | 4 | 5 | class TextWrapper(textwrap.TextWrapper): 6 | 7 | def _handle_long_word(self, reversed_chunks, cur_line, cur_len, width): 8 | space_left = max(width - cur_len, 1) 9 | 10 | if self.break_long_words: 11 | last = reversed_chunks[-1] 12 | cut = last[:space_left] 13 | res = last[space_left:] 14 | cur_line.append(cut) 15 | reversed_chunks[-1] = res 16 | elif not cur_line: 17 | cur_line.append(reversed_chunks.pop()) 18 | 19 | @contextmanager 20 | def extra_indent(self, indent): 21 | old_initial_indent = self.initial_indent 22 | old_subsequent_indent = self.subsequent_indent 23 | self.initial_indent += indent 24 | self.subsequent_indent += indent 25 | try: 26 | yield 27 | finally: 28 | self.initial_indent = old_initial_indent 29 | self.subsequent_indent = old_subsequent_indent 30 | 31 | def indent_only(self, text): 32 | rv = [] 33 | for idx, line in enumerate(text.splitlines()): 34 | indent = self.initial_indent 35 | if idx > 0: 36 | indent = self.subsequent_indent 37 | rv.append(indent + line) 38 | return '\n'.join(rv) 39 | -------------------------------------------------------------------------------- /src/lib/click/globals.py: -------------------------------------------------------------------------------- 1 | from threading import local 2 | 3 | 4 | _local = local() 5 | 6 | 7 | def get_current_context(silent=False): 8 | """Returns the current click context. This can be used as a way to 9 | access the current context object from anywhere. This is a more implicit 10 | alternative to the :func:`pass_context` decorator. This function is 11 | primarily useful for helpers such as :func:`echo` which might be 12 | interested in changing it's behavior based on the current context. 13 | 14 | To push the current context, :meth:`Context.scope` can be used. 15 | 16 | .. versionadded:: 5.0 17 | 18 | :param silent: is set to `True` the return value is `None` if no context 19 | is available. The default behavior is to raise a 20 | :exc:`RuntimeError`. 21 | """ 22 | try: 23 | return getattr(_local, 'stack')[-1] 24 | except (AttributeError, IndexError): 25 | if not silent: 26 | raise RuntimeError('There is no active click context.') 27 | 28 | 29 | def push_context(ctx): 30 | """Pushes a new context to the current stack.""" 31 | _local.__dict__.setdefault('stack', []).append(ctx) 32 | 33 | 34 | def pop_context(): 35 | """Removes the top level from the stack.""" 36 | _local.stack.pop() 37 | 38 | 39 | def resolve_color_default(color=None): 40 | """"Internal helper to get the default value of the color flag. If a 41 | value is passed it's returned unchanged, otherwise it's looked up from 42 | the current context. 43 | """ 44 | if color is not None: 45 | return color 46 | ctx = get_current_context(silent=True) 47 | if ctx is not None: 48 | return ctx.color 49 | -------------------------------------------------------------------------------- /src/lib/flask/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | flask 4 | ~~~~~ 5 | 6 | A microframework based on Werkzeug. It's extensively documented 7 | and follows best practice patterns. 8 | 9 | :copyright: (c) 2015 by Armin Ronacher. 10 | :license: BSD, see LICENSE for more details. 11 | """ 12 | 13 | __version__ = '0.12.2' 14 | 15 | # utilities we import from Werkzeug and Jinja2 that are unused 16 | # in the module but are exported as public interface. 17 | from werkzeug.exceptions import abort 18 | from werkzeug.utils import redirect 19 | from jinja2 import Markup, escape 20 | 21 | from .app import Flask, Request, Response 22 | from .config import Config 23 | from .helpers import url_for, flash, send_file, send_from_directory, \ 24 | get_flashed_messages, get_template_attribute, make_response, safe_join, \ 25 | stream_with_context 26 | from .globals import current_app, g, request, session, _request_ctx_stack, \ 27 | _app_ctx_stack 28 | from .ctx import has_request_context, has_app_context, \ 29 | after_this_request, copy_current_request_context 30 | from .blueprints import Blueprint 31 | from .templating import render_template, render_template_string 32 | 33 | # the signals 34 | from .signals import signals_available, template_rendered, request_started, \ 35 | request_finished, got_request_exception, request_tearing_down, \ 36 | appcontext_tearing_down, appcontext_pushed, \ 37 | appcontext_popped, message_flashed, before_render_template 38 | 39 | # We're not exposing the actual json module but a convenient wrapper around 40 | # it. 41 | from . import json 42 | 43 | # This was the only thing that Flask used to export at one point and it had 44 | # a more generic name. 45 | jsonify = json.jsonify 46 | 47 | # backwards compat, goes away in 1.0 48 | from .sessions import SecureCookieSession as Session 49 | json_available = True 50 | -------------------------------------------------------------------------------- /src/lib/flask/__main__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | flask.__main__ 4 | ~~~~~~~~~~~~~~ 5 | 6 | Alias for flask.run for the command line. 7 | 8 | :copyright: (c) 2015 by Armin Ronacher. 9 | :license: BSD, see LICENSE for more details. 10 | """ 11 | 12 | 13 | if __name__ == '__main__': 14 | from .cli import main 15 | main(as_module=True) 16 | -------------------------------------------------------------------------------- /src/lib/flask/ext/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | flask.ext 4 | ~~~~~~~~~ 5 | 6 | Redirect imports for extensions. This module basically makes it possible 7 | for us to transition from flaskext.foo to flask_foo without having to 8 | force all extensions to upgrade at the same time. 9 | 10 | When a user does ``from flask.ext.foo import bar`` it will attempt to 11 | import ``from flask_foo import bar`` first and when that fails it will 12 | try to import ``from flaskext.foo import bar``. 13 | 14 | We're switching from namespace packages because it was just too painful for 15 | everybody involved. 16 | 17 | :copyright: (c) 2015 by Armin Ronacher. 18 | :license: BSD, see LICENSE for more details. 19 | """ 20 | 21 | 22 | def setup(): 23 | from ..exthook import ExtensionImporter 24 | importer = ExtensionImporter(['flask_%s', 'flaskext.%s'], __name__) 25 | importer.install() 26 | 27 | 28 | setup() 29 | del setup 30 | -------------------------------------------------------------------------------- /src/lib/flask/globals.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | flask.globals 4 | ~~~~~~~~~~~~~ 5 | 6 | Defines all the global objects that are proxies to the current 7 | active context. 8 | 9 | :copyright: (c) 2015 by Armin Ronacher. 10 | :license: BSD, see LICENSE for more details. 11 | """ 12 | 13 | from functools import partial 14 | from werkzeug.local import LocalStack, LocalProxy 15 | 16 | 17 | _request_ctx_err_msg = '''\ 18 | Working outside of request context. 19 | 20 | This typically means that you attempted to use functionality that needed 21 | an active HTTP request. Consult the documentation on testing for 22 | information about how to avoid this problem.\ 23 | ''' 24 | _app_ctx_err_msg = '''\ 25 | Working outside of application context. 26 | 27 | This typically means that you attempted to use functionality that needed 28 | to interface with the current application object in a way. To solve 29 | this set up an application context with app.app_context(). See the 30 | documentation for more information.\ 31 | ''' 32 | 33 | 34 | def _lookup_req_object(name): 35 | top = _request_ctx_stack.top 36 | if top is None: 37 | raise RuntimeError(_request_ctx_err_msg) 38 | return getattr(top, name) 39 | 40 | 41 | def _lookup_app_object(name): 42 | top = _app_ctx_stack.top 43 | if top is None: 44 | raise RuntimeError(_app_ctx_err_msg) 45 | return getattr(top, name) 46 | 47 | 48 | def _find_app(): 49 | top = _app_ctx_stack.top 50 | if top is None: 51 | raise RuntimeError(_app_ctx_err_msg) 52 | return top.app 53 | 54 | 55 | # context locals 56 | _request_ctx_stack = LocalStack() 57 | _app_ctx_stack = LocalStack() 58 | current_app = LocalProxy(_find_app) 59 | request = LocalProxy(partial(_lookup_req_object, 'request')) 60 | session = LocalProxy(partial(_lookup_req_object, 'session')) 61 | g = LocalProxy(partial(_lookup_app_object, 'g')) 62 | -------------------------------------------------------------------------------- /src/lib/flask_cache/_compat.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | flask_cache._compat 4 | ~~~~~~~~~~~~~~~~~~~ 5 | 6 | Some py2/py3 compatibility support based on a stripped down 7 | version of six so we don't have to depend on a specific version 8 | of it. 9 | 10 | :copyright: (c) 2013 by Armin Ronacher. 11 | :license: BSD, see LICENSE for more details. 12 | """ 13 | import sys 14 | 15 | PY2 = sys.version_info[0] == 2 16 | PYPY = hasattr(sys, 'pypy_translation_info') 17 | 18 | 19 | if not PY2: 20 | range_type = range 21 | else: 22 | range_type = xrange 23 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/compat.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | PY2 = sys.version_info[0] == 2 4 | 5 | 6 | if PY2: 7 | iteritems = lambda d: d.iteritems() 8 | else: 9 | iteritems = lambda d: iter(d.items()) 10 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/panels/__init__.py: -------------------------------------------------------------------------------- 1 | """Base DebugPanel class""" 2 | 3 | 4 | class DebugPanel(object): 5 | """ 6 | Base class for debug panels. 7 | """ 8 | # name = Base 9 | 10 | # If content returns something, set to true in subclass 11 | has_content = False 12 | 13 | # If the client is able to activate/de-activate the panel 14 | user_enable = False 15 | 16 | # We'll maintain a local context instance so we can expose our template 17 | # context variables to panels which need them: 18 | context = {} 19 | 20 | # Panel methods 21 | def __init__(self, jinja_env, context={}): 22 | self.context.update(context) 23 | self.jinja_env = jinja_env 24 | 25 | # If the client enabled the panel 26 | self.is_active = False 27 | 28 | def render(self, template_name, context): 29 | template = self.jinja_env.get_template(template_name) 30 | return template.render(**context) 31 | 32 | def dom_id(self): 33 | return 'flDebug%sPanel' % (self.name.replace(' ', '')) 34 | 35 | def nav_title(self): 36 | """Title showing in toolbar""" 37 | raise NotImplementedError 38 | 39 | def nav_subtitle(self): 40 | """Subtitle showing until title in toolbar""" 41 | return '' 42 | 43 | def title(self): 44 | """Title showing in panel""" 45 | raise NotImplementedError 46 | 47 | def url(self): 48 | raise NotImplementedError 49 | 50 | def content(self): 51 | raise NotImplementedError 52 | 53 | # Standard middleware methods 54 | def process_request(self, request): 55 | pass 56 | 57 | def process_view(self, request, view_func, view_kwargs): 58 | pass 59 | 60 | def process_response(self, request, response): 61 | pass 62 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/panels/config_vars.py: -------------------------------------------------------------------------------- 1 | from flask import current_app 2 | from flask_debugtoolbar.panels import DebugPanel 3 | 4 | _ = lambda x: x 5 | 6 | 7 | class ConfigVarsDebugPanel(DebugPanel): 8 | """ 9 | A panel to display all variables from Flask configuration 10 | """ 11 | name = 'ConfigVars' 12 | has_content = True 13 | 14 | def nav_title(self): 15 | return _('Config') 16 | 17 | def title(self): 18 | return _('Config') 19 | 20 | def url(self): 21 | return '' 22 | 23 | def content(self): 24 | context = self.context.copy() 25 | context.update({ 26 | 'config': current_app.config, 27 | }) 28 | 29 | return self.render('panels/config_vars.html', context) 30 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/panels/headers.py: -------------------------------------------------------------------------------- 1 | from flask_debugtoolbar.panels import DebugPanel 2 | 3 | _ = lambda x: x 4 | 5 | 6 | class HeaderDebugPanel(DebugPanel): 7 | """ 8 | A panel to display HTTP headers. 9 | """ 10 | name = 'Header' 11 | has_content = True 12 | # List of headers we want to display 13 | header_filter = ( 14 | 'CONTENT_TYPE', 15 | 'HTTP_ACCEPT', 16 | 'HTTP_ACCEPT_CHARSET', 17 | 'HTTP_ACCEPT_ENCODING', 18 | 'HTTP_ACCEPT_LANGUAGE', 19 | 'HTTP_CACHE_CONTROL', 20 | 'HTTP_CONNECTION', 21 | 'HTTP_HOST', 22 | 'HTTP_KEEP_ALIVE', 23 | 'HTTP_REFERER', 24 | 'HTTP_USER_AGENT', 25 | 'QUERY_STRING', 26 | 'REMOTE_ADDR', 27 | 'REMOTE_HOST', 28 | 'REQUEST_METHOD', 29 | 'SCRIPT_NAME', 30 | 'SERVER_NAME', 31 | 'SERVER_PORT', 32 | 'SERVER_PROTOCOL', 33 | 'SERVER_SOFTWARE', 34 | ) 35 | 36 | def nav_title(self): 37 | return _('HTTP Headers') 38 | 39 | def title(self): 40 | return _('HTTP Headers') 41 | 42 | def url(self): 43 | return '' 44 | 45 | def process_request(self, request): 46 | self.headers = dict( 47 | [(k, request.environ[k]) 48 | for k in self.header_filter if k in request.environ] 49 | ) 50 | 51 | def content(self): 52 | context = self.context.copy() 53 | context.update({ 54 | 'headers': self.headers 55 | }) 56 | return self.render('panels/headers.html', context) 57 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/panels/request_vars.py: -------------------------------------------------------------------------------- 1 | from flask import session 2 | 3 | from flask_debugtoolbar.panels import DebugPanel 4 | 5 | _ = lambda x: x 6 | 7 | 8 | class RequestVarsDebugPanel(DebugPanel): 9 | """ 10 | A panel to display request variables (POST/GET, session, cookies). 11 | """ 12 | name = 'RequestVars' 13 | has_content = True 14 | 15 | def nav_title(self): 16 | return _('Request Vars') 17 | 18 | def title(self): 19 | return _('Request Vars') 20 | 21 | def url(self): 22 | return '' 23 | 24 | def process_request(self, request): 25 | self.request = request 26 | self.session = session 27 | self.view_func = None 28 | self.view_args = [] 29 | self.view_kwargs = {} 30 | 31 | def process_view(self, request, view_func, view_kwargs): 32 | self.view_func = view_func 33 | self.view_kwargs = view_kwargs 34 | 35 | def content(self): 36 | context = self.context.copy() 37 | context.update({ 38 | 'get': self.request.args.lists(), 39 | 'post': self.request.form.lists(), 40 | 'cookies': self.request.cookies.items(), 41 | 'view_func': ('%s.%s' % (self.view_func.__module__, 42 | self.view_func.__name__) 43 | if self.view_func else '[unknown]'), 44 | 'view_args': self.view_args, 45 | 'view_kwargs': self.view_kwargs or {}, 46 | 'session': self.session.items(), 47 | }) 48 | 49 | return self.render('panels/request_vars.html', context) 50 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/panels/route_list.py: -------------------------------------------------------------------------------- 1 | from flask_debugtoolbar.panels import DebugPanel 2 | from flask import current_app 3 | 4 | _ = lambda x: x 5 | 6 | 7 | class RouteListDebugPanel(DebugPanel): 8 | """ 9 | Panel that displays the URL routing rules. 10 | """ 11 | name = 'RouteList' 12 | has_content = True 13 | routes = [] 14 | 15 | def nav_title(self): 16 | return _('Route List') 17 | 18 | def title(self): 19 | return _('Route List') 20 | 21 | def url(self): 22 | return '' 23 | 24 | def nav_subtitle(self): 25 | count = len(self.routes) 26 | return '%s %s' % (count, 'route' if count == 1 else 'routes') 27 | 28 | def process_request(self, request): 29 | self.routes = list(current_app.url_map.iter_rules()) 30 | 31 | def content(self): 32 | return self.render('panels/route_list.html', { 33 | 'routes': self.routes, 34 | }) 35 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/panels/versions.py: -------------------------------------------------------------------------------- 1 | import os 2 | from distutils.sysconfig import get_python_lib 3 | 4 | from flask import __version__ as flask_version 5 | from flask_debugtoolbar.panels import DebugPanel 6 | 7 | _ = lambda x: x 8 | 9 | 10 | def relpath(location, python_lib): 11 | location = os.path.normpath(location) 12 | relative = os.path.relpath(location, python_lib) 13 | if relative == os.path.curdir: 14 | return '' 15 | elif relative.startswith(os.path.pardir): 16 | return location 17 | return relative 18 | 19 | 20 | class VersionDebugPanel(DebugPanel): 21 | """ 22 | Panel that displays the Flask version. 23 | """ 24 | name = 'Version' 25 | has_content = True 26 | 27 | def nav_title(self): 28 | return _('Versions') 29 | 30 | def nav_subtitle(self): 31 | return 'Flask %s' % flask_version 32 | 33 | def url(self): 34 | return '' 35 | 36 | def title(self): 37 | return _('Versions') 38 | 39 | def content(self): 40 | try: 41 | import pkg_resources 42 | except ImportError: 43 | packages = [] 44 | else: 45 | packages = sorted(pkg_resources.working_set, 46 | key=lambda p: p.project_name.lower()) 47 | 48 | return self.render('panels/versions.html', { 49 | 'packages': packages, 50 | 'python_lib': os.path.normpath(get_python_lib()), 51 | 'relpath': relpath, 52 | }) 53 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/codemirror/mode/clojure/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: Clojure mode 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |

CodeMirror: Clojure mode

13 |
59 | 62 | 63 |

MIME types defined: text/x-clojure.

64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/codemirror/mode/coffeescript/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2011 Jeff Pickhardt 4 | Modified from the Python CodeMirror mode, Copyright (c) 2010 Timothy Farrell 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/codemirror/mode/css/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: CSS mode 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |

CodeMirror: CSS mode

13 |
48 | 51 | 52 |

MIME types defined: text/css.

53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/codemirror/mode/diff/diff.css: -------------------------------------------------------------------------------- 1 | span.cm-rangeinfo {color: #a0b;} 2 | span.cm-minus {color: red;} 3 | span.cm-plus {color: #2b2;} 4 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/codemirror/mode/diff/diff.js: -------------------------------------------------------------------------------- 1 | CodeMirror.defineMode("diff", function() { 2 | return { 3 | token: function(stream) { 4 | var ch = stream.next(); 5 | stream.skipToEnd(); 6 | if (ch == "+") return "plus"; 7 | if (ch == "-") return "minus"; 8 | if (ch == "@") return "rangeinfo"; 9 | } 10 | }; 11 | }); 12 | 13 | CodeMirror.defineMIME("text/x-diff", "diff"); 14 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/codemirror/mode/ecl/index.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | CodeMirror: ECL mode 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |

CodeMirror: ECL mode

13 |
31 | 37 | 38 |

Based on CodeMirror's clike mode. For more information see HPCC Systems web site.

39 |

MIME types defined: text/x-ecl.

40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/codemirror/mode/gfm/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: GFM mode 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |

CodeMirror: GFM mode

17 | 18 | 19 |
36 | 37 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/codemirror/mode/go/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: Go mode 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |

CodeMirror: Go mode

14 | 15 |
58 | 59 | 69 | 70 |

MIME type: text/x-go

71 | 72 | 73 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/codemirror/mode/groovy/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: Groovy mode 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |

CodeMirror: Groovy mode

13 | 14 |
60 | 61 | 68 | 69 |

MIME types defined: text/x-groovy

70 | 71 | 72 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/codemirror/mode/haskell/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: Haskell mode 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |

CodeMirror: Haskell mode

14 | 15 |
49 | 50 | 57 | 58 |

MIME types defined: text/x-haskell.

59 | 60 | 61 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/codemirror/mode/htmlembedded/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: Html Embedded Scripts mode 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |

CodeMirror: Html Embedded Scripts mode

17 | 18 |
30 | 31 | 42 | 43 |

Mode for html embedded scripts like JSP and ASP.NET. Depends on HtmlMixed which in turn depends on 44 | JavaScript, CSS and XML.
Other dependancies include those of the scriping language chosen.

45 | 46 |

MIME types defined: application/x-aspx (ASP.NET), 47 | application/x-ejs (Embedded Javascript), application/x-jsp (JavaServer Pages)

48 | 49 | 50 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/codemirror/mode/htmlmixed/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: HTML mixed mode 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |

CodeMirror: HTML mixed mode

16 |
40 | 43 | 44 |

The HTML mixed mode depends on the XML, JavaScript, and CSS modes.

45 | 46 |

MIME types defined: text/html 47 | (redefined, only takes effect if you load this parser after the 48 | XML parser).

49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/codemirror/mode/jinja2/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: Jinja2 mode 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |

CodeMirror: Jinja2 mode

13 |
31 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/codemirror/mode/jinja2/jinja2.js: -------------------------------------------------------------------------------- 1 | CodeMirror.defineMode("jinja2", function(config, parserConf) { 2 | var keywords = ["block", "endblock", "for", "endfor", "in", "true", "false", 3 | "loop", "none", "self", "super", "if", "as", "not", "and", 4 | "else", "import", "with", "without", "context", 'extends', 'macro', 'endmacro']; 5 | 6 | var blocks = ['block', 'for', 'if', 'import', 'with', 'macro', 'raw', 'call', 'filter']; 7 | // TODO raw should stop highlighting until the endraw 8 | var standalone = ['extends', 'import', 'else', 'elif', 'from', 'include', 'set']; 9 | var special = ['in', 'is', 'true', 'false', 'loop', 'none', 'self', 'super', 10 | 'as', 'not', 'and', 'if', 'else', 'without', 'with', 11 | 'context', 'ignore', 'missing', 'import']; 12 | // TODO list builtin filters and tests 13 | 14 | keywords = new RegExp("^((" + keywords.join(")|(") + "))\\b"); 15 | 16 | function tokenBase (stream, state) { 17 | var ch = stream.next(); 18 | if (ch == "{") { 19 | if (ch = stream.eat(/\{|%|#/)) { 20 | stream.eat("-"); 21 | state.tokenize = inTag(ch); 22 | return "tag"; 23 | } 24 | } 25 | } 26 | function inTag (close) { 27 | if (close == "{") { 28 | close = "}"; 29 | } 30 | return function (stream, state) { 31 | var ch = stream.next(); 32 | if ((ch == close || (ch == "-" && stream.eat(close))) 33 | && stream.eat("}")) { 34 | state.tokenize = tokenBase; 35 | return "tag"; 36 | } 37 | if (stream.match(keywords)) { 38 | return "keyword"; 39 | } 40 | return close == "#" ? "comment" : "string"; 41 | }; 42 | } 43 | return { 44 | startState: function () { 45 | return {tokenize: tokenBase}; 46 | }, 47 | token: function (stream, state) { 48 | return state.tokenize(stream, state); 49 | } 50 | }; 51 | }); 52 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/codemirror/mode/lua/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: Lua mode 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |

CodeMirror: Lua mode

14 |
55 | 62 | 63 |

Loosely based on Franciszek 64 | Wawrzak's CodeMirror 65 | 1 mode. One configuration parameter is 66 | supported, specials, to which you can provide an 67 | array of strings to have those identifiers highlighted with 68 | the lua-special style.

69 |

MIME types defined: text/x-lua.

70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/codemirror/mode/mysql/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: MySQL mode 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |

CodeMirror: MySQL mode

13 |
30 | 37 | 38 |

MIME types defined: text/x-mysql.

39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/codemirror/mode/ntriples/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: NTriples mode 5 | 6 | 7 | 8 | 9 | 14 | 15 | 16 |

CodeMirror: NTriples mode

17 |
18 | 25 |
26 | 27 | 30 |

MIME types defined: text/n-triples.

31 | 32 | 33 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/codemirror/mode/pascal/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011 souceLair 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/codemirror/mode/pascal/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: Pascal mode 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |

CodeMirror: Pascal mode

13 | 14 |
37 | 38 | 45 | 46 |

MIME types defined: text/x-pascal.

47 | 48 | 49 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/codemirror/mode/perl/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2011 by Sabaca under the MIT license. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/codemirror/mode/perl/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: Perl mode 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |

CodeMirror: Perl mode

13 | 14 |
52 | 53 | 59 | 60 |

MIME types defined: text/x-perl.

61 | 62 | 63 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/codemirror/mode/php/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: PHP mode 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |

CodeMirror: PHP mode

17 | 18 |
29 | 30 | 41 | 42 |

Simple HTML/PHP mode based on 43 | the C-like mode. Depends on XML, 44 | JavaScript, CSS, and C-like modes.

45 | 46 |

MIME types defined: application/x-httpd-php (HTML with PHP code), text/x-php (plain, non-wrapped PHP code).

47 | 48 | 49 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/codemirror/mode/plsql/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: Oracle PL/SQL mode 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |

CodeMirror: Oracle PL/SQL mode

13 | 14 |
46 | 47 | 55 | 56 |

57 | Simple mode that handles Oracle PL/SQL language (and Oracle SQL, of course). 58 |

59 | 60 |

MIME type defined: text/x-plsql 61 | (PLSQL code) 62 | 63 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/codemirror/mode/properties/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: Properties files mode 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |

CodeMirror: Properties files mode

13 |
32 | 35 | 36 |

MIME types defined: text/x-properties, 37 | text/x-ini.

38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/codemirror/mode/properties/properties.js: -------------------------------------------------------------------------------- 1 | CodeMirror.defineMode("properties", function() { 2 | return { 3 | token: function(stream, state) { 4 | var sol = stream.sol() || state.afterSection; 5 | var eol = stream.eol(); 6 | 7 | state.afterSection = false; 8 | 9 | if (sol) { 10 | if (state.nextMultiline) { 11 | state.inMultiline = true; 12 | state.nextMultiline = false; 13 | } else { 14 | state.position = "def"; 15 | } 16 | } 17 | 18 | if (eol && ! state.nextMultiline) { 19 | state.inMultiline = false; 20 | state.position = "def"; 21 | } 22 | 23 | if (sol) { 24 | while(stream.eatSpace()); 25 | } 26 | 27 | var ch = stream.next(); 28 | 29 | if (sol && (ch === "#" || ch === "!" || ch === ";")) { 30 | state.position = "comment"; 31 | stream.skipToEnd(); 32 | return "comment"; 33 | } else if (sol && ch === "[") { 34 | state.afterSection = true; 35 | stream.skipTo("]"); stream.eat("]"); 36 | return "header"; 37 | } else if (ch === "=" || ch === ":") { 38 | state.position = "quote"; 39 | return null; 40 | } else if (ch === "\\" && state.position === "quote") { 41 | if (stream.next() !== "u") { // u = Unicode sequence \u1234 42 | // Multiline value 43 | state.nextMultiline = true; 44 | } 45 | } 46 | 47 | return state.position; 48 | }, 49 | 50 | startState: function() { 51 | return { 52 | position : "def", // Current position, "def", "quote" or "comment" 53 | nextMultiline : false, // Is the next line multiline value 54 | inMultiline : false, // Is the current line a multiline value 55 | afterSection : false // Did we just open a section 56 | }; 57 | } 58 | 59 | }; 60 | }); 61 | 62 | CodeMirror.defineMIME("text/x-properties", "properties"); 63 | CodeMirror.defineMIME("text/x-ini", "properties"); 64 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/codemirror/mode/python/LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2010 Timothy Farrell 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/codemirror/mode/r/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011, Ubalo, Inc. 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of the Ubalo, Inc nor the names of its 12 | contributors may be used to endorse or promote products derived 13 | from this software without specific prior written permission. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL UBALO, INC BE LIABLE FOR ANY 19 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/codemirror/mode/rpm/changes/changes.js: -------------------------------------------------------------------------------- 1 | CodeMirror.defineMode("changes", function(config, modeConfig) { 2 | var headerSeperator = /^-+$/; 3 | var headerLine = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ?\d{1,2} \d{2}:\d{2}(:\d{2})? [A-Z]{3,4} \d{4} - /; 4 | var simpleEmail = /^[\w+.-]+@[\w.-]+/; 5 | 6 | return { 7 | token: function(stream) { 8 | if (stream.sol()) { 9 | if (stream.match(headerSeperator)) { return 'tag'; } 10 | if (stream.match(headerLine)) { return 'tag'; } 11 | } 12 | if (stream.match(simpleEmail)) { return 'string'; } 13 | stream.next(); 14 | return null; 15 | } 16 | }; 17 | }); 18 | 19 | CodeMirror.defineMIME("text/x-rpm-changes", "changes"); 20 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/codemirror/mode/rpm/changes/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: RPM changes mode 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |

CodeMirror: RPM changes mode

13 | 14 |
41 | 50 | 51 |

MIME types defined: text/x-rpm-changes.

52 | 53 | 54 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/codemirror/mode/rpm/spec/spec.css: -------------------------------------------------------------------------------- 1 | .cm-s-default span.cm-preamble {color: #b26818; font-weight: bold;} 2 | .cm-s-default span.cm-macro {color: #b218b2;} 3 | .cm-s-default span.cm-section {color: green; font-weight: bold;} 4 | .cm-s-default span.cm-script {color: red;} 5 | .cm-s-default span.cm-issue {color: yellow;} 6 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/codemirror/mode/ruby/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011, Ubalo, Inc. 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of the Ubalo, Inc. nor the names of its 12 | contributors may be used to endorse or promote products derived 13 | from this software without specific prior written permission. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL UBALO, INC BE LIABLE FOR ANY 19 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/codemirror/mode/rust/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: Rust mode 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |

CodeMirror: Rust mode

13 | 14 |
37 | 38 | 45 | 46 |

MIME types defined: text/x-rustsrc.

47 | 48 | 49 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/codemirror/mode/smalltalk/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: Smalltalk mode 5 | 6 | 7 | 8 | 9 | 14 | 15 | 16 |

CodeMirror: Smalltalk mode

17 | 18 |
41 | 42 | 50 | 51 |

Simple Smalltalk mode.

52 | 53 |

MIME types defined: text/x-stsrc.

54 | 55 | 56 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/codemirror/mode/sparql/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: SPARQL mode 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |

CodeMirror: SPARQL mode

13 |
29 | 36 | 37 |

MIME types defined: application/x-sparql-query.

38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/codemirror/mode/tiddlywiki/tiddlywiki.css: -------------------------------------------------------------------------------- 1 | .cm-s-default span.cm-header {color: blue; font-weight:bold;} 2 | .cm-s-default span.cm-code {color: #a50;} 3 | .cm-s-default span.cm-code-inline {color: #660;} 4 | 5 | .cm-s-default span.cm-quote {color: #555;} 6 | .cm-s-default span.cm-list {color: #c60;} 7 | .cm-s-default span.cm-hr {color: #999;} 8 | .cm-s-default span.cm-em {font-style: italic;} 9 | .cm-s-default span.cm-strong {font-weight: bold;} 10 | 11 | .cm-s-default span.cm-link-external {color: blue;} 12 | .cm-s-default span.cm-brace {color: #170; font-weight: bold;} 13 | .cm-s-default span.cm-macro {color: #9E3825;} 14 | .cm-s-default span.cm-table {color: blue; font-weight: bold;} 15 | .cm-s-default span.cm-warning {color: red; font-weight: bold;} 16 | 17 | .cm-s-default span.cm-underlined {text-decoration: underline;} 18 | .cm-s-default span.cm-line-through {text-decoration: line-through;} 19 | 20 | .cm-s-default span.cm-comment {color: #666;} 21 | 22 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/codemirror/mode/vbscript/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: VBScript mode 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |

CodeMirror: VBScript mode

13 | 14 |
31 | 32 | 38 | 39 |

MIME types defined: text/vbscript.

40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/codemirror/mode/vbscript/vbscript.js: -------------------------------------------------------------------------------- 1 | CodeMirror.defineMode("vbscript", function() { 2 | var regexVBScriptKeyword = /^(?:Call|Case|CDate|Clear|CInt|CLng|Const|CStr|Description|Dim|Do|Each|Else|ElseIf|End|Err|Error|Exit|False|For|Function|If|LCase|Loop|LTrim|Next|Nothing|Now|Number|On|Preserve|Quit|ReDim|Resume|RTrim|Select|Set|Sub|Then|To|Trim|True|UBound|UCase|Until|VbCr|VbCrLf|VbLf|VbTab)$/im; 3 | 4 | return { 5 | token: function(stream) { 6 | if (stream.eatSpace()) return null; 7 | var ch = stream.next(); 8 | if (ch == "'") { 9 | stream.skipToEnd(); 10 | return "comment"; 11 | } 12 | if (ch == '"') { 13 | stream.skipTo('"'); 14 | return "string"; 15 | } 16 | 17 | if (/\w/.test(ch)) { 18 | stream.eatWhile(/\w/); 19 | if (regexVBScriptKeyword.test(stream.current())) return "keyword"; 20 | } 21 | return null; 22 | } 23 | }; 24 | }); 25 | 26 | CodeMirror.defineMIME("text/vbscript", "vbscript"); 27 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/codemirror/mode/xml/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: XML mode 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |

CodeMirror: XML mode

13 |
25 | 31 |

The XML mode supports two configuration parameters:

32 |
33 |
htmlMode (boolean)
34 |
This switches the mode to parse HTML instead of XML. This 35 | means attributes do not have to be quoted, and some elements 36 | (such as br) do not require a closing tag.
37 |
alignCDATA (boolean)
38 |
Setting this to true will force the opening tag of CDATA 39 | blocks to not be indented.
40 |
41 | 42 |

MIME types defined: application/xml, text/html.

43 | 44 | 45 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/codemirror/mode/xquery/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2011 by MarkLogic Corporation 2 | Author: Mike Brevoort 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/codemirror/mode/xquery/test/index.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |

XQuery CodeMirror Mode

21 |

22 |

23 |
    24 |
25 |
26 | 27 | 28 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/codemirror/mode/xquery/test/testEmptySequenceKeyword.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function(){ 2 | module("testEmptySequenceKeyword"); 3 | test("testEmptySequenceKeyword", function() { 4 | expect(1); 5 | 6 | var input = '"foo" instance of empty-sequence()'; 7 | var expected = '"foo" instance of empty-sequence()'; 8 | 9 | $("#sandbox").html(''); 10 | var editor = CodeMirror.fromTextArea($("#editor")[0]); 11 | var result = $(".CodeMirror-lines div div pre")[0].innerHTML; 12 | 13 | equal(result, expected); 14 | $("#editor").html(""); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/codemirror/mode/xquery/test/testMultiAttr.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function(){ 2 | module("testMultiAttr"); 3 | test("test1", function() { 4 | expect(1); 5 | 6 | var expected = '<p a1="foo" a2="bar">hello world</p>'; 7 | 8 | $("#sandbox").html(''); 9 | $("#editor").html('

hello world

'); 10 | var editor = CodeMirror.fromTextArea($("#editor")[0]); 11 | var result = $(".CodeMirror-lines div div pre")[0].innerHTML; 12 | 13 | equal(result, expected); 14 | $("#editor").html(""); 15 | }); 16 | }); -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/codemirror/mode/xquery/test/testProcessingInstructions.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function(){ 2 | module("testProcessingInstructions"); 3 | test("testProcessingInstructions", function() { 4 | expect(1); 5 | 6 | var input = 'data() instance of xs:string'; 7 | var expected = 'data(<?target content?>) instance of xs:string'; 8 | 9 | $("#sandbox").html(''); 10 | var editor = CodeMirror.fromTextArea($("#editor")[0]); 11 | var result = $(".CodeMirror-lines div div pre")[0].innerHTML; 12 | 13 | equal(result, expected); 14 | $("#editor").html(""); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/codemirror/mode/xquery/test/testQuotes.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function(){ 2 | module("testQuoteEscape"); 3 | test("testQuoteEscapeDouble", function() { 4 | expect(1); 5 | 6 | var input = 'let $rootfolder := "c:\\builds\\winnt\\HEAD\\qa\\scripts\\"\ 7 | let $keysfolder := concat($rootfolder, "keys\\")\ 8 | return\ 9 | $keysfolder'; 10 | var expected = 'let $rootfolder := "c:\\builds\\winnt\\HEAD\\qa\\scripts\\"let $keysfolder := concat($rootfolder, "keys\\")return$keysfolder'; 11 | 12 | $("#sandbox").html(''); 13 | var editor = CodeMirror.fromTextArea($("#editor")[0]); 14 | var result = $(".CodeMirror-lines div div pre")[0].innerHTML; 15 | 16 | equal(result, expected); 17 | $("#editor").html(""); 18 | }); 19 | }); 20 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/codemirror/mode/yaml/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CodeMirror: YAML mode 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |

CodeMirror: YAML mode

13 |
60 | 63 | 64 |

MIME types defined: text/x-yaml.

65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/codemirror/theme/cobalt.css: -------------------------------------------------------------------------------- 1 | .cm-s-cobalt { background: #002240; color: white; } 2 | .cm-s-cobalt div.CodeMirror-selected { background: #b36539 !important; } 3 | .cm-s-cobalt .CodeMirror-gutter { background: #002240; border-right: 1px solid #aaa; } 4 | .cm-s-cobalt .CodeMirror-gutter-text { color: #d0d0d0; } 5 | .cm-s-cobalt .CodeMirror-cursor { border-left: 1px solid white !important; } 6 | 7 | .cm-s-cobalt span.cm-comment { color: #08f; } 8 | .cm-s-cobalt span.cm-atom { color: #845dc4; } 9 | .cm-s-cobalt span.cm-number, .cm-s-cobalt span.cm-attribute { color: #ff80e1; } 10 | .cm-s-cobalt span.cm-keyword { color: #ffee80; } 11 | .cm-s-cobalt span.cm-string { color: #3ad900; } 12 | .cm-s-cobalt span.cm-meta { color: #ff9d00; } 13 | .cm-s-cobalt span.cm-variable-2, .cm-s-cobalt span.cm-tag { color: #9effff; } 14 | .cm-s-cobalt span.cm-variable-3, .cm-s-cobalt span.cm-def { color: white; } 15 | .cm-s-cobalt span.cm-error { color: #9d1e15; } 16 | .cm-s-cobalt span.cm-bracket { color: #d8d8d8; } 17 | .cm-s-cobalt span.cm-builtin, .cm-s-cobalt span.cm-special { color: #ff9e59; } 18 | .cm-s-cobalt span.cm-link { color: #845dc4; } 19 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/codemirror/theme/eclipse.css: -------------------------------------------------------------------------------- 1 | .cm-s-eclipse span.cm-meta {color: #FF1717;} 2 | .cm-s-eclipse span.cm-keyword { line-height: 1em; font-weight: bold; color: #7F0055; } 3 | .cm-s-eclipse span.cm-atom {color: #219;} 4 | .cm-s-eclipse span.cm-number {color: #164;} 5 | .cm-s-eclipse span.cm-def {color: #00f;} 6 | .cm-s-eclipse span.cm-variable {color: black;} 7 | .cm-s-eclipse span.cm-variable-2 {color: #0000C0;} 8 | .cm-s-eclipse span.cm-variable-3 {color: #0000C0;} 9 | .cm-s-eclipse span.cm-property {color: black;} 10 | .cm-s-eclipse span.cm-operator {color: black;} 11 | .cm-s-eclipse span.cm-comment {color: #3F7F5F;} 12 | .cm-s-eclipse span.cm-string {color: #2A00FF;} 13 | .cm-s-eclipse span.cm-string-2 {color: #f50;} 14 | .cm-s-eclipse span.cm-error {color: #f00;} 15 | .cm-s-eclipse span.cm-qualifier {color: #555;} 16 | .cm-s-eclipse span.cm-builtin {color: #30a;} 17 | .cm-s-eclipse span.cm-bracket {color: #cc7;} 18 | .cm-s-eclipse span.cm-tag {color: #170;} 19 | .cm-s-eclipse span.cm-attribute {color: #00c;} 20 | .cm-s-eclipse span.cm-link {color: #219;} 21 | 22 | .cm-s-eclipse .CodeMirror-matchingbracket { 23 | border:1px solid grey; 24 | color:black !important;; 25 | } 26 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/codemirror/theme/elegant.css: -------------------------------------------------------------------------------- 1 | .cm-s-elegant span.cm-number, .cm-s-elegant span.cm-string, .cm-s-elegant span.cm-atom {color: #762;} 2 | .cm-s-elegant span.cm-comment {color: #262; font-style: italic; line-height: 1em;} 3 | .cm-s-elegant span.cm-meta {color: #555; font-style: italic; line-height: 1em;} 4 | .cm-s-elegant span.cm-variable {color: black;} 5 | .cm-s-elegant span.cm-variable-2 {color: #b11;} 6 | .cm-s-elegant span.cm-qualifier {color: #555;} 7 | .cm-s-elegant span.cm-keyword {color: #730;} 8 | .cm-s-elegant span.cm-builtin {color: #30a;} 9 | .cm-s-elegant span.cm-error {background-color: #fdd;} 10 | .cm-s-elegant span.cm-link {color: #762;} 11 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/codemirror/theme/lesser-dark.css: -------------------------------------------------------------------------------- 1 | /* 2 | http://lesscss.org/ dark theme 3 | Ported to CodeMirror by Peter Kroon 4 | */ 5 | .CodeMirror{ 6 | line-height: 15px; 7 | } 8 | .cm-s-lesser-dark { 9 | font-family: 'Bitstream Vera Sans Mono', 'DejaVu Sans Mono', 'Monaco', Courier, monospace !important; 10 | font-size:12px; 11 | } 12 | 13 | .cm-s-lesser-dark { background: #262626; color: #EBEFE7; text-shadow: 0 -1px 1px #262626; } 14 | .cm-s-lesser-dark div.CodeMirror-selected {background: #45443B !important;} /* 33322B*/ 15 | .cm-s-lesser-dark .CodeMirror-cursor { border-left: 1px solid white !important; } 16 | .cm-s-lesser-dark .CodeMirror-lines { margin-left:3px; margin-right:3px; }/*editable code holder*/ 17 | 18 | div.CodeMirror span.CodeMirror-matchingbracket { color: #7EFC7E; }/*65FC65*/ 19 | 20 | .cm-s-lesser-dark .CodeMirror-gutter { background: #262626; border-right:1px solid #aaa; padding-right:3px; min-width:2.5em; } 21 | .cm-s-lesser-dark .CodeMirror-gutter-text { color: #777; } 22 | 23 | .cm-s-lesser-dark span.cm-keyword { color: #599eff; } 24 | .cm-s-lesser-dark span.cm-atom { color: #C2B470; } 25 | .cm-s-lesser-dark span.cm-number { color: #B35E4D; } 26 | .cm-s-lesser-dark span.cm-def {color: color: white;} 27 | .cm-s-lesser-dark span.cm-variable { color:#D9BF8C; } 28 | .cm-s-lesser-dark span.cm-variable-2 { color: #669199; } 29 | .cm-s-lesser-dark span.cm-variable-3 { color: white; } 30 | .cm-s-lesser-dark span.cm-property {color: #92A75C;} 31 | .cm-s-lesser-dark span.cm-operator {color: #92A75C;} 32 | .cm-s-lesser-dark span.cm-comment { color: #666; } 33 | .cm-s-lesser-dark span.cm-string { color: #BCD279; } 34 | .cm-s-lesser-dark span.cm-string-2 {color: #f50;} 35 | .cm-s-lesser-dark span.cm-meta { color: #738C73; } 36 | .cm-s-lesser-dark span.cm-error { color: #9d1e15; } 37 | .cm-s-lesser-dark span.cm-qualifier {color: #555;} 38 | .cm-s-lesser-dark span.cm-builtin { color: #ff9e59; } 39 | .cm-s-lesser-dark span.cm-bracket { color: #EBEFE7; } 40 | .cm-s-lesser-dark span.cm-tag { color: #669199; } 41 | .cm-s-lesser-dark span.cm-attribute {color: #00c;} 42 | .cm-s-lesser-dark span.cm-header {color: #a0a;} 43 | .cm-s-lesser-dark span.cm-quote {color: #090;} 44 | .cm-s-lesser-dark span.cm-hr {color: #999;} 45 | .cm-s-lesser-dark span.cm-link {color: #00c;} 46 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/codemirror/theme/monokai.css: -------------------------------------------------------------------------------- 1 | /* Based on Sublime Text's Monokai theme */ 2 | 3 | .cm-s-monokai {background: #272822; color: #f8f8f2;} 4 | .cm-s-monokai div.CodeMirror-selected {background: #49483E !important;} 5 | .cm-s-monokai .CodeMirror-gutter {background: #272822; border-right: 0px;} 6 | .cm-s-monokai .CodeMirror-gutter-text {color: #d0d0d0;} 7 | .cm-s-monokai .CodeMirror-cursor {border-left: 1px solid #f8f8f0 !important;} 8 | 9 | .cm-s-monokai span.cm-comment {color: #75715e;} 10 | .cm-s-monokai span.cm-atom {color: #ae81ff;} 11 | .cm-s-monokai span.cm-number {color: #ae81ff;} 12 | 13 | .cm-s-monokai span.cm-property, .cm-s-monokai span.cm-attribute {color: #a6e22e;} 14 | .cm-s-monokai span.cm-keyword {color: #f92672;} 15 | .cm-s-monokai span.cm-string {color: #e6db74;} 16 | 17 | .cm-s-monokai span.cm-variable {color: #a6e22e;} 18 | .cm-s-monokai span.cm-variable-2 {color: #9effff;} 19 | .cm-s-monokai span.cm-def {color: #fd971f;} 20 | .cm-s-monokai span.cm-error {background: #f92672; color: #f8f8f0;} 21 | .cm-s-monokai span.cm-bracket {color: #f8f8f2;} 22 | .cm-s-monokai span.cm-tag {color: #f92672;} 23 | .cm-s-monokai span.cm-link {color: #ae81ff;} 24 | 25 | .cm-s-monokai .CodeMirror-matchingbracket { 26 | text-decoration: underline; 27 | color: white !important; 28 | } 29 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/codemirror/theme/neat.css: -------------------------------------------------------------------------------- 1 | .cm-s-neat span.cm-comment { color: #a86; } 2 | .cm-s-neat span.cm-keyword { line-height: 1em; font-weight: bold; color: blue; } 3 | .cm-s-neat span.cm-string { color: #a22; } 4 | .cm-s-neat span.cm-builtin { line-height: 1em; font-weight: bold; color: #077; } 5 | .cm-s-neat span.cm-special { line-height: 1em; font-weight: bold; color: #0aa; } 6 | .cm-s-neat span.cm-variable { color: black; } 7 | .cm-s-neat span.cm-number, .cm-s-neat span.cm-atom { color: #3a3; } 8 | .cm-s-neat span.cm-meta {color: #555;} 9 | .cm-s-neat span.cm-link { color: #3a3; } 10 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/codemirror/theme/night.css: -------------------------------------------------------------------------------- 1 | /* Loosely based on the Midnight Textmate theme */ 2 | 3 | .cm-s-night { background: #0a001f; color: #f8f8f8; } 4 | .cm-s-night div.CodeMirror-selected { background: #a8f !important; } 5 | .cm-s-night .CodeMirror-gutter { background: #0a001f; border-right: 1px solid #aaa; } 6 | .cm-s-night .CodeMirror-gutter-text { color: #f8f8f8; } 7 | .cm-s-night .CodeMirror-cursor { border-left: 1px solid white !important; } 8 | 9 | .cm-s-night span.cm-comment { color: #6900a1; } 10 | .cm-s-night span.cm-atom { color: #845dc4; } 11 | .cm-s-night span.cm-number, .cm-s-night span.cm-attribute { color: #ffd500; } 12 | .cm-s-night span.cm-keyword { color: #599eff; } 13 | .cm-s-night span.cm-string { color: #37f14a; } 14 | .cm-s-night span.cm-meta { color: #7678e2; } 15 | .cm-s-night span.cm-variable-2, .cm-s-night span.cm-tag { color: #99b2ff; } 16 | .cm-s-night span.cm-variable-3, .cm-s-night span.cm-def { color: white; } 17 | .cm-s-night span.cm-error { color: #9d1e15; } 18 | .cm-s-night span.cm-bracket { color: #8da6ce; } 19 | .cm-s-night span.cm-comment { color: #6900a1; } 20 | .cm-s-night span.cm-builtin, .cm-s-night span.cm-special { color: #ff9e59; } 21 | .cm-s-night span.cm-link { color: #845dc4; } 22 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/codemirror/theme/rubyblue.css: -------------------------------------------------------------------------------- 1 | .cm-s-rubyblue { font:13px/1.4em Trebuchet, Verdana, sans-serif; } /* - customized editor font - */ 2 | 3 | .cm-s-rubyblue { background: #112435; color: white; } 4 | .cm-s-rubyblue div.CodeMirror-selected { background: #38566F !important; } 5 | .cm-s-rubyblue .CodeMirror-gutter { background: #1F4661; border-right: 7px solid #3E7087; min-width:2.5em; } 6 | .cm-s-rubyblue .CodeMirror-gutter-text { color: white; } 7 | .cm-s-rubyblue .CodeMirror-cursor { border-left: 1px solid white !important; } 8 | 9 | .cm-s-rubyblue span.cm-comment { color: #999; font-style:italic; line-height: 1em; } 10 | .cm-s-rubyblue span.cm-atom { color: #F4C20B; } 11 | .cm-s-rubyblue span.cm-number, .cm-s-rubyblue span.cm-attribute { color: #82C6E0; } 12 | .cm-s-rubyblue span.cm-keyword { color: #F0F; } 13 | .cm-s-rubyblue span.cm-string { color: #F08047; } 14 | .cm-s-rubyblue span.cm-meta { color: #F0F; } 15 | .cm-s-rubyblue span.cm-variable-2, .cm-s-rubyblue span.cm-tag { color: #7BD827; } 16 | .cm-s-rubyblue span.cm-variable-3, .cm-s-rubyblue span.cm-def { color: white; } 17 | .cm-s-rubyblue span.cm-error { color: #AF2018; } 18 | .cm-s-rubyblue span.cm-bracket { color: #F0F; } 19 | .cm-s-rubyblue span.cm-link { color: #F4C20B; } 20 | .cm-s-rubyblue span.CodeMirror-matchingbracket { color:#F0F !important; } 21 | .cm-s-rubyblue span.cm-builtin, .cm-s-rubyblue span.cm-special { color: #FF9D00; } 22 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/codemirror/util/dialog.css: -------------------------------------------------------------------------------- 1 | .CodeMirror-dialog { 2 | position: relative; 3 | } 4 | 5 | .CodeMirror-dialog > div { 6 | position: absolute; 7 | top: 0; left: 0; right: 0; 8 | background: white; 9 | border-bottom: 1px solid #eee; 10 | z-index: 15; 11 | padding: .1em .8em; 12 | overflow: hidden; 13 | color: #333; 14 | } 15 | 16 | .CodeMirror-dialog input { 17 | border: none; 18 | outline: none; 19 | background: transparent; 20 | width: 20em; 21 | color: inherit; 22 | font-family: monospace; 23 | } 24 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/codemirror/util/dialog.js: -------------------------------------------------------------------------------- 1 | // Open simple dialogs on top of an editor. Relies on dialog.css. 2 | 3 | (function() { 4 | function dialogDiv(cm, template) { 5 | var wrap = cm.getWrapperElement(); 6 | var dialog = wrap.insertBefore(document.createElement("div"), wrap.firstChild); 7 | dialog.className = "CodeMirror-dialog"; 8 | dialog.innerHTML = '
' + template + '
'; 9 | return dialog; 10 | } 11 | 12 | CodeMirror.defineExtension("openDialog", function(template, callback) { 13 | var dialog = dialogDiv(this, template); 14 | var closed = false, me = this; 15 | function close() { 16 | if (closed) return; 17 | closed = true; 18 | dialog.parentNode.removeChild(dialog); 19 | } 20 | var inp = dialog.getElementsByTagName("input")[0]; 21 | if (inp) { 22 | CodeMirror.connect(inp, "keydown", function(e) { 23 | if (e.keyCode == 13 || e.keyCode == 27) { 24 | CodeMirror.e_stop(e); 25 | close(); 26 | me.focus(); 27 | if (e.keyCode == 13) callback(inp.value); 28 | } 29 | }); 30 | inp.focus(); 31 | CodeMirror.connect(inp, "blur", close); 32 | } 33 | return close; 34 | }); 35 | 36 | CodeMirror.defineExtension("openConfirm", function(template, callbacks) { 37 | var dialog = dialogDiv(this, template); 38 | var buttons = dialog.getElementsByTagName("button"); 39 | var closed = false, me = this, blurring = 1; 40 | function close() { 41 | if (closed) return; 42 | closed = true; 43 | dialog.parentNode.removeChild(dialog); 44 | me.focus(); 45 | } 46 | buttons[0].focus(); 47 | for (var i = 0; i < buttons.length; ++i) { 48 | var b = buttons[i]; 49 | (function(callback) { 50 | CodeMirror.connect(b, "click", function(e) { 51 | CodeMirror.e_preventDefault(e); 52 | close(); 53 | if (callback) callback(me); 54 | }); 55 | })(callbacks[i]); 56 | CodeMirror.connect(b, "blur", function() { 57 | --blurring; 58 | setTimeout(function() { if (blurring <= 0) close(); }, 200); 59 | }); 60 | CodeMirror.connect(b, "focus", function() { ++blurring; }); 61 | } 62 | }); 63 | })(); -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/codemirror/util/match-highlighter.js: -------------------------------------------------------------------------------- 1 | // Define match-highlighter commands. Depends on searchcursor.js 2 | // Use by attaching the following function call to the onCursorActivity event: 3 | //myCodeMirror.matchHighlight(minChars); 4 | // And including a special span.CodeMirror-matchhighlight css class (also optionally a separate one for .CodeMirror-focused -- see demo matchhighlighter.html) 5 | 6 | (function() { 7 | var DEFAULT_MIN_CHARS = 2; 8 | 9 | function MatchHighlightState() { 10 | this.marked = []; 11 | } 12 | function getMatchHighlightState(cm) { 13 | return cm._matchHighlightState || (cm._matchHighlightState = new MatchHighlightState()); 14 | } 15 | 16 | function clearMarks(cm) { 17 | var state = getMatchHighlightState(cm); 18 | for (var i = 0; i < state.marked.length; ++i) 19 | state.marked[i].clear(); 20 | state.marked = []; 21 | } 22 | 23 | function markDocument(cm, className, minChars) { 24 | clearMarks(cm); 25 | minChars = (typeof minChars !== 'undefined' ? minChars : DEFAULT_MIN_CHARS); 26 | if (cm.somethingSelected() && cm.getSelection().length >= minChars) { 27 | var state = getMatchHighlightState(cm); 28 | var query = cm.getSelection(); 29 | cm.operation(function() { 30 | if (cm.lineCount() < 2000) { // This is too expensive on big documents. 31 | for (var cursor = cm.getSearchCursor(query); cursor.findNext();) { 32 | //Only apply matchhighlight to the matches other than the one actually selected 33 | if (!(cursor.from().line === cm.getCursor(true).line && cursor.from().ch === cm.getCursor(true).ch)) 34 | state.marked.push(cm.markText(cursor.from(), cursor.to(), className)); 35 | } 36 | } 37 | }); 38 | } 39 | } 40 | 41 | CodeMirror.defineExtension("matchHighlight", function(className, minChars) { 42 | markDocument(this, className, minChars); 43 | }); 44 | })(); 45 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/codemirror/util/overlay.js: -------------------------------------------------------------------------------- 1 | // Utility function that allows modes to be combined. The mode given 2 | // as the base argument takes care of most of the normal mode 3 | // functionality, but a second (typically simple) mode is used, which 4 | // can override the style of text. Both modes get to parse all of the 5 | // text, but when both assign a non-null style to a piece of code, the 6 | // overlay wins, unless the combine argument was true, in which case 7 | // the styles are combined. 8 | 9 | CodeMirror.overlayParser = function(base, overlay, combine) { 10 | return { 11 | startState: function() { 12 | return { 13 | base: CodeMirror.startState(base), 14 | overlay: CodeMirror.startState(overlay), 15 | basePos: 0, baseCur: null, 16 | overlayPos: 0, overlayCur: null 17 | }; 18 | }, 19 | copyState: function(state) { 20 | return { 21 | base: CodeMirror.copyState(base, state.base), 22 | overlay: CodeMirror.copyState(overlay, state.overlay), 23 | basePos: state.basePos, baseCur: null, 24 | overlayPos: state.overlayPos, overlayCur: null 25 | }; 26 | }, 27 | 28 | token: function(stream, state) { 29 | if (stream.start == state.basePos) { 30 | state.baseCur = base.token(stream, state.base); 31 | state.basePos = stream.pos; 32 | } 33 | if (stream.start == state.overlayPos) { 34 | stream.pos = stream.start; 35 | state.overlayCur = overlay.token(stream, state.overlay); 36 | state.overlayPos = stream.pos; 37 | } 38 | stream.pos = Math.min(state.basePos, state.overlayPos); 39 | if (stream.eol()) state.basePos = state.overlayPos = 0; 40 | 41 | if (state.overlayCur == null) return state.baseCur; 42 | if (state.baseCur != null && combine) return state.baseCur + " " + state.overlayCur; 43 | else return state.overlayCur; 44 | }, 45 | 46 | indent: function(state, textAfter) { 47 | return base.indent(state.base, textAfter); 48 | }, 49 | electricChars: base.electricChars 50 | }; 51 | }; 52 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/codemirror/util/runmode.js: -------------------------------------------------------------------------------- 1 | CodeMirror.runMode = function(string, modespec, callback, options) { 2 | var mode = CodeMirror.getMode(CodeMirror.defaults, modespec); 3 | var isNode = callback.nodeType == 1; 4 | var tabSize = (options && options.tabSize) || CodeMirror.defaults.tabSize; 5 | if (isNode) { 6 | var node = callback, accum = [], col = 0; 7 | callback = function(text, style) { 8 | if (text == "\n") { 9 | accum.push("
"); 10 | col = 0; 11 | return; 12 | } 13 | var escaped = ""; 14 | // HTML-escape and replace tabs 15 | for (var pos = 0;;) { 16 | var idx = text.indexOf("\t", pos); 17 | if (idx == -1) { 18 | escaped += CodeMirror.htmlEscape(text.slice(pos)); 19 | col += text.length - pos; 20 | break; 21 | } else { 22 | col += idx - pos; 23 | escaped += CodeMirror.htmlEscape(text.slice(pos, idx)); 24 | var size = tabSize - col % tabSize; 25 | col += size; 26 | for (var i = 0; i < size; ++i) escaped += " "; 27 | pos = idx + 1; 28 | } 29 | } 30 | 31 | if (style) 32 | accum.push("" + escaped + ""); 33 | else 34 | accum.push(escaped); 35 | } 36 | } 37 | var lines = CodeMirror.splitLines(string), state = CodeMirror.startState(mode); 38 | for (var i = 0, e = lines.length; i < e; ++i) { 39 | if (i) callback("\n"); 40 | var stream = new CodeMirror.StringStream(lines[i]); 41 | while (!stream.eol()) { 42 | var style = mode.token(stream, state); 43 | callback(stream.current(), style, i, stream.start); 44 | stream.start = stream.pos; 45 | } 46 | } 47 | if (isNode) 48 | node.innerHTML = accum.join(""); 49 | }; 50 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/codemirror/util/simple-hint.css: -------------------------------------------------------------------------------- 1 | .CodeMirror-completions { 2 | position: absolute; 3 | z-index: 10; 4 | overflow: hidden; 5 | -webkit-box-shadow: 2px 3px 5px rgba(0,0,0,.2); 6 | -moz-box-shadow: 2px 3px 5px rgba(0,0,0,.2); 7 | box-shadow: 2px 3px 5px rgba(0,0,0,.2); 8 | } 9 | .CodeMirror-completions select { 10 | background: #fafafa; 11 | outline: none; 12 | border: none; 13 | padding: 0; 14 | margin: 0; 15 | font-family: monospace; 16 | } 17 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/img/asc.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamalgill/flask-appengine-template/11760f83faccbb0d0afe416fc58e67ecfb4643c2/src/lib/flask_debugtoolbar/static/img/asc.gif -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/img/back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamalgill/flask-appengine-template/11760f83faccbb0d0afe416fc58e67ecfb4643c2/src/lib/flask_debugtoolbar/static/img/back.png -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/img/back_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamalgill/flask-appengine-template/11760f83faccbb0d0afe416fc58e67ecfb4643c2/src/lib/flask_debugtoolbar/static/img/back_hover.png -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/img/bg.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamalgill/flask-appengine-template/11760f83faccbb0d0afe416fc58e67ecfb4643c2/src/lib/flask_debugtoolbar/static/img/bg.gif -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/img/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamalgill/flask-appengine-template/11760f83faccbb0d0afe416fc58e67ecfb4643c2/src/lib/flask_debugtoolbar/static/img/close.png -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/img/close_hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamalgill/flask-appengine-template/11760f83faccbb0d0afe416fc58e67ecfb4643c2/src/lib/flask_debugtoolbar/static/img/close_hover.png -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/img/desc.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamalgill/flask-appengine-template/11760f83faccbb0d0afe416fc58e67ecfb4643c2/src/lib/flask_debugtoolbar/static/img/desc.gif -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/img/djdt_vertical.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamalgill/flask-appengine-template/11760f83faccbb0d0afe416fc58e67ecfb4643c2/src/lib/flask_debugtoolbar/static/img/djdt_vertical.png -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/img/indicator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamalgill/flask-appengine-template/11760f83faccbb0d0afe416fc58e67ecfb4643c2/src/lib/flask_debugtoolbar/static/img/indicator.png -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/img/panel_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamalgill/flask-appengine-template/11760f83faccbb0d0afe416fc58e67ecfb4643c2/src/lib/flask_debugtoolbar/static/img/panel_bg.png -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/img/tick-red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamalgill/flask-appengine-template/11760f83faccbb0d0afe416fc58e67ecfb4643c2/src/lib/flask_debugtoolbar/static/img/tick-red.png -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/static/img/tick.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamalgill/flask-appengine-template/11760f83faccbb0d0afe416fc58e67ecfb4643c2/src/lib/flask_debugtoolbar/static/img/tick.png -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/templates/base.html: -------------------------------------------------------------------------------- 1 | 58 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/templates/panels/config_vars.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | {% for key, value in config|dictsort %} 10 | 11 | 12 | 13 | 14 | {% endfor %} 15 | 16 |
KeyValue
{{ key }}{{ value|printable }}
-------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/templates/panels/headers.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | {% for key, value in headers|dictsort %} 10 | 11 | 12 | 13 | 14 | {% endfor %} 15 | 16 |
KeyValue
{{ key|escape }}{{ value|escape }}
17 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/templates/panels/logger.html: -------------------------------------------------------------------------------- 1 | {% if records %} 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | {% for record in records %} 13 | 14 | 15 | 16 | 17 | 18 | 19 | {% endfor %} 20 | 21 |
LevelTimeMessageLocation
{{ record.level }}{{ record.time }}{{ record.message }}{{ record.file }}:{{ record.line }}
22 | {% else %} 23 |

No messages logged.

24 | {% endif %} 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/templates/panels/profiler.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | {% for row in function_calls %} 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | {% endfor %} 23 | 24 |
CallsTotal Time (ms)Per Call (ms)Cumulative Time (ms)Per Call (ms)Function
{{ row.ncalls }}{{ row.tottime }}{{ '%.4f'|format(row.percall) }}{{ row.cumtime }}{{ '%.4f'|format(row.percall_cum) }}{{ row.filename|escape }}
-------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/templates/panels/route_list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | {% if routes %} 13 | {% for route in routes|sort(attribute='rule') %} 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | {% endfor %} 22 | {% else %} 23 | 24 | 25 | 26 | {% endif %} 27 | 28 |
URL routeEndpoint nameHTTP methodsIs aliasRedirect to
{{ route.rule }}{{ route.endpoint }}{{ route.methods|sort|join(', ') }}{{ route.alias }}{{ route.redirect_to }}
No routes have been configured.
29 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/templates/panels/sqlalchemy.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | {% for query in queries %} 12 | 13 | 14 | 20 | 23 | 28 | 29 | {% endfor %} 30 | 31 |
 (ms)ActionContextQuery
{{ '%.4f'|format(query.duration * 1000) }} 15 | {% if query.signed_query %} 16 | SELECT
17 | EXPLAIN
18 | {% endif %} 19 |
21 | {{ query.context }} 22 | 24 |
25 |
{{ query.sql }}
26 |
27 |
32 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/templates/panels/sqlalchemy_error.html: -------------------------------------------------------------------------------- 1 |

Queries Unavailable

2 | 3 |

4 | The toolbar was unable to fetch the SQLAlchemy queries for this request. 5 | To enable the SQLAlchemy query display, please: 6 |

7 | 8 |
    9 | {% if not json_available or not sqlalchemy_available %} 10 |
  1. 11 |
    Install required libraries:
    12 |
      13 | {% if not json_available %} 14 |
    • simplejson
    • 15 | {% endif %} 16 | {% if not sqlalchemy_available %} 17 |
    • Flask-SQLAlchemy
    • 18 | {% endif %} 19 |
    20 |
  2. 21 | {% endif %} 22 | 23 | {% if not extension_used %} 24 |
  3. 25 |
    Configure Flask-SQLAlchemy:
    26 |

    27 | The Flask-SQLAlchemy extension needs to be configured for this application. 28 | Please see the 29 | Flask-SQLAlchemy documentation for details. 30 |

    31 |
  4. 32 | {% endif %} 33 | 34 | {% if not recording_enabled %} 35 |
  5. 36 |
    Enable query recording:
    37 |

    38 | Since this app is not currently running in DEBUG mode, Flask-SQLAlchemy will not record queries by default. To enable query recording in non-debug mode, set the following configuration value: 39 |

    40 |
    app.config['SQLALCHEMY_RECORD_QUERIES'] = True
    41 |

    42 | See the 43 | 44 | documention of Flask-SQLAlchemy's get_debug_queries() 45 | for additional details. 46 |

    47 |
  6. 48 | {% endif %} 49 |
50 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/templates/panels/sqlalchemy_select.html: -------------------------------------------------------------------------------- 1 |
2 | Back 3 |

SQL Details

4 |
5 |
6 |
7 |
8 |
Executed SQL
9 |
{{ sql }}
10 |
Original query duration
11 |
{{ '%.4f'|format(duration * 1000) }} ms
12 |
13 | {% if result %} 14 | 15 | 16 | 17 | {% for h in headers %} 18 | 19 | {% endfor %} 20 | 21 | 22 | 23 | {% for row in result %} 24 | 25 | {% for column in row %} 26 | 27 | {% endfor %} 28 | 29 | {% endfor %} 30 | 31 |
{{ h|upper }}
{{ column }}
32 | {% else %} 33 |

Empty set

34 | {% endif %} 35 |
36 |
37 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/templates/panels/template.html: -------------------------------------------------------------------------------- 1 | {% if templates %} 2 | {% if editable %} 3 | Edit templates 4 | {% endif %} 5 | {% for template in templates %} 6 |

{{ template.template.name }}

7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | {% for k, v in template.context|dictsort %} 16 | 17 | 18 | 19 | 20 | {% endfor %} 21 | 22 |
VariableValue
{{ k }}{{ v|printable }}
23 | {% endfor %} 24 | {% else %} 25 |

No template rendered

26 | {% endif %} 27 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/templates/panels/timer.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | {% for key, value in rows %} 14 | 15 | 16 | 17 | 18 | {% endfor %} 19 | 20 |
ResourceValue
{{ key|escape }}{{ value|escape }}
21 | 22 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/templates/panels/versions.html: -------------------------------------------------------------------------------- 1 |

Installed Packages

2 | 3 |

4 | Installation paths relative to: 5 |

6 |
 7 | {{ python_lib }}
 8 | 
9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | {% for package in packages %} 20 | 21 | 22 | 23 | 24 | 25 | {% else %} 26 | 27 | 28 | 29 | 30 | 31 | {% endfor %} 32 | 33 |
PackageVersionInstalled Path
{{ package.project_name }}{{ package.version }}{{ relpath(package.location, python_lib) }}
setuptoolsNOT INSTALLEDInstall setuptools to display installed packages and version information
34 | -------------------------------------------------------------------------------- /src/lib/flask_debugtoolbar/templates/redirect.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Redirect intercepted 4 | 5 | 6 |

Redirect ({{ redirect_code }})

7 |

Location: {{ redirect_to }}

8 |

9 | The Flask Debug Toolbar has intercepted a redirect to the above URL for 10 | debug viewing purposes. You can click the above link to continue with the 11 | redirect as normal. If you'd like to disable this feature, you can set the 12 | config variable DEBUG_TB_INTERCEPT_REDIRECTS to False. 13 |

14 | 15 | 16 | -------------------------------------------------------------------------------- /src/lib/flask_wtf/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | flask_wtf 4 | ~~~~~~~~~ 5 | 6 | Flask-WTF extension 7 | 8 | :copyright: (c) 2010 by Dan Jacob. 9 | :copyright: (c) 2013 - 2015 by Hsiaoming Yang. 10 | :license: BSD, see LICENSE for more details. 11 | """ 12 | # flake8: noqa 13 | from __future__ import absolute_import 14 | 15 | from .csrf import CSRFProtect, CsrfProtect 16 | from .form import FlaskForm, Form 17 | from .recaptcha import * 18 | 19 | __version__ = '0.14.2' 20 | -------------------------------------------------------------------------------- /src/lib/flask_wtf/_compat.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import warnings 3 | 4 | PY2 = sys.version_info[0] == 2 5 | 6 | if not PY2: 7 | text_type = str 8 | string_types = (str,) 9 | from urllib.parse import urlparse 10 | else: 11 | text_type = unicode 12 | string_types = (str, unicode) 13 | from urlparse import urlparse 14 | 15 | 16 | def to_bytes(text): 17 | """Transform string to bytes.""" 18 | if isinstance(text, text_type): 19 | text = text.encode('utf-8') 20 | return text 21 | 22 | 23 | def to_unicode(input_bytes, encoding='utf-8'): 24 | """Decodes input_bytes to text if needed.""" 25 | if not isinstance(input_bytes, string_types): 26 | input_bytes = input_bytes.decode(encoding) 27 | return input_bytes 28 | 29 | 30 | class FlaskWTFDeprecationWarning(DeprecationWarning): 31 | pass 32 | 33 | 34 | warnings.simplefilter('always', FlaskWTFDeprecationWarning) 35 | warnings.filterwarnings('ignore', category=FlaskWTFDeprecationWarning, module='wtforms|flask_wtf') 36 | -------------------------------------------------------------------------------- /src/lib/flask_wtf/html5.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | # flake8: noqa 3 | import warnings 4 | from flask_wtf._compat import FlaskWTFDeprecationWarning 5 | 6 | warnings.warn(FlaskWTFDeprecationWarning( 7 | '"flask_wtf.html5" will be removed in 1.0. ' 8 | 'Import directly from "wtforms.fields.html5" ' 9 | 'and "wtforms.widgets.html5".' 10 | ), stacklevel=2) 11 | 12 | from wtforms.widgets.html5 import * 13 | from wtforms.fields.html5 import * 14 | -------------------------------------------------------------------------------- /src/lib/flask_wtf/i18n.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | """ 3 | flask_wtf.i18n 4 | ~~~~~~~~~~~~~~ 5 | 6 | Internationalization support for Flask WTF. 7 | 8 | :copyright: (c) 2013 by Hsiaoming Yang. 9 | """ 10 | 11 | from flask import _request_ctx_stack 12 | from babel import support 13 | try: 14 | from flask_babel import get_locale 15 | except ImportError: 16 | from flask_babelex import get_locale 17 | try: 18 | from wtforms.i18n import messages_path 19 | except ImportError: 20 | from wtforms.ext.i18n.utils import messages_path 21 | 22 | 23 | __all__ = ('Translations', 'translations') 24 | 25 | 26 | def _get_translations(): 27 | """Returns the correct gettext translations. 28 | Copy from flask-babel with some modifications. 29 | """ 30 | ctx = _request_ctx_stack.top 31 | if ctx is None: 32 | return None 33 | # babel should be in extensions for get_locale 34 | if 'babel' not in ctx.app.extensions: 35 | return None 36 | translations = getattr(ctx, 'wtforms_translations', None) 37 | if translations is None: 38 | dirname = messages_path() 39 | translations = support.Translations.load( 40 | dirname, [get_locale()], domain='wtforms' 41 | ) 42 | ctx.wtforms_translations = translations 43 | return translations 44 | 45 | 46 | class Translations(object): 47 | def gettext(self, string): 48 | t = _get_translations() 49 | if t is None: 50 | return string 51 | if hasattr(t, 'ugettext'): 52 | return t.ugettext(string) 53 | # Python 3 has no ugettext 54 | return t.gettext(string) 55 | 56 | def ngettext(self, singular, plural, n): 57 | t = _get_translations() 58 | if t is None: 59 | if n == 1: 60 | return singular 61 | return plural 62 | 63 | if hasattr(t, 'ungettext'): 64 | return t.ungettext(singular, plural, n) 65 | # Python 3 has no ungettext 66 | return t.ngettext(singular, plural, n) 67 | 68 | 69 | translations = Translations() 70 | -------------------------------------------------------------------------------- /src/lib/flask_wtf/recaptcha/__init__.py: -------------------------------------------------------------------------------- 1 | # flake8: noqa 2 | from .fields import * 3 | from .validators import * 4 | from .widgets import * 5 | -------------------------------------------------------------------------------- /src/lib/flask_wtf/recaptcha/fields.py: -------------------------------------------------------------------------------- 1 | from wtforms.fields import Field 2 | 3 | from . import widgets 4 | from .validators import Recaptcha 5 | 6 | __all__ = ["RecaptchaField"] 7 | 8 | 9 | class RecaptchaField(Field): 10 | widget = widgets.RecaptchaWidget() 11 | 12 | # error message if recaptcha validation fails 13 | recaptcha_error = None 14 | 15 | def __init__(self, label='', validators=None, **kwargs): 16 | validators = validators or [Recaptcha()] 17 | super(RecaptchaField, self).__init__(label, validators, **kwargs) 18 | -------------------------------------------------------------------------------- /src/lib/flask_wtf/recaptcha/widgets.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | from flask import current_app, Markup 4 | from flask import json 5 | from werkzeug import url_encode 6 | JSONEncoder = json.JSONEncoder 7 | 8 | RECAPTCHA_SCRIPT = u'https://www.google.com/recaptcha/api.js' 9 | 10 | RECAPTCHA_TEMPLATE = u''' 11 | 12 |
13 | ''' 14 | 15 | __all__ = ["RecaptchaWidget"] 16 | 17 | 18 | class RecaptchaWidget(object): 19 | 20 | def recaptcha_html(self, public_key): 21 | html = current_app.config.get('RECAPTCHA_HTML') 22 | if html: 23 | return Markup(html) 24 | params = current_app.config.get('RECAPTCHA_PARAMETERS') 25 | script = RECAPTCHA_SCRIPT 26 | if params: 27 | script += u'?' + url_encode(params) 28 | 29 | attrs = current_app.config.get('RECAPTCHA_DATA_ATTRS', {}) 30 | attrs['sitekey'] = public_key 31 | snippet = u' '.join([u'data-%s="%s"' % (k, attrs[k]) for k in attrs]) 32 | return Markup(RECAPTCHA_TEMPLATE % (script, snippet)) 33 | 34 | def __call__(self, field, error=None, **kwargs): 35 | """Returns the recaptcha input HTML.""" 36 | 37 | try: 38 | public_key = current_app.config['RECAPTCHA_PUBLIC_KEY'] 39 | except KeyError: 40 | raise RuntimeError("RECAPTCHA_PUBLIC_KEY config not set") 41 | 42 | return self.recaptcha_html(public_key) 43 | -------------------------------------------------------------------------------- /src/lib/gae_mini_profiler/.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | -------------------------------------------------------------------------------- /src/lib/gae_mini_profiler/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamalgill/flask-appengine-template/11760f83faccbb0d0afe416fc58e67ecfb4643c2/src/lib/gae_mini_profiler/__init__.py -------------------------------------------------------------------------------- /src/lib/gae_mini_profiler/config.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | from google.appengine.api import lib_config 4 | 5 | # These should_profile functions return true whenever a request should be 6 | # profiled. 7 | # 8 | # You can override these functions in appengine_config.py. See example below 9 | # and https://developers.google.com/appengine/docs/python/tools/appengineconfig 10 | # 11 | # These functions will be run once per request, so make sure they are fast. 12 | # 13 | # Example: 14 | # ...in appengine_config.py: 15 | # def gae_mini_profiler_should_profile_production(): 16 | # from google.appengine.api import users 17 | # return users.is_current_user_admin() 18 | 19 | def _should_profile_production_default(): 20 | """Default to disabling in production if this function isn't overridden. 21 | 22 | Can be overridden in appengine_config.py""" 23 | return False 24 | 25 | def _should_profile_development_default(): 26 | """Default to enabling in development if this function isn't overridden. 27 | 28 | Can be overridden in appengine_config.py""" 29 | return True 30 | 31 | _config = lib_config.register("gae_mini_profiler", { 32 | "should_profile_production": _should_profile_production_default, 33 | "should_profile_development": _should_profile_development_default}) 34 | 35 | def should_profile(): 36 | """Returns true if the current request should be profiles.""" 37 | if os.environ["SERVER_SOFTWARE"].startswith("Devel"): 38 | return _config.should_profile_development() 39 | else: 40 | return _config.should_profile_production() 41 | -------------------------------------------------------------------------------- /src/lib/gae_mini_profiler/cookies.py: -------------------------------------------------------------------------------- 1 | import Cookie 2 | import logging 3 | import os 4 | 5 | def get_cookie_value(key): 6 | cookies = None 7 | try: 8 | cookies = Cookie.BaseCookie(os.environ.get('HTTP_COOKIE','')) 9 | except Cookie.CookieError, error: 10 | logging.debug("Ignoring Cookie Error, skipping get cookie: '%s'" % error) 11 | 12 | if not cookies: 13 | return None 14 | 15 | cookie = cookies.get(key) 16 | 17 | if not cookie: 18 | return None 19 | 20 | return cookie.value 21 | 22 | # Cookie handling from http://appengine-cookbook.appspot.com/recipe/a-simple-cookie-class/ 23 | def set_cookie_value(key, value='', max_age=None, 24 | path='/', domain=None, secure=None, httponly=False, 25 | version=None, comment=None): 26 | cookies = Cookie.BaseCookie() 27 | cookies[key] = value 28 | for var_name, var_value in [ 29 | ('max-age', max_age), 30 | ('path', path), 31 | ('domain', domain), 32 | ('secure', secure), 33 | #('HttpOnly', httponly), Python 2.6 is required for httponly cookies 34 | ('version', version), 35 | ('comment', comment), 36 | ]: 37 | if var_value is not None and var_value is not False: 38 | cookies[key][var_name] = str(var_value) 39 | if max_age is not None: 40 | cookies[key]['expires'] = max_age 41 | 42 | cookies_header = cookies[key].output(header='').lstrip() 43 | 44 | if httponly: 45 | # We have to manually add this part of the header until GAE uses Python 2.6. 46 | cookies_header += "; HttpOnly" 47 | 48 | return cookies_header 49 | 50 | 51 | -------------------------------------------------------------------------------- /src/lib/gae_mini_profiler/main.py: -------------------------------------------------------------------------------- 1 | from google.appengine.ext import webapp 2 | from google.appengine.ext.webapp.util import run_wsgi_app 3 | 4 | import profiler 5 | 6 | application = webapp.WSGIApplication([ 7 | ("/gae_mini_profiler/request/log", profiler.RequestLogHandler), 8 | ("/gae_mini_profiler/request", profiler.RequestStatsHandler), 9 | ("/gae_mini_profiler/shared", profiler.SharedStatsHandler), 10 | ]) 11 | 12 | def main(): 13 | run_wsgi_app(application) 14 | 15 | if __name__ == "__main__": 16 | main() 17 | -------------------------------------------------------------------------------- /src/lib/gae_mini_profiler/templates/includes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/lib/gae_mini_profiler/templates/shared.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |
7 |
8 | Shared profiler results 9 |
10 |
11 | {{profiler_includes}} 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/lib/gae_mini_profiler/templatetags.py: -------------------------------------------------------------------------------- 1 | # use json in Python 2.7, fallback to simplejson for Python 2.5 2 | try: 3 | import json 4 | except ImportError: 5 | import simplejson as json 6 | 7 | import profiler 8 | 9 | 10 | def profiler_includes_request_id(request_id, show_immediately=False): 11 | if not request_id: 12 | return "" 13 | 14 | js_path = "/gae_mini_profiler/static/js/profiler.js" 15 | css_path = "/gae_mini_profiler/static/css/profiler.css" 16 | 17 | return """ 18 | 19 | 20 | 21 | """ % (css_path, js_path, request_id, json.dumps(show_immediately)) 22 | 23 | 24 | def profiler_includes(): 25 | return profiler_includes_request_id(profiler.CurrentRequestId.get()) 26 | -------------------------------------------------------------------------------- /src/lib/gae_mini_profiler/util.py: -------------------------------------------------------------------------------- 1 | def seconds_fmt(f, n=0): 2 | return milliseconds_fmt(f * 1000, n) 3 | 4 | def milliseconds_fmt(f, n=0): 5 | return decimal_fmt(f, n) 6 | 7 | def decimal_fmt(f, n=0): 8 | format = "%." + str(n) + "f" 9 | return format % f 10 | 11 | def short_method_fmt(s): 12 | return s[s.rfind("/") + 1:] 13 | 14 | def short_rpc_file_fmt(s): 15 | if not s: 16 | return "" 17 | return s[s.find("/"):] 18 | -------------------------------------------------------------------------------- /src/lib/werkzeug/contrib/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | werkzeug.contrib 4 | ~~~~~~~~~~~~~~~~ 5 | 6 | Contains user-submitted code that other users may find useful, but which 7 | is not part of the Werkzeug core. Anyone can write code for inclusion in 8 | the `contrib` package. All modules in this package are distributed as an 9 | add-on library and thus are not part of Werkzeug itself. 10 | 11 | This file itself is mostly for informational purposes and to tell the 12 | Python interpreter that `contrib` is a package. 13 | 14 | :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details. 15 | :license: BSD, see LICENSE for more details. 16 | """ 17 | -------------------------------------------------------------------------------- /src/lib/werkzeug/contrib/limiter.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | werkzeug.contrib.limiter 4 | ~~~~~~~~~~~~~~~~~~~~~~~~ 5 | 6 | A middleware that limits incoming data. This works around problems with 7 | Trac_ or Django_ because those directly stream into the memory. 8 | 9 | .. _Trac: http://trac.edgewall.org/ 10 | .. _Django: http://www.djangoproject.com/ 11 | 12 | :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details. 13 | :license: BSD, see LICENSE for more details. 14 | """ 15 | from warnings import warn 16 | 17 | from werkzeug.wsgi import LimitedStream 18 | 19 | 20 | class StreamLimitMiddleware(object): 21 | 22 | """Limits the input stream to a given number of bytes. This is useful if 23 | you have a WSGI application that reads form data into memory (django for 24 | example) and you don't want users to harm the server by uploading tons of 25 | data. 26 | 27 | Default is 10MB 28 | 29 | .. versionchanged:: 0.9 30 | Deprecated middleware. 31 | """ 32 | 33 | def __init__(self, app, maximum_size=1024 * 1024 * 10): 34 | warn(DeprecationWarning('This middleware is deprecated')) 35 | self.app = app 36 | self.maximum_size = maximum_size 37 | 38 | def __call__(self, environ, start_response): 39 | limit = min(self.maximum_size, int(environ.get('CONTENT_LENGTH') or 0)) 40 | environ['wsgi.input'] = LimitedStream(environ['wsgi.input'], limit) 41 | return self.app(environ, start_response) 42 | -------------------------------------------------------------------------------- /src/lib/werkzeug/debug/shared/console.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamalgill/flask-appengine-template/11760f83faccbb0d0afe416fc58e67ecfb4643c2/src/lib/werkzeug/debug/shared/console.png -------------------------------------------------------------------------------- /src/lib/werkzeug/debug/shared/less.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamalgill/flask-appengine-template/11760f83faccbb0d0afe416fc58e67ecfb4643c2/src/lib/werkzeug/debug/shared/less.png -------------------------------------------------------------------------------- /src/lib/werkzeug/debug/shared/more.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamalgill/flask-appengine-template/11760f83faccbb0d0afe416fc58e67ecfb4643c2/src/lib/werkzeug/debug/shared/more.png -------------------------------------------------------------------------------- /src/lib/werkzeug/debug/shared/source.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamalgill/flask-appengine-template/11760f83faccbb0d0afe416fc58e67ecfb4643c2/src/lib/werkzeug/debug/shared/source.png -------------------------------------------------------------------------------- /src/lib/werkzeug/debug/shared/ubuntu.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamalgill/flask-appengine-template/11760f83faccbb0d0afe416fc58e67ecfb4643c2/src/lib/werkzeug/debug/shared/ubuntu.ttf -------------------------------------------------------------------------------- /src/lib/wtforms/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | WTForms 3 | ======= 4 | 5 | WTForms is a flexible forms validation and rendering library for python web 6 | development. 7 | 8 | :copyright: Copyright (c) 2010 by Thomas Johansson, James Crasta and others. 9 | :license: BSD, see LICENSE.txt for details. 10 | """ 11 | from wtforms import validators, widgets 12 | from wtforms.fields import * 13 | from wtforms.form import Form 14 | from wtforms.validators import ValidationError 15 | 16 | __version__ = '2.1' 17 | -------------------------------------------------------------------------------- /src/lib/wtforms/compat.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | __all__ = ( 4 | 'text_type', 'string_types', 'izip', 'iteritems', 'itervalues', 5 | 'with_metaclass', 6 | ) 7 | 8 | if sys.version_info[0] >= 3: 9 | text_type = str 10 | string_types = (str, ) 11 | izip = zip 12 | 13 | def iteritems(o): 14 | return o.items() 15 | 16 | def itervalues(o): 17 | return o.values() 18 | 19 | else: 20 | text_type = unicode 21 | string_types = (basestring, ) 22 | from itertools import izip 23 | 24 | def iteritems(o): 25 | return o.iteritems() 26 | 27 | def itervalues(o): 28 | return o.itervalues() 29 | 30 | 31 | def with_metaclass(meta, base=object): 32 | return meta("NewBase", (base,), {}) 33 | -------------------------------------------------------------------------------- /src/lib/wtforms/csrf/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamalgill/flask-appengine-template/11760f83faccbb0d0afe416fc58e67ecfb4643c2/src/lib/wtforms/csrf/__init__.py -------------------------------------------------------------------------------- /src/lib/wtforms/ext/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamalgill/flask-appengine-template/11760f83faccbb0d0afe416fc58e67ecfb4643c2/src/lib/wtforms/ext/__init__.py -------------------------------------------------------------------------------- /src/lib/wtforms/ext/appengine/__init__.py: -------------------------------------------------------------------------------- 1 | import warnings 2 | 3 | warnings.warn( 4 | 'wtforms.ext.appengine is deprecated, and will be removed in WTForms 3.0. ' 5 | 'The package has been split out into its own package, wtforms-appengine: ' 6 | 'https://github.com/wtforms/wtforms-appengine ', 7 | DeprecationWarning 8 | ) 9 | -------------------------------------------------------------------------------- /src/lib/wtforms/ext/csrf/__init__.py: -------------------------------------------------------------------------------- 1 | from wtforms.ext.csrf.form import SecureForm 2 | -------------------------------------------------------------------------------- /src/lib/wtforms/ext/csrf/fields.py: -------------------------------------------------------------------------------- 1 | from wtforms.fields import HiddenField 2 | 3 | 4 | class CSRFTokenField(HiddenField): 5 | current_token = None 6 | 7 | def _value(self): 8 | """ 9 | We want to always return the current token on render, regardless of 10 | whether a good or bad token was passed. 11 | """ 12 | return self.current_token 13 | 14 | def populate_obj(self, *args): 15 | """ 16 | Don't populate objects with the CSRF token 17 | """ 18 | pass 19 | -------------------------------------------------------------------------------- /src/lib/wtforms/ext/csrf/form.py: -------------------------------------------------------------------------------- 1 | from __future__ import unicode_literals 2 | 3 | from wtforms.form import Form 4 | from wtforms.validators import ValidationError 5 | 6 | from .fields import CSRFTokenField 7 | 8 | 9 | class SecureForm(Form): 10 | """ 11 | Form that enables CSRF processing via subclassing hooks. 12 | """ 13 | csrf_token = CSRFTokenField() 14 | 15 | def __init__(self, formdata=None, obj=None, prefix='', csrf_context=None, **kwargs): 16 | """ 17 | :param csrf_context: 18 | Optional extra data which is passed transparently to your 19 | CSRF implementation. 20 | """ 21 | super(SecureForm, self).__init__(formdata, obj, prefix, **kwargs) 22 | self.csrf_token.current_token = self.generate_csrf_token(csrf_context) 23 | 24 | def generate_csrf_token(self, csrf_context): 25 | """ 26 | Implementations must override this to provide a method with which one 27 | can get a CSRF token for this form. 28 | 29 | A CSRF token should be a string which can be generated 30 | deterministically so that on the form POST, the generated string is 31 | (usually) the same assuming the user is using the site normally. 32 | 33 | :param csrf_context: 34 | A transparent object which can be used as contextual info for 35 | generating the token. 36 | """ 37 | raise NotImplementedError() 38 | 39 | def validate_csrf_token(self, field): 40 | """ 41 | Override this method to provide custom CSRF validation logic. 42 | 43 | The default CSRF validation logic simply checks if the recently 44 | generated token equals the one we received as formdata. 45 | """ 46 | if field.current_token != field.data: 47 | raise ValidationError(field.gettext('Invalid CSRF Token')) 48 | 49 | @property 50 | def data(self): 51 | d = super(SecureForm, self).data 52 | d.pop('csrf_token') 53 | return d 54 | -------------------------------------------------------------------------------- /src/lib/wtforms/ext/dateutil/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamalgill/flask-appengine-template/11760f83faccbb0d0afe416fc58e67ecfb4643c2/src/lib/wtforms/ext/dateutil/__init__.py -------------------------------------------------------------------------------- /src/lib/wtforms/ext/django/__init__.py: -------------------------------------------------------------------------------- 1 | import warnings 2 | 3 | warnings.warn( 4 | 'wtforms.ext.django is deprecated, and will be removed in WTForms 3.0. ' 5 | 'The package has been split out into its own package, wtforms-django: ' 6 | 'https://github.com/wtforms/wtforms-django', 7 | DeprecationWarning 8 | ) 9 | -------------------------------------------------------------------------------- /src/lib/wtforms/ext/django/i18n.py: -------------------------------------------------------------------------------- 1 | from django.utils.translation import ugettext, ungettext 2 | from wtforms import form 3 | 4 | 5 | class DjangoTranslations(object): 6 | """ 7 | A translations object for WTForms that gets its messages from django's 8 | translations providers. 9 | """ 10 | def gettext(self, string): 11 | return ugettext(string) 12 | 13 | def ngettext(self, singular, plural, n): 14 | return ungettext(singular, plural, n) 15 | 16 | 17 | class Form(form.Form): 18 | """ 19 | A Form derivative which uses the translations engine from django. 20 | """ 21 | _django_translations = DjangoTranslations() 22 | 23 | def _get_translations(self): 24 | return self._django_translations 25 | -------------------------------------------------------------------------------- /src/lib/wtforms/ext/django/templatetags/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamalgill/flask-appengine-template/11760f83faccbb0d0afe416fc58e67ecfb4643c2/src/lib/wtforms/ext/django/templatetags/__init__.py -------------------------------------------------------------------------------- /src/lib/wtforms/ext/i18n/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kamalgill/flask-appengine-template/11760f83faccbb0d0afe416fc58e67ecfb4643c2/src/lib/wtforms/ext/i18n/__init__.py -------------------------------------------------------------------------------- /src/lib/wtforms/ext/i18n/form.py: -------------------------------------------------------------------------------- 1 | import warnings 2 | from wtforms import form 3 | from wtforms.ext.i18n.utils import get_translations 4 | 5 | translations_cache = {} 6 | 7 | 8 | class Form(form.Form): 9 | """ 10 | Base form for a simple localized WTForms form. 11 | 12 | **NOTE** this class is now un-necessary as the i18n features have 13 | been moved into the core of WTForms, and will be removed in WTForms 3.0. 14 | 15 | This will use the stdlib gettext library to retrieve an appropriate 16 | translations object for the language, by default using the locale 17 | information from the environment. 18 | 19 | If the LANGUAGES class variable is overridden and set to a sequence of 20 | strings, this will be a list of languages by priority to use instead, e.g:: 21 | 22 | LANGUAGES = ['en_GB', 'en'] 23 | 24 | One can also provide the languages by passing `LANGUAGES=` to the 25 | constructor of the form. 26 | 27 | Translations objects are cached to prevent having to get a new one for the 28 | same languages every instantiation. 29 | """ 30 | LANGUAGES = None 31 | 32 | def __init__(self, *args, **kwargs): 33 | warnings.warn( 34 | 'i18n is now in core, wtforms.ext.i18n will be removed in WTForms 3.0', 35 | DeprecationWarning, stacklevel=2 36 | ) 37 | if 'LANGUAGES' in kwargs: 38 | self.LANGUAGES = kwargs.pop('LANGUAGES') 39 | super(Form, self).__init__(*args, **kwargs) 40 | 41 | def _get_translations(self): 42 | languages = tuple(self.LANGUAGES) if self.LANGUAGES else (self.meta.locales or None) 43 | if languages not in translations_cache: 44 | translations_cache[languages] = get_translations(languages) 45 | return translations_cache[languages] 46 | -------------------------------------------------------------------------------- /src/lib/wtforms/ext/i18n/utils.py: -------------------------------------------------------------------------------- 1 | """ 2 | Module is just here for compatibility reasons, and will be removed in a future release. 3 | 4 | Importing this will cause a DeprecationWarning. 5 | """ 6 | from wtforms.i18n import (messages_path, get_builtin_gnu_translations, get_translations, DefaultTranslations) 7 | import warnings 8 | 9 | __all__ = ('messages_path', 'get_builtin_gnu_translations', 'get_translations', 'DefaultTranslations') 10 | 11 | 12 | warnings.warn( 13 | 'i18n utils have been merged into core, and this module will go away in WTForms 3.0', 14 | category=DeprecationWarning, stacklevel=2 15 | ) 16 | -------------------------------------------------------------------------------- /src/lib/wtforms/ext/sqlalchemy/__init__.py: -------------------------------------------------------------------------------- 1 | import warnings 2 | 3 | warnings.warn( 4 | 'wtforms.ext.sqlalchemy is deprecated, and will be removed in WTForms 3.0. ' 5 | 'The package has been extracted to a separate package wtforms_sqlalchemy: ' 6 | 'https://github.com/wtforms/wtforms-sqlalchemy .\n' 7 | 'Or alternately, check out the WTForms-Alchemy package which provides declarative mapping and more: ' 8 | 'https://github.com/kvesteri/wtforms-alchemy', 9 | DeprecationWarning 10 | ) 11 | -------------------------------------------------------------------------------- /src/lib/wtforms/fields/__init__.py: -------------------------------------------------------------------------------- 1 | from wtforms.fields.core import * 2 | 3 | from wtforms.fields.simple import * 4 | 5 | # Compatibility imports 6 | from wtforms.fields.core import Label, Field, SelectFieldBase, Flags 7 | from wtforms.utils import unset_value as _unset_value 8 | -------------------------------------------------------------------------------- /src/lib/wtforms/fields/html5.py: -------------------------------------------------------------------------------- 1 | """ 2 | Fields to support various HTML5 input types. 3 | """ 4 | from ..widgets import html5 as widgets 5 | from . import core 6 | 7 | __all__ = ( 8 | 'DateField', 'DateTimeField', 'DateTimeLocalField', 'DecimalField', 9 | 'DecimalRangeField', 'EmailField', 'IntegerField', 'IntegerRangeField', 10 | 'SearchField', 'TelField', 'URLField', 11 | ) 12 | 13 | 14 | class SearchField(core.StringField): 15 | """ 16 | Represents an ````. 17 | """ 18 | widget = widgets.SearchInput() 19 | 20 | 21 | class TelField(core.StringField): 22 | """ 23 | Represents an ````. 24 | """ 25 | widget = widgets.TelInput() 26 | 27 | 28 | class URLField(core.StringField): 29 | """ 30 | Represents an ````. 31 | """ 32 | widget = widgets.URLInput() 33 | 34 | 35 | class EmailField(core.StringField): 36 | """ 37 | Represents an ````. 38 | """ 39 | widget = widgets.EmailInput() 40 | 41 | 42 | class DateTimeField(core.DateTimeField): 43 | """ 44 | Represents an ````. 45 | """ 46 | widget = widgets.DateTimeInput() 47 | 48 | 49 | class DateField(core.DateField): 50 | """ 51 | Represents an ````. 52 | """ 53 | widget = widgets.DateInput() 54 | 55 | 56 | class DateTimeLocalField(core.DateTimeField): 57 | """ 58 | Represents an ````. 59 | """ 60 | widget = widgets.DateTimeLocalInput() 61 | 62 | 63 | class IntegerField(core.IntegerField): 64 | """ 65 | Represents an ````. 66 | """ 67 | widget = widgets.NumberInput(step='1') 68 | 69 | 70 | class DecimalField(core.DecimalField): 71 | """ 72 | Represents an ````. 73 | """ 74 | widget = widgets.NumberInput(step='any') 75 | 76 | 77 | class IntegerRangeField(core.IntegerField): 78 | """ 79 | Represents an ````. 80 | """ 81 | widget = widgets.RangeInput(step='1') 82 | 83 | 84 | class DecimalRangeField(core.DecimalField): 85 | """ 86 | Represents an ````. 87 | """ 88 | widget = widgets.RangeInput(step='any') 89 | -------------------------------------------------------------------------------- /src/lib/wtforms/fields/simple.py: -------------------------------------------------------------------------------- 1 | import warnings 2 | 3 | from .. import widgets 4 | from .core import StringField, BooleanField 5 | 6 | 7 | __all__ = ( 8 | 'BooleanField', 'TextAreaField', 'PasswordField', 'FileField', 9 | 'HiddenField', 'SubmitField', 'TextField' 10 | ) 11 | 12 | 13 | class TextField(StringField): 14 | """ 15 | Legacy alias for StringField 16 | 17 | .. deprecated:: 2.0 18 | """ 19 | def __init__(self, *args, **kw): 20 | super(TextField, self).__init__(*args, **kw) 21 | warnings.warn( 22 | 'The TextField alias for StringField has been deprecated and will be removed in WTForms 3.0', 23 | DeprecationWarning, stacklevel=2 24 | ) 25 | 26 | 27 | class TextAreaField(StringField): 28 | """ 29 | This field represents an HTML ``