Merge pull request #2363 from davidism/inherited-members
Before adoption: this commit came in with the history the project adopted, so no landing records it.
document inherited attributes for Flask and Blueprint
authored by David Lord · committed by GitHub · parents b80cf05, 235c830 · Browse files · 3 files·+56 added−13 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
3 files+56 added−13 removed
- other:+56 added−13 removed
Provenance
- Commit
4594602- Tree
68a7259- Author
David Lord <davidism@gmail.com>- Committer
GitHub <noreply@github.com>- Parent 1
b80cf05- Parent 2
235c830
3 files changed+56 added−13 removed
modified:flask/app.py+15 added
344 unmodified lines345 #:346 #: .. versionadded:: 0.8347 session_interface = SecureCookieSessionInterface()348 349+ # TODO remove the next three attrs when Sphinx :inherited-members: works350+ # https://github.com/sphinx-doc/sphinx/issues/741351+352+ #: The name of the package or module that this app belongs to. Do not353+ #: change this once it is set by the constructor.354+ import_name = None355+356+ #: Location of the template files to be added to the template lookup.357+ #: ``None`` if templates should not be added.358+ template_folder = None359+360+ #: Absolute path to the package on the filesystem. Used to look up361+ #: resources contained in the package.362+ root_path = None363+364 def __init__(self, import_name, static_path=None, static_url_path=None,365 static_folder='static', static_host=None,366 host_matching=False, template_folder='templates',367 instance_path=None, instance_relative_config=False,1779 unmodified linesmodified:flask/blueprints.py+15 added
94 unmodified lines95 #: Blueprint local JSON decoder class to use.96 #: Set to ``None`` to use the app's :class:`~flask.app.Flask.json_decoder`.97 json_decoder = None98 99+ # TODO remove the next three attrs when Sphinx :inherited-members: works100+ # https://github.com/sphinx-doc/sphinx/issues/741101+102+ #: The name of the package or module that this app belongs to. Do not103+ #: change this once it is set by the constructor.104+ import_name = None105+106+ #: Location of the template files to be added to the template lookup.107+ #: ``None`` if templates should not be added.108+ template_folder = None109+110+ #: Absolute path to the package on the filesystem. Used to look up111+ #: resources contained in the package.112+ root_path = None113+114 def __init__(self, name, import_name, static_folder=None,115 static_url_path=None, template_folder=None,116 url_prefix=None, subdomain=None, url_defaults=None,117 root_path=None):318 unmodified linesmodified:flask/helpers.py+26 added-13 removed
478 unmodified lines479 480 .. versionchanged:: 0.12481 The `attachment_filename` is preferred over `filename` for MIME-type482 detection.483- 483+484 .. versionchanged:: 0.13485 UTF-8 filenames, as specified in `RFC 2231`_, are supported.486- 486+487 .. _RFC 2231: https://tools.ietf.org/html/rfc2231#section-4488 489 :param filename_or_fp: the filename of the file to send.490 This is relative to the :attr:`~Flask.root_path`356 unmodified lines847 return value848 849 850 class _PackageBoundObject(object):851+ #: The name of the package or module that this app belongs to. Do not852+ #: change this once it is set by the constructor.853+ import_name = None854 855+ #: Location of the template files to be added to the template lookup.856+ #: ``None`` if templates should not be added.857+ template_folder = None858+859+ #: Absolute path to the package on the filesystem. Used to look up860+ #: resources contained in the package.861+ root_path = None862+863 def __init__(self, import_name, template_folder=None, root_path=None):853- #: The name of the package or module. Do not change this once854- #: it was set by the constructor.864 self.import_name = import_name856-857- #: location of the templates. ``None`` if templates should not be858- #: exposed.865 self.template_folder = template_folder866 867 if root_path is None:868 root_path = get_root_path(self.import_name)869 864- #: Where is the app root located?870 self.root_path = root_path866-871 self._static_folder = None872 self._static_url_path = None873 874 def _get_static_folder(self):875 if self._static_folder is not None:876 return os.path.join(self.root_path, self._static_folder)877+878 def _set_static_folder(self, value):879 self._static_folder = value875- static_folder = property(_get_static_folder, _set_static_folder, doc='''876- The absolute path to the configured static folder.877- ''')880+881+ static_folder = property(882+ _get_static_folder, _set_static_folder,883+ doc='The absolute path to the configured static folder.'884+ )885 del _get_static_folder, _set_static_folder886 887 def _get_static_url_path(self):888 if self._static_url_path is not None:889 return self._static_url_path890+891 if self.static_folder is not None:892 return '/' + os.path.basename(self.static_folder)893+894 def _set_static_url_path(self, value):895 self._static_url_path = value887- static_url_path = property(_get_static_url_path, _set_static_url_path)896+897+ static_url_path = property(898+ _get_static_url_path, _set_static_url_path,899+ doc='The URL prefix that the static route will be registered for.'900+ )901 del _get_static_url_path, _set_static_url_path902 903 @property904 def has_static_folder(self):115 unmodified lines