borgend/ssdp_discover.py

changeset 148
ff975e768112
equal deleted inserted replaced
147:c42d69c44170 148:ff975e768112
1 from ssdpy import SSDPClient
2
3 def discover_repository_provider(uuid):
4 # TODO: this should be initialised only once
5 client = SSDPClient()
6 devices = client.m_search("borg")
7 for device in devices:
8 if device["usn"] == uuid:
9 return device["location"]
10
11 return None

mercurial