git://git.onelab.eu
/
plcapi.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
====
[plcapi.git]
/
PLC
/
NetworkTypes.py
diff --git
a/PLC/NetworkTypes.py
b/PLC/NetworkTypes.py
index
2b5ff4d
..
eb34e7c
100644
(file)
--- a/
PLC/NetworkTypes.py
+++ b/
PLC/NetworkTypes.py
@@
-4,9
+4,6
@@
# Mark Huang <mlhuang@cs.princeton.edu>
# Copyright (C) 2006 The Trustees of Princeton University
#
# 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
from PLC.Faults import *
from PLC.Parameter import Parameter
@@
-26,16
+23,16
@@
class NetworkType(Row):
}
def validate_type(self, name):
}
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"
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"
if conflicts:
raise PLCInvalidArgument, "Network type name already in use"
- return name
+
return name
class NetworkTypes(Table):
"""
class NetworkTypes(Table):
"""
@@
-47,8
+44,8
@@
class NetworkTypes(Table):
sql = "SELECT %s FROM network_types" % \
", ".join(NetworkType.fields)
sql = "SELECT %s FROM network_types" % \
", ".join(NetworkType.fields)
-
+
if types:
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)
self.selectall(sql)