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

testdynamic.py « scripts - github.com/mumble-voip/mumble.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 639b81226aef2a859b6d8a35480d69f563cb7de1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env python
# -*- coding: utf-8
import Ice, IcePy, sys, tempfile, os

ice = Ice.initialize(sys.argv)

proxy = ice.stringToProxy('Meta:tcp -h 127.0.0.1 -p 6502')

try:
  slice = IcePy.Operation('getSlice', Ice.OperationMode.Idempotent, Ice.OperationMode.Idempotent, True, (), (), (), IcePy._t_string, ()).invoke(proxy, ((), None))

  (slicefiledesc, slicefilepath)  = tempfile.mkstemp(suffix = '.ice')
  slicefile = os.fdopen(slicefiledesc, 'w')
  slicefile.write(slice)
  slicefile.flush()
  Ice.loadSlice('', ['-I' + Ice.getSliceDir(), slicefilepath])
  slicefile.close()
  os.remove(slicefilepath)
  
  print 'Using dynamic slice'
except Exception:
  Ice.loadSlice('', ['-I' + Ice.getSliceDir(), 'Murmur.ice'])
  print 'Using bundled slice'

import Murmur

meta = Murmur.MetaPrx.checkedCast(proxy)

print meta.getVersion()