diff options
author | Lennart Poettering <lennart@poettering.net> | 2006-04-22 12:57:39 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2006-04-22 12:57:39 +0000 |
commit | 2ed8fa2b8a4dab5f15130d44b7980f37c236d912 (patch) | |
tree | b604fac91b6e12ff740131a8cea8b6f7c684e8c7 /avahi-python | |
parent | 4ca5e94fa8799abb475620cf9cd935af372b2407 (diff) | |
download | avahi-2ed8fa2b8a4dab5f15130d44b7980f37c236d912.tar.gz |
fix regular expressions for enumerating service types
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@1189 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
Diffstat (limited to 'avahi-python')
-rw-r--r-- | avahi-python/avahi/ServiceTypeDatabase.py.in | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/avahi-python/avahi/ServiceTypeDatabase.py.in b/avahi-python/avahi/ServiceTypeDatabase.py.in index 66b29c8..25807f3 100644 --- a/avahi-python/avahi/ServiceTypeDatabase.py.in +++ b/avahi-python/avahi/ServiceTypeDatabase.py.in @@ -71,7 +71,7 @@ class ServiceTypeDatabase: items = [] key = self.db.firstkey() while key is not None: - if re.search('_\w*\._\w*', key) and not re.search('_\w*\._\w*\[.*\]', key): + if re.search('_[a-zA-Z0-9-]+\._[a-zA-Z0-9-]+', key) and not re.search('_[a-zA-Z0-9-]+\._[a-zA-Z0-9-]+\[.*\]', key): localized_service_name = self[key] items.append((key, localized_service_name)) key = self.db.nextkey(key) @@ -100,6 +100,7 @@ class ServiceTypeDatabase: if __name__ == "__main__": b = ServiceTypeDatabase() + print b.items() print b["_http._tcp"] print b["_ftp._tcp"] |