Skip to content

Commit

Permalink
Add docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiask committed Jun 7, 2024
1 parent f8daeae commit 06b9ad9
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions feincms3/renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ def __init__(self):
}

def copy(self):
"""
Return a shallow copy of the renderer
"""
obj = self.__class__()
obj._fetch = list(self._fetch)
obj._renderers = dict(self._renderers)
Expand All @@ -109,6 +112,25 @@ def copy(self):
return obj

def unregister(self, *plugins, keep=()):
"""
Unregister plugins
You can either pass a list of plugins which should be unregistered:
.. code-block:: python
renderer.unregister(HTML, RichText)
Or you can specify which plugins should be kept:
.. code-block:: python
renderer.unregister(keep=(HTML, RichText))
You cannot do both at the same time.
Plugins can either be the plugin classes themselves or base classes.
"""
if bool(plugins) == bool(keep):
raise ImproperlyConfigured(
"Only ever provide either a list of plugins or a list of plugins to keep."
Expand Down

0 comments on commit 06b9ad9

Please sign in to comment.