Beispiel #1
0
def gotResults(natresults):
    from twisted.internet import reactor
    from shtoom.avail import audio, codecs, ui
    from shtoom import __version__
    import platform, twisted.copyright
    (ures, upnp), (sres, stun), (lres,locIP), (mres, mapper) = natresults
    print "Shtoom, version %s"%(__version__)
    print "Using python version", platform.python_version()
    print "Using twisted version", twisted.copyright.version
    print "Running on", platform.system(), platform.machine(),
    ver = platform.uname()
    if ver[2]:
        print ver[2]
    else:
        ver = platform.win32_ver()
        print ver
    print "Available audio interfaces:", ', '.join(audio.listAudio())
    print "Available user interfaces:", ', '.join(ui.listUI())
    print "Available codecs:", ', '.join(codecs.listCodecs())
    print "Local IP address:", locIP
    if upnp:
        manuf = upnp.upnpInfo.get('manufacturer', 'unknown')
        model = upnp.upnpInfo.get('friendlyName', 'unknown')
        print "UPnP discovered a %s (%s) device"%(model, manuf)
        print "UPnP controlURL:", upnp.controlURL
    else:
        print "No UPnP-capable device discovered"
    if sres:
        print "STUN says NAT type: %s"%(stun.name)
        if not upnp:
            if stun.blocked:
                print "You will be unable to make calls to the internet"
            elif not stun.useful:
                print "You will need to use an outbound proxy to make calls to the internet"
    else:
        print "STUN was unable to get a result. This is bad"
    print "And the mapper we'd use is: %r"%(mapper)
    reactor.stop()
Beispiel #2
0
def gotResults(natresults):
    from twisted.internet import reactor
    from shtoom.avail import audio, codecs, ui
    from shtoom import __version__
    import platform, twisted.copyright
    (ures, upnp), (sres, stun), (lres, locIP), (mres, mapper) = natresults
    print "Shtoom, version %s" % (__version__)
    print "Using python version", platform.python_version()
    print "Using twisted version", twisted.copyright.version
    print "Running on", platform.system(), platform.machine(),
    ver = platform.uname()
    if ver[2]:
        print ver[2]
    else:
        ver = platform.win32_ver()
        print ver
    print "Available audio interfaces:", ', '.join(audio.listAudio())
    print "Available user interfaces:", ', '.join(ui.listUI())
    print "Available codecs:", ', '.join(codecs.listCodecs())
    print "Local IP address:", locIP
    if upnp:
        manuf = upnp.upnpInfo.get('manufacturer', 'unknown')
        model = upnp.upnpInfo.get('friendlyName', 'unknown')
        print "UPnP discovered a %s (%s) device" % (model, manuf)
        print "UPnP controlURL:", upnp.controlURL
    else:
        print "No UPnP-capable device discovered"
    if sres:
        print "STUN says NAT type: %s" % (stun.name)
        if not upnp:
            if stun.blocked:
                print "You will be unable to make calls to the internet"
            elif not stun.useful:
                print "You will need to use an outbound proxy to make calls to the internet"
    else:
        print "STUN was unable to get a result. This is bad"
    print "And the mapper we'd use is: %r" % (mapper)
    reactor.stop()
Beispiel #3
0
 def test_codecAvail(self):
     from shtoom.avail.codecs import listCodecs
     self.assertTrue(len(listCodecs()) > 0, listCodecs())
Beispiel #4
0
    def test_codecAvail(self):
        from shtoom.avail.codecs import listCodecs

        self.assert_(len(listCodecs()) > 0, listCodecs())