]> git.meshlink.io Git - catta/commitdiff
fix regular expressions for enumerating service types
authorLennart Poettering <lennart@poettering.net>
Sat, 22 Apr 2006 12:57:39 +0000 (12:57 +0000)
committerLennart Poettering <lennart@poettering.net>
Sat, 22 Apr 2006 12:57:39 +0000 (12:57 +0000)
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@1189 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe

avahi-python/avahi/ServiceTypeDatabase.py.in

index 66b29c86cddb3875e0b3223c7deb4fd5ccc04653..25807f36c7e6e22ab5737d2e8fe6e0f626c82ed3 100644 (file)
@@ -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"]