docstring_tokens stringlengths 0 76.5k | code_tokens stringlengths 75 1.81M | label_window listlengths 4 2.12k | html_url stringlengths 74 116 | file_name stringlengths 3 311 |
|---|---|---|---|---|
logger = logging.getLogger('flask.app')
if app.debug and logger.level == logging.NOTSET:
logger.setLevel(logging.DEBUG)
if not has_level_handler(logger):
logger.addHandler(default_handler) | <mask> level based on the application's debug flag. Furthermore this
<mask> function also removes all attached handlers in case there was a
<mask> logger with the log name before.
<mask> """
<mask> Logger = getLoggerClass()
<mask>
<mask> class DebugLogger(Logger):
<mask> def ge... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"re... | https://github.com/pallets/flask/commit/66b1b752da1ccc67c1073d4a99c4141a1b2be445 | flask/logging.py |
<mask>
<mask>
<mask> def test_teardown_request_handler_error(app, client):
<mask> called = []
<mask> app.config['LOGGER_HANDLER_POLICY'] = 'never'
<mask> app.testing = False
<mask>
<mask> @app.teardown_request
<mask> def teardown_request1(exc):
<mask> assert type(exc) == ZeroDiv... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/66b1b752da1ccc67c1073d4a99c4141a1b2be445 | tests/test_basic.py | |
<mask> assert called == [1, 2, 3, 4, 5, 6]
<mask>
<mask>
<mask> def test_error_handling(app, client):
<mask> app.config['LOGGER_HANDLER_POLICY'] = 'never'
<mask> app.testing = False
<mask>
<mask> @app.errorhandler(404)
<mask> def not_found(e):
<mask> return 'not found', 404
</s... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/66b1b752da1ccc67c1073d4a99c4141a1b2be445 | tests/test_basic.py | |
<mask> assert 'Use a subclass' in exc_info.value.args[0]
<mask>
<mask>
<mask> def test_error_handling_processing(app, client):
<mask> app.config['LOGGER_HANDLER_POLICY'] = 'never'
<mask> app.testing = False
<mask>
<mask> @app.errorhandler(500)
<mask> def internal_server_error(e):
<mask>... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/66b1b752da1ccc67c1073d4a99c4141a1b2be445 | tests/test_basic.py | |
<mask> assert resp.data == b'internal server error'
<mask>
<mask>
<mask> def test_baseexception_error_handling(app, client):
<mask> app.config['LOGGER_HANDLER_POLICY'] = 'never'
<mask> app.testing = False
<mask>
<mask> @app.route('/')
<mask> def broken_func():
<mask> raise Keybo... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/66b1b752da1ccc67c1073d4a99c4141a1b2be445 | tests/test_basic.py | |
<mask>
<mask>
<mask> def test_exception_propagation(app, client):
<mask> def apprunner(config_key):
<mask> app.config['LOGGER_HANDLER_POLICY'] = 'never'
<mask>
<mask> @app.route('/')
<mask> def index():
<mask> 1 // 0
<mask>
</s> simplify logging configuration
singl... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/66b1b752da1ccc67c1073d4a99c4141a1b2be445 | tests/test_basic.py | |
import datetime | <mask> :copyright: (c) 2015 by Armin Ronacher.
<mask> :license: BSD, see LICENSE for more details.
<mask> """
<mask>
<mask> import pytest
<mask>
<mask> import os
<mask> import uuid
<mask> import datetime
<mask>
<mask> import flask
</s> simplify logging configuration
single default handler and for... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/66b1b752da1ccc67c1073d4a99c4141a1b2be445 | tests/test_helpers.py |
<mask> import pytest
<mask>
<mask> import os
<mask> import uuid
<mask> import datetime
<mask>
<mask> import flask
<mask> from logging import StreamHandler
<mask> from werkzeug.datastructures import Range
<mask> from werkzeug.exceptions import BadRequest, NotFound
</s> simplify logging configuration
single ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/66b1b752da1ccc67c1073d4a99c4141a1b2be445 | tests/test_helpers.py | |
import pytest | <mask> import os
<mask> import uuid
<mask> import datetime
<mask>
<mask> import flask
<mask> from logging import StreamHandler
<mask> from werkzeug.datastructures import Range
<mask> from werkzeug.exceptions import BadRequest, NotFound
<mask> from werkzeug.http import parse_cache_control_header, parse_options... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/66b1b752da1ccc67c1073d4a99c4141a1b2be445 | tests/test_helpers.py |
from werkzeug.http import http_date, parse_cache_control_header, \
parse_options_header
import flask | <mask> import flask
<mask> from logging import StreamHandler
<mask> from werkzeug.datastructures import Range
<mask> from werkzeug.exceptions import BadRequest, NotFound
<mask> from werkzeug.http import parse_cache_control_header, parse_options_header
<mask> from werkzeug.http import http_date
<mask> from flask.... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/66b1b752da1ccc67c1073d4a99c4141a1b2be445 | tests/test_helpers.py |
from flask.helpers import get_debug_flag | <mask> from werkzeug.exceptions import BadRequest, NotFound
<mask> from werkzeug.http import parse_cache_control_header, parse_options_header
<mask> from werkzeug.http import http_date
<mask> from flask._compat import StringIO, text_type
<mask> from flask.helpers import get_debug_flag, make_response
<mask>
<mas... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/66b1b752da1ccc67c1073d4a99c4141a1b2be445 | tests/test_helpers.py |
class TestUrlFor(object): | <mask> with pytest.raises(BadRequest):
<mask> flask.send_from_directory('static', 'bad\x00')
<mask>
<mask>
<mask> class TestLogging(object):
<mask> def test_logger_cache(self):
<mask> app = flask.Flask(__name__)
<mask> logger1 = app.logger
<mask> assert app.log... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"re... | https://github.com/pallets/flask/commit/66b1b752da1ccc67c1073d4a99c4141a1b2be445 | tests/test_helpers.py |
<mask> :copyright: (c) 2015 by Armin Ronacher.
<mask> :license: BSD, see LICENSE for more details.
<mask> """
<mask> import flask
<mask> from logging import StreamHandler
<mask>
<mask> from flask._compat import StringIO
<mask>
<mask>
<mask> def test_suppressed_exception_logging():
</s> simplify lo... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/66b1b752da1ccc67c1073d4a99c4141a1b2be445 | tests/test_subclassing.py | |
<mask> pass
<mask>
<mask> out = StringIO()
<mask> app = SuppressedFlask(__name__)
<mask> app.logger_name = 'flask_tests/test_suppressed_exception_logging'
<mask> app.logger.addHandler(StreamHandler(out))
<mask>
<mask> @app.route('/')
<mask> def index():
<mask> 1 /... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/66b1b752da1ccc67c1073d4a99c4141a1b2be445 | tests/test_subclassing.py | |
raise Exception('test') | <mask> app.logger.addHandler(StreamHandler(out))
<mask>
<mask> @app.route('/')
<mask> def index():
<mask> 1 // 0
<mask>
<mask> rv = app.test_client().get('/')
<mask> assert rv.status_code == 500
<mask> assert b'Internal Server Error' in rv.data
<mask>
</s> simplify logging ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/66b1b752da1ccc67c1073d4a99c4141a1b2be445 | tests/test_subclassing.py |
rv = app.test_client().get('/', errors_stream=out) | <mask> @app.route('/')
<mask> def index():
<mask> 1 // 0
<mask>
<mask> rv = app.test_client().get('/')
<mask> assert rv.status_code == 500
<mask> assert b'Internal Server Error' in rv.data
<mask>
<mask> err = out.getvalue()
<mask> assert err == ''
</s> simplify logging c... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/66b1b752da1ccc67c1073d4a99c4141a1b2be445 | tests/test_subclassing.py |
assert not out.getvalue() | <mask>
<mask> rv = app.test_client().get('/')
<mask> assert rv.status_code == 500
<mask> assert b'Internal Server Error' in rv.data
<mask>
<mask> err = out.getvalue()
<mask> assert err == ''
</s> simplify logging configuration
single default handler and formatter
don't remove handlers
conf... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace"
] | https://github.com/pallets/flask/commit/66b1b752da1ccc67c1073d4a99c4141a1b2be445 | tests/test_subclassing.py |
def test_template_loader_debugging(test_apps, monkeypatch): | <mask> assert app.templates_auto_reload == True
<mask> assert app.jinja_env.auto_reload == True
<mask>
<mask>
<mask> def test_template_loader_debugging(test_apps):
<mask> from blueprintapp import app
<mask>
<mask> called = []
<mask>
<mask> class _TestHandler(logging.Handler):
</s> sim... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/66b1b752da1ccc67c1073d4a99c4141a1b2be445 | tests/test_templating.py |
monkeypatch.setitem(app.config, 'EXPLAIN_TEMPLATE_LOADING', True)
monkeypatch.setattr(
logging.getLogger('flask'), 'handlers', [_TestHandler()]
)
with pytest.raises(TemplateNotFound) as excinfo:
c.get('/missing')
assert 'missing_template.html' in str(exc... | <mask> 'the blueprint "frontend"') in text
<mask> assert 'See http://flask.pocoo.org/docs/blueprints/#templates' in text
<mask>
<mask> with app.test_client() as c:
<mask> try:
<mask> old_load_setting = app.config['EXPLAIN_TEMPLATE_LOADING']
<mask> ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/66b1b752da1ccc67c1073d4a99c4141a1b2be445 | tests/test_templating.py |
<mask> assert 'cookies' in str(e.value)
<mask>
<mask>
<mask> def test_test_client_context_binding(app, client):
<mask> app.config['LOGGER_HANDLER_POLICY'] = 'never'
<mask> app.testing = False
<mask>
<mask> @app.route('/')
<mask> def index():
<mask> flask.g.value = 42
</s> simpl... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/66b1b752da1ccc67c1073d4a99c4141a1b2be445 | tests/test_testing.py | |
#: the accessed variable indicates whether or not the session object has
#: been accessed in that request. This allows flask to append a `Vary:
#: Cookie` header to the response if the session is being accessed. This
#: allows caching proxy servers, like Varnish, to use both the URL and the
#: sessi... | <mask> #: long as changes do not happen on mutable structures in the session.
<mask> #: The default mixin implementation just hardcodes `True` in.
<mask> modified = True
<mask>
<mask>
<mask> class TaggedJSONSerializer(object):
<mask> """A customized JSON serializer that supports a few extra typ... | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/671c67aac96ae2cdf9c554ba4e52c167862be6fe | flask/sessions.py |
self.accessed = True | <mask>
<mask> def __init__(self, initial=None):
<mask> def on_update(self):
<mask> self.modified = True
<mask> CallbackDict.__init__(self, initial, on_update)
<mask> self.modified = False
<mask> self.accessed = False
<mask>
<mask> def __getitem__(self, key)... | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/671c67aac96ae2cdf9c554ba4e52c167862be6fe | flask/sessions.py |
self.accessed = False | <mask> CallbackDict.__init__(self, initial, on_update)
<mask> self.modified = False
<mask>
<mask> def __getitem__(self, key):
<mask> self.accessed = True
<mask> return super(SecureCookieSession, self).__getitem__(key)
<mask>
</s> Append a 'Vary: Cookie' header to the respon... | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/671c67aac96ae2cdf9c554ba4e52c167862be6fe | flask/sessions.py |
def __getitem__(self, key):
self.accessed = True
return super(SecureCookieSession, self).__getitem__(key)
def get(self, key, default=None):
self.accessed = True
return super(SecureCookieSession, self).get(key, default) | <mask> self.accessed = False
<mask>
<mask>
<mask> class NullSession(SecureCookieSession):
<mask> """Class used to generate nicer error messages if sessions are not
<mask> available. Will still allow read-only access to the empty session
</s> Append a 'Vary: Cookie' header to the response when ... | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/671c67aac96ae2cdf9c554ba4e52c167862be6fe | flask/sessions.py |
if session.accessed:
response.headers.add('Vary', 'Cookie')
else:
# Delete case. If there is no session we bail early.
# If the session was modified to be empty we remove the
# whole cookie.
if not session:
if session.modifi... | <mask> def save_session(self, app, session, response):
<mask> domain = self.get_cookie_domain(app)
<mask> path = self.get_cookie_path(app)
<mask>
<mask> # Delete case. If there is no session we bail early.
<mask> # If the session was modified to be empty we remove the
<mask>... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"k... | https://github.com/pallets/flask/commit/671c67aac96ae2cdf9c554ba4e52c167862be6fe | flask/sessions.py |
@app.route('/test/') | <mask> flask.flash(u'Hello World', 'error')
<mask> flask.flash(flask.Markup(u'<em>Testing</em>'), 'warning')
<mask> return ''
<mask>
<mask> @app.route('/test')
<mask> def test():
<mask> messages = flask.get_flashed_messages()
<mask> se... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/676b3a4c13986f5743b8e6f3fa4d7c6cc2a401a4 | flask/testsuite/basic.py |
@app.route('/test_with_categories/') | <mask> self.assert_equal(messages[1], u'Hello World')
<mask> self.assert_equal(messages[2], flask.Markup(u'<em>Testing</em>'))
<mask> return ''
<mask>
<mask> @app.route('/test_with_categories')
<mask> def test_with_categories():
<mask> messages = f... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/676b3a4c13986f5743b8e6f3fa4d7c6cc2a401a4 | flask/testsuite/basic.py |
@app.route('/test_filter/') | <mask> self.assert_equal(messages[1], ('error', u'Hello World'))
<mask> self.assert_equal(messages[2], ('warning', flask.Markup(u'<em>Testing</em>')))
<mask> return ''
<mask>
<mask> @app.route('/test_filter')
<mask> def test_filter():
<mask> messag... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/676b3a4c13986f5743b8e6f3fa4d7c6cc2a401a4 | flask/testsuite/basic.py |
@app.route('/test_filters/') | <mask> self.assert_equal(len(messages), 1)
<mask> self.assert_equal(messages[0], ('message', u'Hello World'))
<mask> return ''
<mask>
<mask> @app.route('/test_filters')
<mask> def test_filters():
<mask> messages = flask.get_flashed_messages(categor... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/676b3a4c13986f5743b8e6f3fa4d7c6cc2a401a4 | flask/testsuite/basic.py |
@app.route('/test_filters_without_returning_categories/') | <mask> self.assert_equal(messages[0], ('message', u'Hello World'))
<mask> self.assert_equal(messages[1], ('warning', flask.Markup(u'<em>Testing</em>')))
<mask> return ''
<mask>
<mask> @app.route('/test_filters_without_returning_categories')
<mask> def test_filt... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/676b3a4c13986f5743b8e6f3fa4d7c6cc2a401a4 | flask/testsuite/basic.py |
# Note: if status code assertions are missing, failed tests still pass.
#
# Since app.test_client() does not set debug=True, the AssertionErrors
# in the view functions are swallowed and the only indicator is a 500
# status code.
#
# Also, create new test client o... | <mask> self.assert_equal(messages[1], flask.Markup(u'<em>Testing</em>'))
<mask> return ''
<mask>
<mask> c = app.test_client()
<mask> c.get('/')
<mask> assert c.get('/test/').status_code == 200
<mask>
<mask> c = app.test_client()
<mask> c.get('/'... | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/676b3a4c13986f5743b8e6f3fa4d7c6cc2a401a4 | flask/testsuite/basic.py |
c.get('/')
assert c.get('/test/').status_code == 200 | <mask> self.assert_equal(messages[1], flask.Markup(u'<em>Testing</em>'))
<mask> return ''
<mask>
<mask> c = app.test_client()
<mask> c.get('/') # Flash some messages.
<mask> c.get('/test')
<mask>
<mask> c.get('/') # Flash more messages.
<mask> c... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/676b3a4c13986f5743b8e6f3fa4d7c6cc2a401a4 | flask/testsuite/basic.py |
c = app.test_client()
c.get('/')
assert c.get('/test_with_categories/').status_code == 200 | <mask> c = app.test_client()
<mask> c.get('/') # Flash some messages.
<mask> c.get('/test')
<mask>
<mask> c.get('/') # Flash more messages.
<mask> c.get('/test_with_categories')
<mask>
<mask> c.get('/') # Flash more messages.
<mask> c.get('/test_filter'... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/676b3a4c13986f5743b8e6f3fa4d7c6cc2a401a4 | flask/testsuite/basic.py |
c = app.test_client()
c.get('/')
assert c.get('/test_filter/').status_code == 200 | <mask>
<mask> c.get('/') # Flash more messages.
<mask> c.get('/test_with_categories')
<mask>
<mask> c.get('/') # Flash more messages.
<mask> c.get('/test_filter')
<mask>
<mask> c.get('/') # Flash more messages.
<mask> c.get('/test_filters')
<mask>
<mask> ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/676b3a4c13986f5743b8e6f3fa4d7c6cc2a401a4 | flask/testsuite/basic.py |
c = app.test_client()
c.get('/')
assert c.get('/test_filters/').status_code == 200 | <mask>
<mask> c.get('/') # Flash more messages.
<mask> c.get('/test_filter')
<mask>
<mask> c.get('/') # Flash more messages.
<mask> c.get('/test_filters')
<mask>
<mask> c.get('/') # Flash more messages.
<mask> c.get('/test_filters_without_returning_categories'... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/676b3a4c13986f5743b8e6f3fa4d7c6cc2a401a4 | flask/testsuite/basic.py |
c = app.test_client()
c.get('/')
assert c.get('/test_filters_without_returning_categories/').status_code == 200 | <mask>
<mask> c.get('/') # Flash more messages.
<mask> c.get('/test_filters')
<mask>
<mask> c.get('/') # Flash more messages.
<mask> c.get('/test_filters_without_returning_categories')
<mask>
<mask> def test_request_processing(self):
<mask> app = flask.Flask(__nam... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/676b3a4c13986f5743b8e6f3fa4d7c6cc2a401a4 | flask/testsuite/basic.py |
docs/_build/ | <mask> .cache/
<mask> .idea/
<mask>
<mask> # Coverage reports
<mask> htmlcov
<mask> .coverage
</s> use theme provided by pallets-sphinx-themes </s> remove #
# Flask documentation build configuration file, created by
# sphinx-quickstart on Tue Apr 6 15:24:58 2010.
#
# This file is execfile()d with the current d... | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/679bf0014f298a1ab8f989989fa430f69d9e28c0 | .gitignore |
.. _blinker: https://pypi.org/project/blinker/ | <mask> - modules can now register for a subdomain instead of just an URL
<mask> prefix. This makes it possible to bind a whole module to a
<mask> configurable subdomain.
<mask>
<mask> .. _blinker: https://pypi.python.org/pypi/blinker
<mask>
<mask> Version 0.5.2
<mask> -------------
<mask>
<mask> Bugfi... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/679bf0014f298a1ab8f989989fa430f69d9e28c0 | CHANGES |
# Minimal makefile for Sphinx documentation | <mask> # Makefile for Sphinx documentation
<mask> #
<mask>
<mask> # You can set these variables from the command line.
<mask> SPHINXOPTS =
<mask> SPHINXBUILD = sphinx-build
</s> use theme provided by pallets-sphinx-themes </s> remove PAPER =
</s> add SPHINXPROJ = Flask
SOURCEDIR = . </s> re... | [
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/679bf0014f298a1ab8f989989fa430f69d9e28c0 | docs/Makefile |
SPHINXPROJ = Flask
SOURCEDIR = . | <mask>
<mask> # You can set these variables from the command line.
<mask> SPHINXOPTS =
<mask> SPHINXBUILD = sphinx-build
<mask> PAPER =
<mask> BUILDDIR = _build
<mask>
<mask> # Internal variables.
<mask> PAPEROPT_a4 = -D latex_paper_size=a4
<mask> PAPEROPT_letter = -D latex_paper_size=... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/679bf0014f298a1ab8f989989fa430f69d9e28c0 | docs/Makefile |
# Put it first so that "make" without argument is like "make help". | <mask> SPHINXBUILD = sphinx-build
<mask> PAPER =
<mask> BUILDDIR = _build
<mask>
<mask> # Internal variables.
<mask> PAPEROPT_a4 = -D latex_paper_size=a4
<mask> PAPEROPT_letter = -D latex_paper_size=letter
<mask> ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/679bf0014f298a1ab8f989989fa430f69d9e28c0 | docs/Makefile |
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | <mask>
<mask> .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp epub latex changes linkcheck doctest
<mask>
<mask> help:
<mask> @echo "Please use \`make <target>' where <target> is one of"
<mask> @echo " html to make standalone HTML files"
<mask> @echo " dirhtml to make HTML ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"re... | https://github.com/pallets/flask/commit/679bf0014f298a1ab8f989989fa430f69d9e28c0 | docs/Makefile |
.PHONY: help Makefile | <mask> $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
<mask> @echo
<mask> @echo "The overview file is in $(BUILDDIR)/changes."
<mask>
<mask> linkcheck:
<mask> $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
<mask> @echo
<mask> @echo "Link check complete; look for any er... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/679bf0014f298a1ab8f989989fa430f69d9e28c0 | docs/Makefile |
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | <mask> @echo
<mask> @echo "Link check complete; look for any errors in the above output " \
<mask> "or in $(BUILDDIR)/linkcheck/output.txt."
<mask>
<mask> doctest:
<mask> $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
<mask> @echo "Testing of doctests in the sources finished, look at ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace"
] | https://github.com/pallets/flask/commit/679bf0014f298a1ab8f989989fa430f69d9e28c0 | docs/Makefile |
.. _blinker: https://pypi.org/project/blinker/ | <mask> do nothing but will fail with a :exc:`RuntimeError` for all other
<mask> operations, including connecting.
<mask>
<mask>
<mask> .. _blinker: https://pypi.python.org/pypi/blinker
<mask>
<mask>
<mask> Class-Based Views
<mask> -----------------
<mask>
</s> use theme provided by pallets-s... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/679bf0014f298a1ab8f989989fa430f69d9e28c0 | docs/api.rst |
<mask> # -*- coding: utf-8 -*-
<mask> #
<mask> # Flask documentation build configuration file, created by
<mask> # sphinx-quickstart on Tue Apr 6 15:24:58 2010.
<mask> #
<mask> # This file is execfile()d with the current directory set to its containing dir.
<mask> #
<mask> # Note that not all possible configur... | [
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/679bf0014f298a1ab8f989989fa430f69d9e28c0 | docs/conf.py | |
<mask> #
<mask> # All configuration values have a default; values that are commented out
<mask> # serve to show the default.
<mask> from __future__ import print_function
<mask> from datetime import datetime
<mask> import os
<mask> import sys
<mask> import pkg_resources
<mask>
<mask> # If extensions (or modul... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/679bf0014f298a1ab8f989989fa430f69d9e28c0 | docs/conf.py | |
import inspect
import re | <mask> import os
<mask> import sys
<mask> import pkg_resources
<mask>
<mask> # If extensions (or modules to document with autodoc) are in another directory,
<mask> # add these directories to sys.path here. If the directory is relative to the
<mask> # documentation root, use os.path.abspath to make it absolute, ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/679bf0014f298a1ab8f989989fa430f69d9e28c0 | docs/conf.py |
from pallets_sphinx_themes import ProjectLink, get_version | <mask> # documentation root, use os.path.abspath to make it absolute, like shown here.
<mask> sys.path.append(os.path.join(os.path.dirname(__file__), '_themes'))
<mask> sys.path.append(os.path.dirname(__file__))
<mask>
<mask> # -- General configuration -----------------------------------------------------
<mask>... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/679bf0014f298a1ab8f989989fa430f69d9e28c0 | docs/conf.py |
# Project -------------------------------------------------------------- | <mask> sys.path.append(os.path.dirname(__file__))
<mask>
<mask> # -- General configuration -----------------------------------------------------
<mask>
<mask> # If your documentation needs a minimal Sphinx version, state it here.
<mask> #needs_sphinx = '1.0'
<mask>
<mask> # Add any Sphinx extension module na... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/679bf0014f298a1ab8f989989fa430f69d9e28c0 | docs/conf.py |
project = 'Flask'
copyright = '2010 Pallets Team'
author = 'Pallets Team'
release, version = get_version('Flask') | <mask>
<mask> # If your documentation needs a minimal Sphinx version, state it here.
<mask> #needs_sphinx = '1.0'
<mask>
<mask> # Add any Sphinx extension module names here, as strings. They can be extensions
<mask> # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
<mask> extensions = [
<mask> ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/679bf0014f298a1ab8f989989fa430f69d9e28c0 | docs/conf.py |
# General -------------------------------------------------------------- | <mask>
<mask> # The suffix of source filenames.
<mask> source_suffix = '.rst'
<mask>
<mask> # The encoding of source files.
<mask> #source_encoding = 'utf-8-sig'
<mask>
<mask> # The master toctree document.
<mask> master_doc = 'index'
<mask>
<mask> # General information about the project.
</s> use theme... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/679bf0014f298a1ab8f989989fa430f69d9e28c0 | docs/conf.py |
<mask>
<mask> # The encoding of source files.
<mask> #source_encoding = 'utf-8-sig'
<mask>
<mask> # The master toctree document.
<mask> master_doc = 'index'
<mask>
<mask> # General information about the project.
<mask> project = u'Flask'
<mask> copyright = u'2010 - {0}, Armin Ronacher'.format(datetime.utcn... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/679bf0014f298a1ab8f989989fa430f69d9e28c0 | docs/conf.py | |
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
'sphinxcontrib.log_cabinet',
] | <mask>
<mask> # The master toctree document.
<mask> master_doc = 'index'
<mask>
<mask> # General information about the project.
<mask> project = u'Flask'
<mask> copyright = u'2010 - {0}, Armin Ronacher'.format(datetime.utcnow().year)
<mask>
<mask> # The version info for the project you're documenting, acts ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"re... | https://github.com/pallets/flask/commit/679bf0014f298a1ab8f989989fa430f69d9e28c0 | docs/conf.py |
intersphinx_mapping = {
# 'python': ('https://docs.python.org/3/', None),
# 'werkzeug': ('http://werkzeug.pocoo.org/docs/', None),
# 'click': ('http://click.pocoo.org/', None),
# 'jinja': ('http://jinja.pocoo.org/docs/', None),
# 'itsdangerous': ('https://pythonhosted.org/itsdangerous', None),
#... | <mask> # relative to this directory. They are copied after the builtin static files,
<mask> # so a file named "default.css" will overwrite the builtin "default.css".
<mask> html_static_path = ['_static']
<mask>
<mask> # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
<mask> # using th... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/679bf0014f298a1ab8f989989fa430f69d9e28c0 | docs/conf.py |
# HTML ----------------------------------------------------------------- | <mask> # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
<mask> # using the given strftime format.
<mask> #html_last_updated_fmt = '%b %d, %Y'
<mask>
<mask> # If true, SmartyPants will be used to convert quotes and dashes to
<mask> # typographically correct entities.
<mask> #html_use... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/679bf0014f298a1ab8f989989fa430f69d9e28c0 | docs/conf.py |
html_theme = 'flask'
html_context = {
'project_links': [
ProjectLink('Flask Website', 'https://palletsprojects.com/p/flask/'),
ProjectLink('PyPI releases', 'https://pypi.org/project/Flask/'),
ProjectLink('Source Code', 'https://github.com/pallets/flask/'),
ProjectLink(
'I... | <mask> # If true, SmartyPants will be used to convert quotes and dashes to
<mask> # typographically correct entities.
<mask> #html_use_smartypants = True
<mask>
<mask> # Custom sidebar templates, maps document names to template names.
<mask> html_sidebars = {
<mask> 'index': [
<mask> 'sidebarintro.... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/679bf0014f298a1ab8f989989fa430f69d9e28c0 | docs/conf.py |
'project.html',
'versions.html',
'searchbox.html', | <mask>
<mask> # Custom sidebar templates, maps document names to template names.
<mask> html_sidebars = {
<mask> 'index': [
<mask> 'sidebarintro.html',
<mask> 'sourcelink.html',
<mask> 'searchbox.html'
<mask> ],
<mask> '**': [
<mask> 'sidebarlogo.html',
<mask> ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/679bf0014f298a1ab8f989989fa430f69d9e28c0 | docs/conf.py |
<mask> 'sourcelink.html',
<mask> 'searchbox.html'
<mask> ],
<mask> '**': [
<mask> 'sidebarlogo.html',
<mask> 'localtoc.html',
<mask> 'relations.html',
<mask> 'sourcelink.html',
<mask> 'searchbox.html'
<mask> ]
</s> use theme provided by pall... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/679bf0014f298a1ab8f989989fa430f69d9e28c0 | docs/conf.py | |
'versions.html',
'carbon_ads.html',
'searchbox.html', | <mask> '**': [
<mask> 'sidebarlogo.html',
<mask> 'localtoc.html',
<mask> 'relations.html',
<mask> 'sourcelink.html',
<mask> 'searchbox.html'
<mask> ]
<mask> }
<mask>
<mask> # Additional templates that should be rendered to pages, maps page names to
<mask> # te... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/679bf0014f298a1ab8f989989fa430f69d9e28c0 | docs/conf.py |
html_static_path = ['_static']
html_favicon = '_static/flask-favicon.ico'
html_logo = '_static/flask.png'
html_additional_pages = {
'404': '404.html',
}
html_show_sourcelink = False | <mask> 'searchbox.html',
<mask> ]
<mask> }
<mask>
<mask> # LaTeX ----------------------------------------------------------------
<mask>
<mask> latex_documents = [
</s> use theme provided by pallets-sphinx-themes </s> remove # Grouping the document tree into LaTeX files. List of tuples
# (source s... | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/679bf0014f298a1ab8f989989fa430f69d9e28c0 | docs/conf.py |
# LaTeX ---------------------------------------------------------------- | <mask> 'searchbox.html'
<mask> ]
<mask> }
<mask>
<mask> # Additional templates that should be rendered to pages, maps page names to
<mask> # template names.
<mask> #html_additional_pages = {}
<mask>
<mask> # If false, no module index is generated.
<mask> html_use_modindex = False
<mask>
<mask... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"re... | https://github.com/pallets/flask/commit/679bf0014f298a1ab8f989989fa430f69d9e28c0 | docs/conf.py |
<mask>
<mask>
<mask> # -- Options for LaTeX output --------------------------------------------------
<mask>
<mask> # Grouping the document tree into LaTeX files. List of tuples
<mask> # (source start file, target name, title, author, documentclass [howto/manual]).
<mask> latex_documents = [
<mask> ('latex... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/679bf0014f298a1ab8f989989fa430f69d9e28c0 | docs/conf.py | |
(master_doc, 'Flask.tex', 'Flask Documentation', 'Pallets Team', 'manual'), | <mask>
<mask> # Grouping the document tree into LaTeX files. List of tuples
<mask> # (source start file, target name, title, author, documentclass [howto/manual]).
<mask> latex_documents = [
<mask> ('latexindex', 'Flask.tex', u'Flask Documentation', u'Armin Ronacher', 'manual'),
<mask> ]
<mask>
<mask> # Doc... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/679bf0014f298a1ab8f989989fa430f69d9e28c0 | docs/conf.py |
<mask> # (source start file, target name, title, author, documentclass [howto/manual]).
<mask> latex_documents = [
<mask> ('latexindex', 'Flask.tex', u'Flask Documentation', u'Armin Ronacher', 'manual'),
<mask> ]
<mask>
<mask> # Documents to append as an appendix to all manuals.
<mask> #latex_appendices = []
... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/679bf0014f298a1ab8f989989fa430f69d9e28c0 | docs/conf.py | |
<mask> # If false, no module index is generated.
<mask> latex_use_modindex = False
<mask>
<mask> latex_elements = {
<mask> 'fontpkg': r'\usepackage{mathpazo}',
<mask> 'papersize': 'a4paper',
<mask> 'pointsize': '12pt',
<mask> 'preamble': r'\usepackage{flaskstyle}'
<mask> }
<mask> latex_use_pa... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/679bf0014f298a1ab8f989989fa430f69d9e28c0 | docs/conf.py | |
'fontpkg': r'\usepackage{mathpazo}',
'preamble': r'\usepackage{flaskstyle}', | <mask> latex_elements = {
<mask> 'fontpkg': r'\usepackage{mathpazo}',
<mask> 'papersize': 'a4paper',
<mask> 'pointsize': '12pt',
<mask> 'preamble': r'\usepackage{flaskstyle}'
<mask> }
<mask> latex_use_parts = True
<mask>
<mask> latex_additional_files = ['flaskstyle.sty', 'logo.pdf']
<mask>
... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/679bf0014f298a1ab8f989989fa430f69d9e28c0 | docs/conf.py |
# linkcheck ------------------------------------------------------------ | <mask> }
<mask> latex_use_parts = True
<mask> latex_additional_files = ['flaskstyle.sty', 'logo.pdf']
<mask>
<mask>
<mask> linkcheck_anchors = False
<mask>
<mask> # Local Extensions -----------------------------------------------------
</s> use theme provided by pallets-sphinx-themes </s> remove 'preamb... | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/679bf0014f298a1ab8f989989fa430f69d9e28c0 | docs/conf.py |
linkcheck_anchors = False | <mask>
<mask> latex_additional_files = ['flaskstyle.sty', 'logo.pdf']
<mask>
<mask>
<mask> # -- Options for Epub output ---------------------------------------------------
<mask>
<mask> # Bibliographic Dublin Core info.
<mask> #epub_title = ''
<mask> #epub_author = ''
<mask> #epub_publisher = ''
<mask> #... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"re... | https://github.com/pallets/flask/commit/679bf0014f298a1ab8f989989fa430f69d9e28c0 | docs/conf.py |
# Local Extensions ----------------------------------------------------- | <mask>
<mask> # A list of files that should not be packed into the epub file.
<mask> #epub_exclude_files = []
<mask>
<mask> # The depth of the table of contents in toc.ncx.
<mask> #epub_tocdepth = 3
<mask>
<mask> intersphinx_mapping = {
<mask> 'python': ('https://docs.python.org/3/', None),
<mask> ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/679bf0014f298a1ab8f989989fa430f69d9e28c0 | docs/conf.py |
<mask>
<mask> # The depth of the table of contents in toc.ncx.
<mask> #epub_tocdepth = 3
<mask>
<mask> intersphinx_mapping = {
<mask> 'python': ('https://docs.python.org/3/', None),
<mask> 'werkzeug': ('http://werkzeug.pocoo.org/docs/', None),
<mask> 'click': ('http://click.pocoo.org/', None),
<m... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"re... | https://github.com/pallets/flask/commit/679bf0014f298a1ab8f989989fa430f69d9e28c0 | docs/conf.py | |
.. _flup: https://pypi.org/project/flup/ | <mask>
<mask> .. _nginx: http://nginx.org/
<mask> .. _lighttpd: http://www.lighttpd.net/
<mask> .. _cherokee: http://cherokee-project.com/
<mask> .. _flup: https://pypi.python.org/pypi/flup
</s> use theme provided by pallets-sphinx-themes </s> remove .. _virtual python: https://pypi.python.org/pypi/virtualenv
<... | [
"keep",
"keep",
"keep",
"keep",
"replace"
] | https://github.com/pallets/flask/commit/679bf0014f298a1ab8f989989fa430f69d9e28c0 | docs/deploying/fastcgi.rst |
.. _virtual python: https://pypi.org/project/virtualenv/ | <mask> For more information consult the `mod_wsgi documentation`_.
<mask>
<mask> .. _mod_wsgi: https://github.com/GrahamDumpleton/mod_wsgi
<mask> .. _installation instructions: http://modwsgi.readthedocs.io/en/develop/installation.html
<mask> .. _virtual python: https://pypi.python.org/pypi/virtualenv
<mask> .. ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/679bf0014f298a1ab8f989989fa430f69d9e28c0 | docs/deploying/mod_wsgi.rst |
<mask> While `Flask Extension Registry`_ contains many Flask extensions, you may not find
<mask> an extension that fits your need. If this is the case, you can always create your own.
<mask> Consider reading :ref:`extension-dev` to develop your own Flask extension.
<mask>
<mask> Flask Before 0.8
<mask> --------... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"re... | https://github.com/pallets/flask/commit/679bf0014f298a1ab8f989989fa430f69d9e28c0 | docs/extensions.rst | |
<mask> exist and you can start importing from there.
<mask>
<mask>
<mask> .. _Flask Extension Registry: http://flask.pocoo.org/extensions/
<mask> .. _flaskext_compat.py: https://raw.githubusercontent.com/pallets/flask/master/scripts/flaskext_compat.py
</s> use theme provided by pallets-sphinx-themes </s> remove... | [
"keep",
"keep",
"keep",
"keep",
"replace"
] | https://github.com/pallets/flask/commit/679bf0014f298a1ab8f989989fa430f69d9e28c0 | docs/extensions.rst | |
:align: right | <mask> :alt: Flask: web development, one drop at a time
<mask> :class: floatingflask
<mask>
<mask> Welcome to Flask's documentation. This documentation is divided into
<mask> different parts. I recommend that you get started with
<mask> :ref:`installation` and then head over to the :ref:`quickstart`.
</... | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/679bf0014f298a1ab8f989989fa430f69d9e28c0 | docs/index.rst |
pushd %~dp0
| <mask> @ECHO OFF
<mask>
<mask> REM Command file for Sphinx documentation
<mask>
<mask> if "%SPHINXBUILD%" == "" (
<mask> set SPHINXBUILD=sphinx-build
<mask> )
<mask> set SOURCEDIR=.
</s> use theme provided by pallets-sphinx-themes </s> remove # Makefile for Sphinx documentation
</s> add # Minimal makefile ... | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/679bf0014f298a1ab8f989989fa430f69d9e28c0 | docs/make.bat |
set SOURCEDIR=. | <mask> if "%SPHINXBUILD%" == "" (
<mask> set SPHINXBUILD=sphinx-build
<mask> )
<mask> set BUILDDIR=_build
<mask> set SPHINXPROJ=Flask
<mask>
<mask> if "%1" == "" goto help
<mask>
</s> use theme provided by pallets-sphinx-themes </s> remove # Makefile for Sphinx documentation
</s> add # Minimal makefile for... | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/679bf0014f298a1ab8f989989fa430f69d9e28c0 | docs/make.bat |
<https://pypi.org/project/Flask-WTF/>`_. | <mask>
<mask> The `Flask-WTF`_ extension expands on this pattern and adds a
<mask> few little helpers that make working with forms and Flask more
<mask> fun. You can get it from `PyPI
<mask> <https://pypi.python.org/pypi/Flask-WTF>`_.
<mask>
<mask> .. _Flask-WTF: http://pythonhosted.org/Flask-WTF/... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/679bf0014f298a1ab8f989989fa430f69d9e28c0 | docs/patterns/wtforms.rst |
ERROR: type should be string, got " https://github.com/pallets/flask/tree/0.12.3/examples/minitwit/" | <mask> suite.
<mask>
<mask>
<mask> .. _MiniTwit Example:
<mask> https://github.com/pallets/flask/tree/master/examples/minitwit/
<mask>
<mask>
<mask> Other Testing Tricks
<mask> --------------------
<mask>
</s> use theme provided by pallets-sphinx-themes </s> remove .. _flup: https://pypi.python.org/p... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/679bf0014f298a1ab8f989989fa430f69d9e28c0 | docs/testing.rst |
.setdefault(self.name, []).append(f)) | <mask> self._record(self._register_rule, (rule, endpoint, view_func, options))
<mask>
<mask> def before_request(self, f):
<mask> self._record(lambda s: s.app.before_request_funcs
<mask> .setdefault(self.name, []).append(f), ())
<mask> return f
<mask>
<mask> def afte... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/67f4b0f31538832f06b9351d15e30c85f449ac7e | flask.py |
"""Like :meth:`flask.Flask.after_request` but for a module""" | <mask>
<mask> def after_request(self, f):
<mask> self._record(lambda s: s.app.after_request_funcs
<mask> .setdefault(self.name, []).append(f))
<mask> return f
<mask>
</s> Modules are now instanciated with the package name.
This makes it possible to load resources from the folde... | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/67f4b0f31538832f06b9351d15e30c85f449ac7e | flask.py |
.setdefault(self.name, []).append(f)) | <mask> return f
<mask>
<mask> def after_request(self, f):
<mask> self._record(lambda s: s.app.after_request_funcs
<mask> .setdefault(self.name, []).append(f), ())
<mask> return f
<mask>
<mask> def _record(self, func, args):
<mask> self._register_events.appe... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/67f4b0f31538832f06b9351d15e30c85f449ac7e | flask.py |
def _record(self, func):
self._register_events.append(func) | <mask> self._record(lambda s: s.app.after_request_funcs
<mask> .setdefault(self.name, []).append(f), ())
<mask> return f
<mask>
<mask> def _record(self, func, args):
<mask> self._register_events.append((func, args))
<mask>
<mask> def _register_rule(self, state, rule... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/67f4b0f31538832f06b9351d15e30c85f449ac7e | flask.py |
class Flask(_PackageBoundObject): | <mask> state.app.add_url_rule(rule, '%s.%s' % (self.name, endpoint),
<mask> view_func, **options)
<mask>
<mask>
<mask> class Flask(object):
<mask> """The flask object implements a WSGI application and acts as the central
<mask> object. It is passed the name of th... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/67f4b0f31538832f06b9351d15e30c85f449ac7e | flask.py |
def __init__(self, import_name):
_PackageBoundObject.__init__(self, import_name)
| <mask> autoescape=True,
<mask> extensions=['jinja2.ext.autoescape', 'jinja2.ext.with_']
<mask> )
<mask>
<mask> def __init__(self, package_name):
<mask> #: the debug flag. Set this to `True` to enable debugging of
<mask> #: the application. In debug mode the debugger wil... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/67f4b0f31538832f06b9351d15e30c85f449ac7e | flask.py |
<mask> #: will automatically reload the application if changes in the
<mask> #: code are detected.
<mask> self.debug = False
<mask>
<mask> #: the name of the package or module. Do not change this once
<mask> #: it was set by the constructor.
<mask> self.package_n... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/67f4b0f31538832f06b9351d15e30c85f449ac7e | flask.py | |
#: a dictionary with lists of functions that should be called at the
#: beginning of the request. The key of the dictionary is the name of
#: the module this function is active for, `None` for all requests.
#: This can for example be used to open database connections or
#: getti... | <mask> #: To register a error handler, use the :meth:`errorhandler`
<mask> #: decorator.
<mask> self.error_handlers = {}
<mask>
<mask> #: a list of functions that should be called at the beginning
<mask> #: of the request before request dispatching kicks in. This
<mask> ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/67f4b0f31538832f06b9351d15e30c85f449ac7e | flask.py |
#: a dictionary with lists of functions that should be called after
#: each request. The key of the dictionary is the name of the module
#: this function is active for, `None` for all requests. This can for
#: example be used to open database connections or getting hold of the
... | <mask> #: To register a function here, use the :meth:`before_request`
<mask> #: decorator.
<mask> self.before_request_funcs = {}
<mask>
<mask> #: a list of functions that are called at the end of the
<mask> #: request. The function is passed the current response
<mask> ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/67f4b0f31538832f06b9351d15e30c85f449ac7e | flask.py |
#: a dictionary with list of functions that are called without arguments
#: to populate the template context. They key of the dictionary is the
#: name of the module this function is active for, `None` for all
#: requests. Each returns a dictionary that the template context is
... | <mask> #: To register a function here use the :meth:`after_request`
<mask> #: decorator.
<mask> self.after_request_funcs = {}
<mask>
<mask> #: a list of functions that are called without arguments
<mask> #: to populate the template context. Each returns a dictionary
<mas... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/67f4b0f31538832f06b9351d15e30c85f449ac7e | flask.py |
target = (self.import_name, 'static') | <mask> if self.static_path is not None:
<mask> self.add_url_rule(self.static_path + '/<filename>',
<mask> build_only=True, endpoint='static')
<mask> if pkg_resources is not None:
<mask> target = (self.package_name, 'static')
<mask> ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/67f4b0f31538832f06b9351d15e30c85f449ac7e | flask.py |
return PackageLoader(self.import_name) | <mask> override this method.
<mask> """
<mask> if pkg_resources is None:
<mask> return FileSystemLoader(os.path.join(self.root_path, 'templates'))
<mask> return PackageLoader(self.package_name)
<mask>
<mask> def update_template_context(self, context):
<mask> ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/67f4b0f31538832f06b9351d15e30c85f449ac7e | flask.py |
funcs = self.template_context_processors[None]
mod = _request_ctx_stack.top.request.module
if mod is not None and mod in self.template_context_processors:
funcs = chain(funcs, self.template_context_processors[mod])
for func in funcs: | <mask>
<mask> :param context: the context as a dictionary that is updated in place
<mask> to add extra variables.
<mask> """
<mask> for func in self.template_context_processors:
<mask> context.update(func())
<mask>
<mask> def run(self, host='127.... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/67f4b0f31538832f06b9351d15e30c85f449ac7e | flask.py |
<mask> """
<mask> from werkzeug import Client
<mask> return Client(self, self.response_class, use_cookies=True)
<mask>
<mask> def open_resource(self, resource):
<mask> """Opens a resource from the application's resource folder. To see
<mask> how this works, consider ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"re... | https://github.com/pallets/flask/commit/67f4b0f31538832f06b9351d15e30c85f449ac7e | flask.py | |
for func in module._register_events:
func(state) | <mask> def register_module(self, module, **options):
<mask> """Registers a module with this application."""
<mask> options.setdefault('url_prefix', module.url_prefix)
<mask> state = _ModuleSetupState(self, **options)
<mask> for func, args in module._register_events:
<mask> ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/67f4b0f31538832f06b9351d15e30c85f449ac7e | flask.py |
self.template_context_processors[None].append(f) | <mask> return f
<mask>
<mask> def context_processor(self, f):
<mask> """Registers a template context processor function."""
<mask> self.template_context_processors.append(f)
<mask> return f
<mask>
<mask> def dispatch_request(self):
<mask> """Does the request di... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/67f4b0f31538832f06b9351d15e30c85f449ac7e | flask.py |
admin = flask.Module(__name__, 'admin', url_prefix='/admin') | <mask> class ModuleTestCase(unittest.TestCase):
<mask>
<mask> def test_basic_module(self):
<mask> app = flask.Flask(__name__)
<mask> admin = flask.Module('admin', url_prefix='/admin')
<mask> @admin.route('/')
<mask> def index():
<mask> return 'admin index'
<mask... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/67f4b0f31538832f06b9351d15e30c85f449ac7e | tests/flask_tests.py |
admin = flask.Module(__name__, 'admin', url_prefix='/admin') | <mask>
<mask> def test_request_processing(self):
<mask> catched = []
<mask> app = flask.Flask(__name__)
<mask> admin = flask.Module('admin', url_prefix='/admin')
<mask> @admin.before_request
<mask> def before_admin_request():
<mask> catched.append('before... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/67f4b0f31538832f06b9351d15e30c85f449ac7e | tests/flask_tests.py |
"""Expands the session with support for switching between permanent | <mask> pass
<mask>
<mask>
<mask> class Session(SecureCookie):
<mask> """Expands the session for support for switching between permanent
<mask> and non-permanent sessions.
<mask> """
<mask>
<mask> def _get_permanent(self):
<mask> return self.get('_permanent', False)
</s> Fix typ... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/67fc46526234653b0a519e9f1e8a05a2c40c80f8 | flask.py |
#: a list of functions that are called without argument | <mask> #: To register a function here use the :meth:`after_request`
<mask> #: decorator.
<mask> self.after_request_funcs = []
<mask>
<mask> #: a list of functions that are called without arguments
<mask> #: to populate the template context. Each returns a dictionary
<mas... | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/pallets/flask/commit/67fc46526234653b0a519e9f1e8a05a2c40c80f8 | flask.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.