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/__init__.py | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'ipalib/__init__.py') diff --git a/ipalib/__init__.py b/ipalib/__init__.py index 4593e581..a6664f73 100644 --- a/ipalib/__init__.py +++ b/ipalib/__init__.py @@ -30,15 +30,18 @@ To learn about the ``ipalib`` library, you should read the code in this order: """ import plugable -import frontend -import backend -import config - -api = plugable.API( - frontend.Command, - frontend.Object, - frontend.Method, - frontend.Property, - frontend.Application, - backend.Backend, -) +from backend import Backend, Context +from frontend import Command, Object, Method, Property, Application +from ipa_types import Bool, Int, Unicode, Enum +from frontend import Param, DefaultFrom + +def get_standard_api(unit_test=False): + api = plugable.API( + Command, Object, Method, Property, Application, + Backend, Context, + ) + if unit_test is True: + api.env.mode = 'unit_test' + return api + +api = get_standard_api() -- cgit