mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
167: In API.finalize(), lock(plugin) is used instead of plugin.__lock__(); more docstring improvements in plugable.py
This commit is contained in:
@@ -357,8 +357,10 @@ class Proxy(ReadOnly):
|
|||||||
|
|
||||||
def check_name(name):
|
def check_name(name):
|
||||||
"""
|
"""
|
||||||
Raises `errors.NameSpaceError` if ``name`` is not a valid Python identifier
|
Verifies that ``name`` is suitable for a `NameSpace` member name.
|
||||||
suitable for use in a `NameSpace`.
|
|
||||||
|
Raises `errors.NameSpaceError` if ``name`` is not a valid Python
|
||||||
|
identifier suitable for use as the name of `NameSpace` member.
|
||||||
|
|
||||||
:param name: Identifier to test.
|
:param name: Identifier to test.
|
||||||
"""
|
"""
|
||||||
@@ -666,6 +668,9 @@ class Registrar(ReadOnly):
|
|||||||
|
|
||||||
|
|
||||||
class API(ReadOnly):
|
class API(ReadOnly):
|
||||||
|
"""
|
||||||
|
Dynamic API object through which `Plugin` instances are accessed.
|
||||||
|
"""
|
||||||
__finalized = False
|
__finalized = False
|
||||||
|
|
||||||
def __init__(self, *allowed):
|
def __init__(self, *allowed):
|
||||||
@@ -692,8 +697,7 @@ class API(ReadOnly):
|
|||||||
object.__setattr__(self, base.__name__, ns)
|
object.__setattr__(self, base.__name__, ns)
|
||||||
for plugin in d.values():
|
for plugin in d.values():
|
||||||
plugin.finalize(self)
|
plugin.finalize(self)
|
||||||
plugin.__lock__()
|
lock(plugin)
|
||||||
assert plugin.__islocked__() is True
|
|
||||||
assert plugin.api is self
|
assert plugin.api is self
|
||||||
object.__setattr__(self, '_API__finalized', True)
|
object.__setattr__(self, '_API__finalized', True)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user