formatted the 'db' script using vscode
[plcapi.git] / PLC / NetworkTypes.py
index 7e9187c..fd3a30a 100644 (file)
@@ -4,9 +4,6 @@
 # Mark Huang <mlhuang@cs.princeton.edu>
 # Copyright (C) 2006 The Trustees of Princeton University
 #
-# $Id$
-# $URL$
-#
 
 from PLC.Faults import *
 from PLC.Parameter import Parameter
@@ -28,12 +25,12 @@ class NetworkType(Row):
     def validate_type(self, name):
         # Make sure name is not blank
         if not len(name):
-            raise PLCInvalidArgument, "Network type must be specified"
+            raise PLCInvalidArgument("Network type must be specified")
 
         # Make sure network type does not alredy exist
         conflicts = NetworkTypes(self.api, [name])
         if conflicts:
-            raise PLCInvalidArgument, "Network type name already in use"
+            raise PLCInvalidArgument("Network type name already in use")
 
         return name
 
@@ -49,6 +46,6 @@ class NetworkTypes(Table):
               ", ".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)