review use of d.quote: use [ ] instead of deprecated map
[plcapi.git] / PLC / NetworkTypes.py
index c4c8367..8d00b03 100644 (file)
@@ -5,6 +5,7 @@
 # Copyright (C) 2006 The Trustees of Princeton University
 #
 # $Id$
+# $URL$
 #
 
 from PLC.Faults import *
@@ -25,16 +26,16 @@ class NetworkType(Row):
         }
 
     def validate_type(self, name):
-       # Make sure name is not blank
+        # Make sure name is not blank
         if not len(name):
             raise PLCInvalidArgument, "Network type must be specified"
-       
-       # Make sure network type does not alredy exist
-       conflicts = NetworkTypes(self.api, [name])
+
+        # Make sure network type does not alredy exist
+        conflicts = NetworkTypes(self.api, [name])
         if conflicts:
             raise PLCInvalidArgument, "Network type name already in use"
 
-       return name
+        return name
 
 class NetworkTypes(Table):
     """
@@ -46,8 +47,8 @@ class NetworkTypes(Table):
 
         sql = "SELECT %s FROM network_types" % \
               ", ".join(NetworkType.fields)
-        
+
         if types:
-            sql += " WHERE type IN (%s)" % ", ".join(map(api.db.quote, types))
+            sql += " WHERE type IN (%s)" % ", ".join( [ api.db.quote (t) for t in types ] )
 
         self.selectall(sql)