Convert scripts using type lists
authorMarcel Holtmann <marcel@holtmann.org>
Fri, 26 Dec 2008 11:43:26 +0000 (12:43 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Fri, 26 Dec 2008 11:43:26 +0000 (12:43 +0100)
test/list-networks
test/start-scanning

index b446210..d8958fb 100755 (executable)
@@ -25,7 +25,7 @@ for path in properties["Devices"]:
 
        properties = device.GetProperties()
 
-       if (properties["Type"] != "wifi" and properties["Type"] != "wimax"):
+       if properties["Type"] not in ["wifi", "wimax", "bluetooth"]:
                continue;
 
        print "[ %s ]" % (path)
index aaa3e58..cf36477 100755 (executable)
@@ -17,11 +17,8 @@ for path in properties["Devices"]:
 
        print "[ %s ]" % (path)
 
-       if (properties["Type"] == "wifi"):
-               print "   Started WiFi scanning"
-               device.ProposeScan()
-       elif (properties["Type"] == "wimax"):
-               print "   Started WiMAX scanning"
+       if properties["Type"] in ["wifi", "wimax"]:
+               print "   Started scanning"
                device.ProposeScan()
        else:
                print "   No scanning"