Author: justi9
Date: 2007-10-16 08:52:04 -0400 (Tue, 16 Oct 2007)
New Revision: 1081
Modified:
mgmt/cumin/python/cumin/server.py
mgmt/cumin/python/cumin/util.py
mgmt/notes/Todo
Log:
Renames csorted to sorted_by.
Modified: mgmt/cumin/python/cumin/server.py
===================================================================
--- mgmt/cumin/python/cumin/server.py 2007-10-16 12:48:21 UTC (rev 1080)
+++ mgmt/cumin/python/cumin/server.py 2007-10-16 12:52:04 UTC (rev 1081)
@@ -96,7 +96,7 @@
class ServerProfileSet(ItemSet):
def get_items(self, session, model):
- return csorted(model.get_server_profiles())
+ return sorted_by(model.get_server_profiles())
def render_item_link(self, session, profile):
branch = session.branch()
@@ -104,7 +104,7 @@
class ServerConfigPropertySet(ItemSet):
def get_items(self, session, server):
- return csorted(server.config_property_items())
+ return sorted_by(server.config_property_items())
def render_item_name(self, session, prop):
return prop.name
@@ -310,7 +310,7 @@
def render_groups(self, session, type):
writer = Writer()
- for group in csorted(type.server_group_items()):
+ for group in sorted_by(type.server_group_items()):
self.group_tmpl.render(session, group, writer)
return writer.to_string()
@@ -326,9 +326,9 @@
class BrowserServers(ServerSet):
def get_items(self, session, group):
if group:
- return csorted(group.server_items())
+ return sorted_by(group.server_items())
else:
- return csorted(self.app.model.get_servers())
+ return sorted_by(self.app.model.get_servers())
class ServerGroupParameter(Parameter):
def do_unmarshal(self, string):
Modified: mgmt/cumin/python/cumin/util.py
===================================================================
--- mgmt/cumin/python/cumin/util.py 2007-10-16 12:48:21 UTC (rev 1080)
+++ mgmt/cumin/python/cumin/util.py 2007-10-16 12:52:04 UTC (rev 1081)
@@ -1,2 +1,2 @@
-def csorted(seq, attr="name"):
+def sorted_by(seq, attr="name"):
return sorted(seq, cmp, lambda x: getattr(x, attr))
Modified: mgmt/notes/Todo
===================================================================
--- mgmt/notes/Todo 2007-10-16 12:48:21 UTC (rev 1080)
+++ mgmt/notes/Todo 2007-10-16 12:52:04 UTC (rev 1081)
@@ -61,6 +61,4 @@
* Add link disabling; use it for the server groups edit and remove
links
- * Rename csorted to sorted_by, a niceer name
-
* Add a parameter that takes a modelclass
Show replies by date