コード例 #1
0
ファイル: __init__.py プロジェクト: Gordon01/smarthome
class discover_services(object):
    def __init__(self, discover_timeout=5):
        self.discoverer = SynchronousServiceDiscoverer(discover_timeout)

    def __enter__(self):
        return self.discoverer.discover()

    def __exit__(self, exc_type, exc_val, exc_tb):
        self.discoverer.close()
コード例 #2
0
ファイル: __init__.py プロジェクト: Gordon01/smarthome
 def __init__(self, discover_timeout=5):
     self.discoverer = SynchronousServiceDiscoverer(discover_timeout)