Skip to content

Commit

Permalink
Adding plugin api in __init__.py
Browse files Browse the repository at this point in the history
  • Loading branch information
jinder1s committed Aug 10, 2020
1 parent 58569ff commit 0adafd2
Show file tree
Hide file tree
Showing 12 changed files with 42 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ Unreleased
~~~~~~~~~~


[3.7.1] - 2020-08-10
~~~~~~~~~~~~~~~~~~~~

* Exposing all public functions in edx_django_utils/plugins directory in its __init__.py file.
- this was done to keep inline with standard/pattern used in other packages in edx_django_utils

[3.7.0] - 2020-08-10
~~~~~~~~~~~~~~~~~~~~
* Adding Plugin infrastructure
Expand Down
5 changes: 5 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ The full documentation is in the docs directory.

TODO: Publish to https://edx-django-utils.readthedocs.org.

Design Pattern followed by packages
-----------------------------------

All tools in edx_django_utils should expose their public api in their __init__.py files. This entails adding to __init__.py all functions/classes/constants/objects that are intended to be used by users of library.

License
-------

Expand Down
2 changes: 1 addition & 1 deletion edx_django_utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
EdX utilities for Django Application development..
"""

__version__ = "3.7.0"
__version__ = "3.7.1"

default_app_config = (
"edx_django_utils.apps.EdxDjangoUtilsConfig"
Expand Down
14 changes: 14 additions & 0 deletions edx_django_utils/plugins/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
"""
Plugins infrastructure
See README.rst for details.
"""

from .constants import PluginSettings, PluginURLs
from .plugin_apps import get_apps
from .plugin_contexts import get_plugins_view_context
from .plugin_manager import PluginManager
from .plugin_settings import add_plugins
from .plugin_signals import connect_receivers
from .plugin_urls import get_patterns
from .registry import get_app_configs
2 changes: 2 additions & 0 deletions edx_django_utils/plugins/plugin_apps.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""
Methods to get plugin apps
Please remember to expose any new public methods in the `__init__.py` file.
"""
from logging import getLogger

Expand Down
2 changes: 2 additions & 0 deletions edx_django_utils/plugins/plugin_contexts.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""
Various functions to get view contexts
Please remember to expose any new public methods in the `__init__.py` file.
"""
import functools
from importlib import import_module
Expand Down
2 changes: 2 additions & 0 deletions edx_django_utils/plugins/plugin_manager.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""
Adds support for first class plugins that can be added to an IDA.
Please remember to expose any new public methods in the `__init__.py` file.
"""

import functools
Expand Down
2 changes: 2 additions & 0 deletions edx_django_utils/plugins/plugin_settings.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""
Functions that deal with settings related to plugins
Please remember to expose any new public methods in the `__init__.py` file.
"""
from logging import getLogger

Expand Down
2 changes: 2 additions & 0 deletions edx_django_utils/plugins/plugin_signals.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""
Allows plugins to work with django signals
Please remember to expose any new public methods in the `__init__.py` file.
"""
from logging import getLogger

Expand Down
2 changes: 2 additions & 0 deletions edx_django_utils/plugins/plugin_urls.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""
Urls utility functions
Please remember to expose any new public methods in the `__init__.py` file.
"""
from logging import getLogger

Expand Down
2 changes: 2 additions & 0 deletions edx_django_utils/plugins/registry.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""
Code to create Registry of django app plugins
Please remember to expose any new public methods in the `__init__.py` file.
"""
import six

Expand Down
2 changes: 2 additions & 0 deletions edx_django_utils/plugins/utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""
utils to help with imports
Please remember to expose any new public methods in the `__init__.py` file.
"""
from importlib import import_module as system_import_module

Expand Down

0 comments on commit 0adafd2

Please sign in to comment.