summaryrefslogtreecommitdiff
path: root/py/python/Ice.py
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2006-10-25 20:59:01 +0000
committerBernard Normier <bernard@zeroc.com>2006-10-25 20:59:01 +0000
commitb51bbbbdb61ff4e71cd99e2b626e00f701ecb880 (patch)
tree62de660937598471b96644e9999b0b3e01173b69 /py/python/Ice.py
parentupdate for bug 1500 (diff)
downloadice-b51bbbbdb61ff4e71cd99e2b626e00f701ecb880.tar.bz2
ice-b51bbbbdb61ff4e71cd99e2b626e00f701ecb880.tar.xz
ice-b51bbbbdb61ff4e71cd99e2b626e00f701ecb880.zip
Added implicit context implementation
Diffstat (limited to 'py/python/Ice.py')
-rw-r--r--py/python/Ice.py30
1 files changed, 29 insertions, 1 deletions
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)
@@ -476,6 +478,32 @@ def createProperties(args=[], defaults=None):
#
+# 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.
#