# 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
}
def validate_method(self, name):
- # Make sure name is not blank
+ # Make sure name is not blank
if not len(name):
- raise PLCInvalidArgument, "Network method must be specified"
-
- # Make sure network method does not alredy exist
- conflicts = NetworkMethods(self.api, [name])
+ raise PLCInvalidArgument("Network method must be specified")
+
+ # Make sure network method does not alredy exist
+ conflicts = NetworkMethods(self.api, [name])
if conflicts:
- raise PLCInvalidArgument, "Network method name already in use"
+ raise PLCInvalidArgument("Network method name already in use")
- return name
+ return name
class NetworkMethods(Table):
"""
sql = "SELECT %s FROM network_methods" % \
", ".join(NetworkMethod.fields)
-
+
if methods:
- sql += " WHERE method IN (%s)" % ", ".join(map(api.db.quote, methods))
+ sql += " WHERE method IN (%s)" % ", ".join( [ api.db.quote (m) for m in methods ] )
self.selectall(sql)