summaryrefslogtreecommitdiffstats
path: root/ipalib
diff options
context:
space:
mode:
authorJason Gerard DeRose <jderose@redhat.com>2009-01-23 15:53:45 -0700
committerRob Crittenden <rcritten@redhat.com>2009-02-03 15:29:03 -0500
commit0cfb0e191ad878d1b22e98ce484bf3048f7138c2 (patch)
treeba468c284cd37e89f649d6de31c58000bcca64dc /ipalib
parentf7375bb6090f32c3feb3d71e196ed01ee19fecc8 (diff)
downloadfreeipa-0cfb0e191ad878d1b22e98ce484bf3048f7138c2.tar.gz
freeipa-0cfb0e191ad878d1b22e98ce484bf3048f7138c2.tar.xz
freeipa-0cfb0e191ad878d1b22e98ce484bf3048f7138c2.zip
Removed the depreciated Context and LazyContext classes
Diffstat (limited to 'ipalib')
-rw-r--r--ipalib/__init__.py7
-rw-r--r--ipalib/backend.py14
-rw-r--r--ipalib/plugable.py23
3 files changed, 2 insertions, 42 deletions
diff --git a/ipalib/__init__.py b/ipalib/__init__.py
index 7fd886cb..7754c428 100644
--- a/ipalib/__init__.py
+++ b/ipalib/__init__.py
@@ -871,7 +871,7 @@ freeIPA.org:
'''
import plugable
-from backend import Backend, Context
+from backend import Backend
from frontend import Command, LocalOrRemote, Application
from frontend import Object, Method, Property
from crud import Create, Retrieve, Update, Delete, Search
@@ -902,12 +902,9 @@ def create_api(mode='dummy'):
- `frontend.Application`
- `backend.Backend`
-
- - `backend.Context`
"""
api = plugable.API(
- Command, Object, Method, Property, Application,
- Backend, Context,
+ Command, Object, Method, Property, Application, Backend
)
if mode is not None:
api.env.mode = mode
diff --git a/ipalib/backend.py b/ipalib/backend.py
index 827067f4..e286c507 100644
--- a/ipalib/backend.py
+++ b/ipalib/backend.py
@@ -95,17 +95,3 @@ class Executioner(Backend):
return result
assert isinstance(error, PublicError)
raise error
-
-
-
-class Context(plugable.Plugin):
- """
- Base class for plugable context components.
- """
-
- __proxy__ = False # Backend plugins are not wrapped in a PluginProxy
-
- def get_value(self):
- raise NotImplementedError(
- '%s.get_value()' % self.__class__.__name__
- )
diff --git a/ipalib/plugable.py b/ipalib/plugable.py
index 1370d7f5..bc55c808 100644
--- a/ipalib/plugable.py
+++ b/ipalib/plugable.py
@@ -506,28 +506,6 @@ class Registrar(DictProxy):
self.__registered.add(klass)
-class LazyContext(object):
- """
- On-demand creation of thread-local context attributes.
- """
-
- def __init__(self, api):
- self.__api = api
- self.__context = threading.local()
-
- def __getattr__(self, name):
- if name not in self.__context.__dict__:
- if name not in self.__api.Context:
- raise AttributeError('no Context plugin for %r' % name)
- value = self.__api.Context[name].get_value()
- self.__context.__dict__[name] = value
- return self.__context.__dict__[name]
-
- def __getitem__(self, key):
- return self.__getattr__(key)
-
-
-
class API(DictProxy):
"""
Dynamic API object through which `Plugin` instances are accessed.
@@ -538,7 +516,6 @@ class API(DictProxy):
self.__done = set()
self.register = Registrar(*allowed)
self.env = Env()
- self.context = LazyContext(self)
super(API, self).__init__(self.__d)
def __doing(self, name):