예제 #1
0
class _UPnP3:
    def __init__(self):
        self.u = UPnPPlatformIndependent()

    def test(self):
        try:
            self.u.discover()
            return self.u.found_wanted_services()
        except:
            if DEBUG:
                print_exc()
            return False

    def open(self,ip,p,iproto='TCP'):
        """ Return False in case of network failure, 
            Raises UPnPError in case of a properly reported error from the server
        """
        try:
            self.u.add_port_map(ip,p,iproto=iproto)
            return True
        except UPnPError,e:
            if DEBUG:
                print_exc()
            raise e
        except:
예제 #2
0
class _UPnP3:
    def __init__(self):
        self.u = UPnPPlatformIndependent()

    def test(self):
        try:
            self.u.discover()
            return self.u.found_wanted_services()
        except:
            if DEBUG:
                print_exc()
            return False

    def open(self, ip, p, iproto='TCP'):
        """ Return False in case of network failure, 
            Raises UPnPError in case of a properly reported error from the server
        """
        try:
            self.u.add_port_map(ip, p, iproto=iproto)
            return True
        except UPnPError, e:
            if DEBUG:
                print_exc()
            raise e
        except:
예제 #3
0
 def __init__(self):
     self.u = UPnPPlatformIndependent()
예제 #4
0
 def __init__(self):
     self.u = UPnPPlatformIndependent()