Skip to content

Commit 9f747bb

Browse files
authored
Update creating-and-discovering-plugins.rst
1 parent 96c69ad commit 9f747bb

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

source/guides/creating-and-discovering-plugins.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ discover all of the Flask plugins installed:
2828
import importlib
2929
import pkgutil
3030
31-
plugins = {
31+
discovered_plugins = {
3232
name: importlib.import_module(name)
3333
for finder, name, ispkg
3434
in pkgutil.iter_modules()
3535
if name.startswith('flask_')
3636
}
3737
3838
If you had both the `Flask-SQLAlchemy`_ and `Flask-Talisman`_ plugins installed
39-
then ``plugins`` would be:
39+
then ``discovered_plugins`` would be:
4040

4141
.. code-block:: python
4242
@@ -80,7 +80,7 @@ under that namespace:
8080
# the name.
8181
return pkgutil.iter_modules(ns_pkg.__path__, ns_pkg.__name__ + ".")
8282
83-
plugins = {
83+
discovered_plugins = {
8484
name: importlib.import_module(name)
8585
for finder, name, ispkg
8686
in iter_namespace(myapp.plugins)
@@ -89,7 +89,7 @@ under that namespace:
8989
Specifying ``myapp.plugins.__path__`` to :func:`~pkgutil.iter_modules` causes
9090
it to only look for the modules directly under that namespace. For example,
9191
if you have installed distributions that provide the modules ``myapp.plugins.a``
92-
and ``myapp.plugins.b`` then ``plugins`` in this case would be:
92+
and ``myapp.plugins.b`` then ``discovered_plugins`` in this case would be:
9393

9494
.. code-block:: python
9595
@@ -142,13 +142,13 @@ Then you can discover and load all of the registered entry points by using
142142
143143
import pkg_resources
144144
145-
plugins = {
145+
discovered_plugins = {
146146
entry_point.name: entry_point.load()
147147
for entry_point
148148
in pkg_resources.iter_entry_points('myapp.plugins')
149149
}
150150
151-
In this example, ``plugins`` would be :
151+
In this example, ``discovered_plugins`` would be:
152152

153153
.. code-block:: python
154154

0 commit comments

Comments
 (0)