From f2f027d1fbc12f3ff24f3e471e11ac56e1a5d869 Mon Sep 17 00:00:00 2001 From: David Lord Date: Sat, 4 Apr 2020 12:28:08 -0700 Subject: [PATCH] remove unused module docstrings --- src/flask/__init__.py | 12 ------------ src/flask/__main__.py | 15 ++------------- src/flask/app.py | 9 --------- src/flask/blueprints.py | 10 ---------- src/flask/cli.py | 9 --------- src/flask/config.py | 9 --------- src/flask/ctx.py | 9 --------- src/flask/debughelpers.py | 9 --------- src/flask/globals.py | 10 ---------- src/flask/helpers.py | 9 --------- src/flask/json/__init__.py | 7 ------- src/flask/json/tag.py | 26 +++++++++++++------------- src/flask/logging.py | 7 ------- src/flask/sessions.py | 9 --------- src/flask/signals.py | 10 ---------- src/flask/templating.py | 9 --------- src/flask/testing.py | 10 ---------- src/flask/views.py | 9 --------- src/flask/wrappers.py | 9 --------- tests/conftest.py | 7 ------- tests/test_appctx.py | 9 --------- tests/test_basic.py | 9 --------- tests/test_blueprints.py | 9 --------- tests/test_cli.py | 7 ------- tests/test_config.py | 7 ------- tests/test_helpers.py | 9 --------- tests/test_instance_config.py | 7 ------- tests/test_json_tag.py | 7 ------- tests/test_logging.py | 7 ------- tests/test_regression.py | 9 --------- tests/test_reqctx.py | 9 --------- tests/test_signals.py | 9 --------- tests/test_subclassing.py | 10 ---------- tests/test_templating.py | 9 --------- tests/test_testing.py | 9 --------- tests/test_user_error_handler.py | 7 ------- tests/test_views.py | 9 --------- 37 files changed, 15 insertions(+), 331 deletions(-) diff --git a/src/flask/__init__.py b/src/flask/__init__.py index aecb26a3..ab2a9cd4 100644 --- a/src/flask/__init__.py +++ b/src/flask/__init__.py @@ -1,15 +1,3 @@ -""" - flask - ~~~~~ - - A microframework based on Werkzeug. It's extensively documented - and follows best practice patterns. - - :copyright: 2010 Pallets - :license: BSD-3-Clause -""" -# utilities we import from Werkzeug and Jinja2 that are unused -# in the module but are exported as public interface. from jinja2 import escape from jinja2 import Markup from werkzeug.exceptions import abort diff --git a/src/flask/__main__.py b/src/flask/__main__.py index b3d9c891..33b6c380 100644 --- a/src/flask/__main__.py +++ b/src/flask/__main__.py @@ -1,14 +1,3 @@ -""" - flask.__main__ - ~~~~~~~~~~~~~~ +from .cli import main - Alias for flask.run for the command line. - - :copyright: 2010 Pallets - :license: BSD-3-Clause -""" - -if __name__ == "__main__": - from .cli import main - - main(as_module=True) +main(as_module=True) diff --git a/src/flask/app.py b/src/flask/app.py index d4a0ac05..75b002bb 100644 --- a/src/flask/app.py +++ b/src/flask/app.py @@ -1,12 +1,3 @@ -""" - flask.app - ~~~~~~~~~ - - This module implements the central WSGI application object. - - :copyright: 2010 Pallets - :license: BSD-3-Clause -""" import os import sys from datetime import timedelta diff --git a/src/flask/blueprints.py b/src/flask/blueprints.py index 2f07deda..c8dfa375 100644 --- a/src/flask/blueprints.py +++ b/src/flask/blueprints.py @@ -1,13 +1,3 @@ -""" - flask.blueprints - ~~~~~~~~~~~~~~~~ - - Blueprints are the recommended way to implement larger or more - pluggable applications in Flask 0.7 and later. - - :copyright: 2010 Pallets - :license: BSD-3-Clause -""" from functools import update_wrapper from .helpers import _endpoint_from_view_func diff --git a/src/flask/cli.py b/src/flask/cli.py index 90742456..30e181ad 100644 --- a/src/flask/cli.py +++ b/src/flask/cli.py @@ -1,12 +1,3 @@ -""" - flask.cli - ~~~~~~~~~ - - A simple command line application to run flask apps. - - :copyright: 2010 Pallets - :license: BSD-3-Clause -""" import ast import inspect import os diff --git a/src/flask/config.py b/src/flask/config.py index 8515a2d4..d2dfec2b 100644 --- a/src/flask/config.py +++ b/src/flask/config.py @@ -1,12 +1,3 @@ -""" - flask.config - ~~~~~~~~~~~~ - - Implements the configuration related objects. - - :copyright: 2010 Pallets - :license: BSD-3-Clause -""" import errno import os import types diff --git a/src/flask/ctx.py b/src/flask/ctx.py index 42ae707d..f69ff596 100644 --- a/src/flask/ctx.py +++ b/src/flask/ctx.py @@ -1,12 +1,3 @@ -""" - flask.ctx - ~~~~~~~~~ - - Implements the objects required to keep the context. - - :copyright: 2010 Pallets - :license: BSD-3-Clause -""" import sys from functools import update_wrapper diff --git a/src/flask/debughelpers.py b/src/flask/debughelpers.py index 54b11957..4bd85bc5 100644 --- a/src/flask/debughelpers.py +++ b/src/flask/debughelpers.py @@ -1,12 +1,3 @@ -""" - flask.debughelpers - ~~~~~~~~~~~~~~~~~~ - - Various helpers to make the development experience better. - - :copyright: 2010 Pallets - :license: BSD-3-Clause -""" import os from warnings import warn diff --git a/src/flask/globals.py b/src/flask/globals.py index d5cd37ef..d46ccb41 100644 --- a/src/flask/globals.py +++ b/src/flask/globals.py @@ -1,13 +1,3 @@ -""" - flask.globals - ~~~~~~~~~~~~~ - - Defines all the global objects that are proxies to the current - active context. - - :copyright: 2010 Pallets - :license: BSD-3-Clause -""" from functools import partial from werkzeug.local import LocalProxy diff --git a/src/flask/helpers.py b/src/flask/helpers.py index 87b33b05..07c59b28 100644 --- a/src/flask/helpers.py +++ b/src/flask/helpers.py @@ -1,12 +1,3 @@ -""" - flask.helpers - ~~~~~~~~~~~~~ - - Implements various helpers. - - :copyright: 2010 Pallets - :license: BSD-3-Clause -""" import io import mimetypes import os diff --git a/src/flask/json/__init__.py b/src/flask/json/__init__.py index 5ebf49cf..e2fdfcff 100644 --- a/src/flask/json/__init__.py +++ b/src/flask/json/__init__.py @@ -1,10 +1,3 @@ -""" -flask.json -~~~~~~~~~~ - -:copyright: 2010 Pallets -:license: BSD-3-Clause -""" import codecs import io import uuid diff --git a/src/flask/json/tag.py b/src/flask/json/tag.py index 46bd74d6..7e762426 100644 --- a/src/flask/json/tag.py +++ b/src/flask/json/tag.py @@ -2,10 +2,10 @@ Tagged JSON ~~~~~~~~~~~ -A compact representation for lossless serialization of non-standard JSON types. -:class:`~flask.sessions.SecureCookieSessionInterface` uses this to serialize -the session data, but it may be useful in other places. It can be extended to -support other types. +A compact representation for lossless serialization of non-standard JSON +types. :class:`~flask.sessions.SecureCookieSessionInterface` uses this +to serialize the session data, but it may be useful in other places. It +can be extended to support other types. .. autoclass:: TaggedJSONSerializer :members: @@ -13,12 +13,15 @@ support other types. .. autoclass:: JSONTag :members: -Let's seen an example that adds support for :class:`~collections.OrderedDict`. -Dicts don't have an order in Python or JSON, so to handle this we will dump -the items as a list of ``[key, value]`` pairs. Subclass :class:`JSONTag` and -give it the new key ``' od'`` to identify the type. The session serializer -processes dicts first, so insert the new tag at the front of the order since -``OrderedDict`` must be processed before ``dict``. :: +Let's see an example that adds support for +:class:`~collections.OrderedDict`. Dicts don't have an order in JSON, so +to handle this we will dump the items as a list of ``[key, value]`` +pairs. Subclass :class:`JSONTag` and give it the new key ``' od'`` to +identify the type. The session serializer processes dicts first, so +insert the new tag at the front of the order since ``OrderedDict`` must +be processed before ``dict``. + +.. code-block:: python from flask.json.tag import JSONTag @@ -36,9 +39,6 @@ processes dicts first, so insert the new tag at the front of the order since return OrderedDict(value) app.session_interface.serializer.register(TagOrderedDict, index=0) - -:copyright: 2010 Pallets -:license: BSD-3-Clause """ from base64 import b64decode from base64 import b64encode diff --git a/src/flask/logging.py b/src/flask/logging.py index d3e3958b..fe6809b2 100644 --- a/src/flask/logging.py +++ b/src/flask/logging.py @@ -1,10 +1,3 @@ -""" -flask.logging -~~~~~~~~~~~~~ - -:copyright: 2010 Pallets -:license: BSD-3-Clause -""" import logging import sys diff --git a/src/flask/sessions.py b/src/flask/sessions.py index 300777a5..c00ba385 100644 --- a/src/flask/sessions.py +++ b/src/flask/sessions.py @@ -1,12 +1,3 @@ -""" - flask.sessions - ~~~~~~~~~~~~~~ - - Implements cookie based sessions based on itsdangerous. - - :copyright: 2010 Pallets - :license: BSD-3-Clause -""" import hashlib import warnings from collections.abc import MutableMapping diff --git a/src/flask/signals.py b/src/flask/signals.py index 11a95ee6..d2179c65 100644 --- a/src/flask/signals.py +++ b/src/flask/signals.py @@ -1,13 +1,3 @@ -""" - flask.signals - ~~~~~~~~~~~~~ - - Implements signals based on blinker if available, otherwise - falls silently back to a noop. - - :copyright: 2010 Pallets - :license: BSD-3-Clause -""" try: from blinker import Namespace diff --git a/src/flask/templating.py b/src/flask/templating.py index 659946d8..6eebb13d 100644 --- a/src/flask/templating.py +++ b/src/flask/templating.py @@ -1,12 +1,3 @@ -""" - flask.templating - ~~~~~~~~~~~~~~~~ - - Implements the bridge to Jinja2. - - :copyright: 2010 Pallets - :license: BSD-3-Clause -""" from jinja2 import BaseLoader from jinja2 import Environment as BaseEnvironment from jinja2 import TemplateNotFound diff --git a/src/flask/testing.py b/src/flask/testing.py index ca75b9e7..3b9e3095 100644 --- a/src/flask/testing.py +++ b/src/flask/testing.py @@ -1,13 +1,3 @@ -""" - flask.testing - ~~~~~~~~~~~~~ - - Implements test support helpers. This module is lazily imported - and usually not used in production environments. - - :copyright: 2010 Pallets - :license: BSD-3-Clause -""" from contextlib import contextmanager import werkzeug.test diff --git a/src/flask/views.py b/src/flask/views.py index 8034e9b5..323e6118 100644 --- a/src/flask/views.py +++ b/src/flask/views.py @@ -1,12 +1,3 @@ -""" - flask.views - ~~~~~~~~~~~ - - This module provides class-based views inspired by the ones in Django. - - :copyright: 2010 Pallets - :license: BSD-3-Clause -""" from .globals import request diff --git a/src/flask/wrappers.py b/src/flask/wrappers.py index bfb750c2..43b9eeec 100644 --- a/src/flask/wrappers.py +++ b/src/flask/wrappers.py @@ -1,12 +1,3 @@ -""" - flask.wrappers - ~~~~~~~~~~~~~~ - - Implements the WSGI wrappers (request and response). - - :copyright: 2010 Pallets - :license: BSD-3-Clause -""" from werkzeug.exceptions import BadRequest from werkzeug.wrappers import Request as RequestBase from werkzeug.wrappers import Response as ResponseBase diff --git a/tests/conftest.py b/tests/conftest.py index ed9c26a1..d7a54a66 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,10 +1,3 @@ -""" - tests.conftest - ~~~~~~~~~~~~~~ - - :copyright: 2010 Pallets - :license: BSD-3-Clause -""" import os import pkgutil import sys diff --git a/tests/test_appctx.py b/tests/test_appctx.py index 3ee1118e..b9ed29b5 100644 --- a/tests/test_appctx.py +++ b/tests/test_appctx.py @@ -1,12 +1,3 @@ -""" - tests.appctx - ~~~~~~~~~~~~ - - Tests the application context. - - :copyright: 2010 Pallets - :license: BSD-3-Clause -""" import pytest import flask diff --git a/tests/test_basic.py b/tests/test_basic.py index dc7211a9..dd0e7b68 100644 --- a/tests/test_basic.py +++ b/tests/test_basic.py @@ -1,12 +1,3 @@ -""" - tests.basic - ~~~~~~~~~~~~~~~~~~~~~ - - The basic functionality. - - :copyright: 2010 Pallets - :license: BSD-3-Clause -""" import re import sys import time diff --git a/tests/test_blueprints.py b/tests/test_blueprints.py index 33bf8f15..8cbd9555 100644 --- a/tests/test_blueprints.py +++ b/tests/test_blueprints.py @@ -1,12 +1,3 @@ -""" - tests.blueprints - ~~~~~~~~~~~~~~~~ - - Blueprints (and currently modules) - - :copyright: 2010 Pallets - :license: BSD-3-Clause -""" import functools import pytest diff --git a/tests/test_cli.py b/tests/test_cli.py index 40a21f4f..18a29653 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -1,10 +1,3 @@ -""" - tests.test_cli - ~~~~~~~~~~~~~~ - - :copyright: 2010 Pallets - :license: BSD-3-Clause -""" # This file was part of Flask-CLI and was modified under the terms of # its Revised BSD License. Copyright © 2015 CERN. import os diff --git a/tests/test_config.py b/tests/test_config.py index 00d287fa..a3cd3d25 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -1,10 +1,3 @@ -""" - tests.test_config - ~~~~~~~~~~~~~~~~~ - - :copyright: 2010 Pallets - :license: BSD-3-Clause -""" import json import os import textwrap diff --git a/tests/test_helpers.py b/tests/test_helpers.py index 274ed0bc..64a6a3c6 100644 --- a/tests/test_helpers.py +++ b/tests/test_helpers.py @@ -1,12 +1,3 @@ -""" - tests.helpers - ~~~~~~~~~~~~~~~~~~~~~~~ - - Various helpers. - - :copyright: 2010 Pallets - :license: BSD-3-Clause -""" import datetime import io import os diff --git a/tests/test_instance_config.py b/tests/test_instance_config.py index 337029f8..ee573664 100644 --- a/tests/test_instance_config.py +++ b/tests/test_instance_config.py @@ -1,10 +1,3 @@ -""" - tests.test_instance - ~~~~~~~~~~~~~~~~~~~ - - :copyright: 2010 Pallets - :license: BSD-3-Clause -""" import os import sys diff --git a/tests/test_json_tag.py b/tests/test_json_tag.py index 1385f069..38ac3b02 100644 --- a/tests/test_json_tag.py +++ b/tests/test_json_tag.py @@ -1,10 +1,3 @@ -""" -tests.test_json_tag -~~~~~~~~~~~~~~~~~~~ - -:copyright: 2010 Pallets -:license: BSD-3-Clause -""" from datetime import datetime from uuid import uuid4 diff --git a/tests/test_logging.py b/tests/test_logging.py index 51dc40ff..a5f04636 100644 --- a/tests/test_logging.py +++ b/tests/test_logging.py @@ -1,10 +1,3 @@ -""" -tests.test_logging -~~~~~~~~~~~~~~~~~~~ - -:copyright: 2010 Pallets -:license: BSD-3-Clause -""" import logging import sys from io import StringIO diff --git a/tests/test_regression.py b/tests/test_regression.py index 561631c7..adcf73d4 100644 --- a/tests/test_regression.py +++ b/tests/test_regression.py @@ -1,12 +1,3 @@ -""" - tests.regression - ~~~~~~~~~~~~~~~~~~~~~~~~~~ - - Tests regressions. - - :copyright: 2010 Pallets - :license: BSD-3-Clause -""" import gc import platform import threading diff --git a/tests/test_reqctx.py b/tests/test_reqctx.py index 36deca56..d18cb509 100644 --- a/tests/test_reqctx.py +++ b/tests/test_reqctx.py @@ -1,12 +1,3 @@ -""" - tests.reqctx - ~~~~~~~~~~~~ - - Tests the request context. - - :copyright: 2010 Pallets - :license: BSD-3-Clause -""" import pytest import flask diff --git a/tests/test_signals.py b/tests/test_signals.py index 245c8dd9..719eb3ef 100644 --- a/tests/test_signals.py +++ b/tests/test_signals.py @@ -1,12 +1,3 @@ -""" - tests.signals - ~~~~~~~~~~~~~~~~~~~~~~~ - - Signalling. - - :copyright: 2010 Pallets - :license: BSD-3-Clause -""" import pytest try: diff --git a/tests/test_subclassing.py b/tests/test_subclassing.py index 29537cca..087c50dc 100644 --- a/tests/test_subclassing.py +++ b/tests/test_subclassing.py @@ -1,13 +1,3 @@ -""" - tests.subclassing - ~~~~~~~~~~~~~~~~~ - - Test that certain behavior of flask can be customized by - subclasses. - - :copyright: 2010 Pallets - :license: BSD-3-Clause -""" from io import StringIO import flask diff --git a/tests/test_templating.py b/tests/test_templating.py index e6e91b01..a53120ea 100644 --- a/tests/test_templating.py +++ b/tests/test_templating.py @@ -1,12 +1,3 @@ -""" - tests.templating - ~~~~~~~~~~~~~~~~ - - Template functionality - - :copyright: 2010 Pallets - :license: BSD-3-Clause -""" import logging import pytest diff --git a/tests/test_testing.py b/tests/test_testing.py index 1fbba6e3..a78502f4 100644 --- a/tests/test_testing.py +++ b/tests/test_testing.py @@ -1,12 +1,3 @@ -""" - tests.testing - ~~~~~~~~~~~~~ - - Test client and more. - - :copyright: 2010 Pallets - :license: BSD-3-Clause -""" import click import pytest import werkzeug diff --git a/tests/test_user_error_handler.py b/tests/test_user_error_handler.py index f7d3db45..cd2b5864 100644 --- a/tests/test_user_error_handler.py +++ b/tests/test_user_error_handler.py @@ -1,10 +1,3 @@ -""" -tests.test_user_error_handler -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -:copyright: 2010 Pallets -:license: BSD-3-Clause -""" import pytest from werkzeug.exceptions import Forbidden from werkzeug.exceptions import HTTPException diff --git a/tests/test_views.py b/tests/test_views.py index dd76e7a4..0e215252 100644 --- a/tests/test_views.py +++ b/tests/test_views.py @@ -1,12 +1,3 @@ -""" - tests.views - ~~~~~~~~~~~ - - Pluggable views. - - :copyright: 2010 Pallets - :license: BSD-3-Clause -""" import pytest from werkzeug.http import parse_set_header