From b51bbbbdb61ff4e71cd99e2b626e00f701ecb880 Mon Sep 17 00:00:00 2001 From: Bernard Normier Date: Wed, 25 Oct 2006 20:59:01 +0000 Subject: Added implicit context implementation --- py/python/Ice.py | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'py/python/Ice.py') diff --git a/py/python/Ice.py b/py/python/Ice.py index 608fc52d177..e0e850dab9a 100644 --- a/py/python/Ice.py +++ b/py/python/Ice.py @@ -178,7 +178,6 @@ class InitializationData(object): self.properties = None self.logger = None #self.stats = None # Stats not currently supported in Python. - self.defaultContext = {} self.threadHook = None # @@ -240,6 +239,9 @@ class CommunicatorI(Communicator): def getDefaultContext(self): return self._impl.getDefaultContext() + def getImplicitContext(self): + return ImplicitContextI(self._impl.getImplicitContext()) + def getProperties(self): properties = self._impl.getProperties() return PropertiesI(properties) @@ -475,6 +477,32 @@ def createProperties(args=[], defaults=None): return PropertiesI(properties) +# +# ImplicitContext wrapper +# +class ImplicitContextI(ImplicitContext): + def __init__(self, impl): + self._impl = impl + + def setContext(self, ctx): + self._impl.setContext(ctx) + + def getContext(self): + return self._impl.getContext(); + + def set(self, key, value): + self._impl.set(key, value); + + def remove(self, key): + self._impl.remove(key); + + def get(self, key): + return self._impl.get(key); + + def getWithDefault(self, key, dflt): + return self._impl.getWithDefault(key, dflt); + + # # The variables below need to be global in order to properly reference a # static method of Application. -- cgit v1.2.3