Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mumble-voip/mumble.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThorvald Natvig <slicer@users.sourceforge.net>2010-02-15 21:13:24 +0300
committerThorvald Natvig <slicer@users.sourceforge.net>2010-02-15 21:13:24 +0300
commita2b4f850fcd080e199b5f2cb95ccae6be68d849c (patch)
tree93e64660712657b3aa87b3f055d5a076446080f6 /scripts
parent7ba42b7902d11bcedad825952481be4f90810a02 (diff)
Example of on-the-fly slice-fetch for Python
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/testdynamic.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/scripts/testdynamic.py b/scripts/testdynamic.py
new file mode 100755
index 000000000..3d41376f4
--- /dev/null
+++ b/scripts/testdynamic.py
@@ -0,0 +1,20 @@
+#!/usr/bin/env python
+# -*- coding: utf-8
+import Ice, IcePy, sys, tempfile
+
+ice = Ice.initialize(sys.argv)
+
+proxy = ice.stringToProxy('Meta:tcp -h 127.0.0.1 -p 6502')
+slice = IcePy.Operation('getSlice', Ice.OperationMode.Idempotent, Ice.OperationMode.Idempotent, True, (), (), (), IcePy._t_string, ()).invoke(proxy, ((), None))
+
+slicefile = tempfile.NamedTemporaryFile(suffix = '.ice')
+slicefile.write(slice)
+slicefile.flush()
+Ice.loadSlice(slicefile.name)
+slicefile.close()
+
+import Murmur
+
+meta = Murmur.MetaPrx.checkedCast(proxy)
+
+print meta.getVersion()