[rhmessaging-commits] rhmessaging commits: r1122 - in mgmt: cumin/python/wooly and 1 other directories.
rhmessaging-commits at lists.jboss.org
rhmessaging-commits at lists.jboss.org
Fri Oct 19 14:27:54 EDT 2007
Author: justi9
Date: 2007-10-19 14:27:53 -0400 (Fri, 19 Oct 2007)
New Revision: 1122
Modified:
mgmt/cumin/python/cumin/server.strings
mgmt/cumin/python/wooly/__init__.py
mgmt/cumin/python/wooly/parameters.py
mgmt/notes/Todo
Log:
Finishes making the server set form process correctly, though it still
doesn't do anything. Adds the marshal side of ListParameter, since
server set form uses it.
Modified: mgmt/cumin/python/cumin/server.strings
===================================================================
--- mgmt/cumin/python/cumin/server.strings 2007-10-19 18:00:54 UTC (rev 1121)
+++ mgmt/cumin/python/cumin/server.strings 2007-10-19 18:27:53 UTC (rev 1122)
@@ -49,6 +49,7 @@
{items}
</table>
+ {hidden_inputs}
</form>
[ServerSetForm.item_html]
Modified: mgmt/cumin/python/wooly/__init__.py
===================================================================
--- mgmt/cumin/python/wooly/__init__.py 2007-10-19 18:00:54 UTC (rev 1121)
+++ mgmt/cumin/python/wooly/__init__.py 2007-10-19 18:27:53 UTC (rev 1122)
@@ -230,6 +230,8 @@
def __init__(self, app, name):
super(Parameter, self).__init__(app, name)
+ self.is_collection = False
+
app.add_parameter(self)
def marshal(self, object):
@@ -509,14 +511,22 @@
for param in params:
key = param.path()
- value = self.get(key)
- default = param.get_default(self)
- if value not in (default, None):
- svalue = quote(param.marshal(value))
+ if param.is_collection:
+ collection = self.get(key)
- vars.append("%s=%s" % (key, svalue))
+ if collection:
+ for value in collection:
+ svalue = quote(param.marshal(value))
+ vars.append("%s=%s" % (key, svalue))
+ else:
+ value = self.get(key)
+ default = param.get_default(self)
+ if value not in (default, None):
+ svalue = quote(param.marshal(value))
+ vars.append("%s=%s" % (key, svalue))
+
return separator.join(vars)
def unmarshal(self, string):
Modified: mgmt/cumin/python/wooly/parameters.py
===================================================================
--- mgmt/cumin/python/wooly/parameters.py 2007-10-19 18:00:54 UTC (rev 1121)
+++ mgmt/cumin/python/wooly/parameters.py 2007-10-19 18:27:53 UTC (rev 1122)
@@ -9,6 +9,8 @@
self.param = param
self.default = list()
+ self.is_collection = True
+
def get_default(self, session):
return copy(self.default)
@@ -20,6 +22,9 @@
def do_unmarshal(self, string):
return self.param.do_unmarshal(string)
+ def do_marshal(self, object):
+ return self.param.do_marshal(object)
+
class IntegerParameter(Parameter):
def do_unmarshal(self, string):
return int(string)
Modified: mgmt/notes/Todo
===================================================================
--- mgmt/notes/Todo 2007-10-19 18:00:54 UTC (rev 1121)
+++ mgmt/notes/Todo 2007-10-19 18:27:53 UTC (rev 1122)
@@ -91,8 +91,6 @@
* Add group type to group add,edit
- * Add the marshal side of ListParameter
-
* Consider making add_child, add_param, add_mode, add_tab,
etc. return their argument
More information about the rhmessaging-commits
mailing list