Skip to content
Myr

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

3 files+56 added−13 removed

modified:flask/app.py+15 added
344 unmodified lines
345 #:346 #: .. versionadded:: 0.8347 session_interface = SecureCookieSessionInterface()348349 # TODO remove the next three attrs when Sphinx :inherited-members: works350 # https://github.com/sphinx-doc/sphinx/issues/741351352 #: 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 = None355356 #: Location of the template files to be added to the template lookup.357 #: ``None`` if templates should not be added.358 template_folder = None359360 #: Absolute path to the package on the filesystem. Used to look up361 #: resources contained in the package.362 root_path = None363364 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 lines
modified:flask/blueprints.py+15 added
94 unmodified lines
95 #: 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 = None9899 # TODO remove the next three attrs when Sphinx :inherited-members: works100 # https://github.com/sphinx-doc/sphinx/issues/741101102 #: 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 = None105106 #: Location of the template files to be added to the template lookup.107 #: ``None`` if templates should not be added.108 template_folder = None109110 #: Absolute path to the package on the filesystem. Used to look up111 #: resources contained in the package.112 root_path = None113114 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 lines
modified:flask/helpers.py+26 added-13 removed
478 unmodified lines
479480 .. versionchanged:: 0.12481 The `attachment_filename` is preferred over `filename` for MIME-type482 detection.483 483484 .. versionchanged:: 0.13485 UTF-8 filenames, as specified in `RFC 2231`_, are supported.486 486487 .. _RFC 2231: https://tools.ietf.org/html/rfc2231#section-4488489 :param filename_or_fp: the filename of the file to send.490 This is relative to the :attr:`~Flask.root_path`
356 unmodified lines
847 return value848849850class _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 = None854855 #: Location of the template files to be added to the template lookup.856 #: ``None`` if templates should not be added.857 template_folder = None858859 #: Absolute path to the package on the filesystem. Used to look up860 #: resources contained in the package.861 root_path = None862863 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_name856857 #: location of the templates. ``None`` if templates should not be858 #: exposed.865 self.template_folder = template_folder866867 if root_path is None:868 root_path = get_root_path(self.import_name)869864 #: Where is the app root located?870 self.root_path = root_path866871 self._static_folder = None872 self._static_url_path = None873874 def _get_static_folder(self):875 if self._static_folder is not None:876 return os.path.join(self.root_path, self._static_folder)877878 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 ''')880881 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_folder886887 def _get_static_url_path(self):888 if self._static_url_path is not None:889 return self._static_url_path890891 if self.static_folder is not None:892 return '/' + os.path.basename(self.static_folder)893894 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)896897 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_path902903 @property904 def has_static_folder(self):
115 unmodified lines