From 81de10f176437053ac47bfee8f5ec81e38f2cf57 Mon Sep 17 00:00:00 2001 From: Jason Gerard DeRose Date: Wed, 24 Sep 2008 00:12:35 +0000 Subject: 319: Added new backend and tests.test_backend modules; added place-holder Backend class and corresponding unit tests --- ipalib/backend.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 ipalib/backend.py (limited to 'ipalib/backend.py') diff --git a/ipalib/backend.py b/ipalib/backend.py new file mode 100644 index 00000000..053609c5 --- /dev/null +++ b/ipalib/backend.py @@ -0,0 +1,27 @@ +# Authors: +# Jason Gerard DeRose +# +# Copyright (C) 2008 Red Hat +# see file 'COPYING' for use and warranty information +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; version 2 only +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +""" +Base classes for all backed-end plugins. +""" + +import plugable + +class Backend(plugable.Plugin): + pass -- cgit From f3aaf65f1c4bbee31dae9431423ab88a15eba990 Mon Sep 17 00:00:00 2001 From: Jason Gerard DeRose Date: Wed, 24 Sep 2008 00:44:41 +0000 Subject: 320: plugable.API now respects the Plugin.__proxy__ flag; added test for plugins without proxy to unit tests for API --- ipalib/backend.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'ipalib/backend.py') diff --git a/ipalib/backend.py b/ipalib/backend.py index 053609c5..82ed14f3 100644 --- a/ipalib/backend.py +++ b/ipalib/backend.py @@ -24,4 +24,8 @@ Base classes for all backed-end plugins. import plugable class Backend(plugable.Plugin): - pass + """ + Base class for all backend plugins. + """ + + __proxy__ = False # Backend plugins are not wrapped in a PluginProxy -- cgit From ddb5449c7faabbd4c1b71adfe84c386b943a163f Mon Sep 17 00:00:00 2001 From: Jason Gerard DeRose Date: Thu, 30 Oct 2008 01:11:33 -0600 Subject: Did some initial work for Context plugins --- ipalib/backend.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'ipalib/backend.py') diff --git a/ipalib/backend.py b/ipalib/backend.py index 82ed14f3..b1e15f33 100644 --- a/ipalib/backend.py +++ b/ipalib/backend.py @@ -23,9 +23,23 @@ Base classes for all backed-end plugins. import plugable + class Backend(plugable.Plugin): """ Base class for all backend plugins. """ __proxy__ = False # Backend plugins are not wrapped in a PluginProxy + + +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__ + ) -- cgit