Skip to contentSkip to conversation

conga/luci/site/luci/Extensions cluster_adapte ...

Cluster-devel [email protected] 1 participant 1 message Aug 30, 2006

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/cluster
Module name: conga
Changes by: rmccabe at sourceware.org 2006-08-30 22:59:02

Modified files:
luci/site/luci/Extensions: cluster_adapters.py

Log message:
add a max_depth field for resources to allow for proper nesting of tags for the ui

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/luci/site/luci/Extensions/cluster_adapters.py.diff?cvsroot=cluster&r1=1.61&r2=1.62

luci/site/luci/Extensions/cluster_adapters.py +4 -8
@@ -989,12 +989,6 @@
     rc_map['type'] = child.getResourceType()
 
   rc_map['indent_ctr'] = indent_ctr
-  indent_str = '_'
-  i = indent_ctr
-  while i>0:
-    indent_str += '__'
-    i -= 1
-  rc_map['indent_str'] = indent_str
     
   #Note: Final version needs all resource attrs
   rc_map['attrs'] = child.getAttributes()
@@ -1003,10 +997,12 @@
 
   resource_list.append(rc_map)
   kids = child.getChildren()
+  child_depth = 0
   for kid in kids:
-    recurse_resources(kid, resource_list, new_indent_ctr, child)
+    child_depth = recurse_resources(kid, resource_list, new_indent_ctr, child)
 
-  return
+  rc_map['max_depth'] = child_depth
+  return child_depth + 1
     
 def serviceStart(self, ricci_agent, req):
   rb = ricci_bridge(ricci_agent)