X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=PLC%2FNetworkMethods.py;h=a54934d41d6549ba35ba77dd8e46155d5291fb45;hb=19d4a01ccf66af9e00914351b3eacd5fc880f988;hp=c6f5864fccb0f9249cd8b0e7fd281d1b8152a43b;hpb=f5cd72e35593c96b9996ab4e49674cccc7525c48;p=plcapi.git diff --git a/PLC/NetworkMethods.py b/PLC/NetworkMethods.py index c6f5864..a54934d 100644 --- a/PLC/NetworkMethods.py +++ b/PLC/NetworkMethods.py @@ -4,9 +4,6 @@ # Mark Huang # Copyright (C) 2006 The Trustees of Princeton University # -# $Id$ -# $URL$ -# from PLC.Faults import * from PLC.Parameter import Parameter @@ -26,16 +23,16 @@ class NetworkMethod(Row): } 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]) + + # Make sure network method does not alredy exist + conflicts = NetworkMethods(self.api, [name]) if conflicts: raise PLCInvalidArgument, "Network method name already in use" - return name + return name class NetworkMethods(Table): """ @@ -47,8 +44,8 @@ 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)