Author: justi9
Date: 2010-07-06 11:30:41 -0400 (Tue, 06 Jul 2010)
New Revision: 4072
Modified:
mgmt/newdata/cumin/python/cumin/grid/pool.py
mgmt/newdata/cumin/python/cumin/main.py
mgmt/newdata/cumin/python/cumin/messaging/binding.py
mgmt/newdata/cumin/python/cumin/objectframe.py
mgmt/newdata/cumin/python/cumin/objecttask.py
mgmt/newdata/cumin/python/cumin/usergrid/widgets.py
mgmt/newdata/wooly/python/wooly/__init__.py
mgmt/newdata/wooly/python/wooly/tables.py
Log:
Fix init problems by changing task naming; remove user grid workaround
Modified: mgmt/newdata/cumin/python/cumin/grid/pool.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/grid/pool.py 2010-07-06 14:17:52 UTC (rev 4071)
+++ mgmt/newdata/cumin/python/cumin/grid/pool.py 2010-07-06 15:30:41 UTC (rev 4072)
@@ -336,7 +336,7 @@
self.flash_chart = PoolSlotFlashVis(app, "chart", self.collector)
self.flash_chart.fullpageable = False
- self.add_child(self.flash_chart)
+ self.replace_child(self.flash_chart)
def render_content(self, session):
return self.flash_chart.render(session)
Modified: mgmt/newdata/cumin/python/cumin/main.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/main.py 2010-07-06 14:17:52 UTC (rev 4071)
+++ mgmt/newdata/cumin/python/cumin/main.py 2010-07-06 15:30:41 UTC (rev 4072)
@@ -148,7 +148,7 @@
return self.get_title(session)
def get_title(self, session):
- return "MRG Administration"
+ return "Administrator"
class MainView(CuminMainView):
def __init__(self, app, name):
Modified: mgmt/newdata/cumin/python/cumin/messaging/binding.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/messaging/binding.py 2010-07-06 14:17:52 UTC (rev
4071)
+++ mgmt/newdata/cumin/python/cumin/messaging/binding.py 2010-07-06 15:30:41 UTC (rev
4072)
@@ -15,7 +15,7 @@
strings = StringCatalog(__file__)
log = logging.getLogger("cumin.messaging.exchange")
-class BindingSelectionRemove(ObjectTask):
+class BindingSelectionRemove(SelectionTask):
def get_title(self, session):
return "Remove"
@@ -108,7 +108,7 @@
self.add_attribute_column(binding.origin)
self.add_attribute_column(binding.msgMatched)
-
+
self.remove = BindingSelectionRemove(app, self)
class Exchange(ObjectLinkColumn):
Modified: mgmt/newdata/cumin/python/cumin/objectframe.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/objectframe.py 2010-07-06 14:17:52 UTC (rev 4071)
+++ mgmt/newdata/cumin/python/cumin/objectframe.py 2010-07-06 15:30:41 UTC (rev 4072)
@@ -30,7 +30,6 @@
self.tasks = list()
self.summary_attributes = list()
- self.summary_tasks = list() # XXX
self.add_summary_attribute(cls._qmf_update_time)
Modified: mgmt/newdata/cumin/python/cumin/objecttask.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/objecttask.py 2010-07-06 14:17:52 UTC (rev 4071)
+++ mgmt/newdata/cumin/python/cumin/objecttask.py 2010-07-06 15:30:41 UTC (rev 4072)
@@ -18,18 +18,16 @@
class Task(object):
def __init__(self, app):
self.app = app
- self.name = self.__class__.__name__
+ # XXX This is an unfortunate workaround for some broken
+ # modeling of tasks (my work!)
+ self.name = "%s_%i" % (self.__class__.__name__, id(self))
+
self.form = None
def init(self):
log.info("Initializing %s", self)
- assert self.form, self.form
-
- # XXX make this idempotent
- self.app.form_page.modes.add_mode(self.form)
-
def get_title(self, session):
pass
@@ -119,8 +117,13 @@
self.frame = frame
self.frame.tasks.append(self)
- self.form = ObjectTaskForm(app, self.name, self)
+ def init(self):
+ super(ObjectTask, self).init()
+ if not self.form:
+ self.form = ObjectTaskForm(self.app, self.name, self)
+ self.form.init()
+
def enter(self, session):
id = self.frame.id.get(session)
@@ -241,8 +244,15 @@
self.selector = selector
self.selector.tasks.append(self)
- self.form = SelectionTaskForm(app, self.name, self)
+ self.form = None
+ def init(self):
+ super(SelectionTask, self).init()
+
+ if not self.form:
+ self.form = SelectionTaskForm(self.app, self.name, self)
+ self.form.init()
+
def get_title(self, session):
pass
@@ -295,6 +305,8 @@
self.object = SessionAttribute(self, "object")
+ self.app.form_page.modes.add_mode(self)
+
def do_process(self, session):
id = self.id.get(session)
@@ -337,6 +349,8 @@
self.content = self.SelectionList(app, "fields")
self.replace_child(self.content)
+ self.app.form_page.modes.add_mode(self)
+
def do_process(self, session):
self.get_selection(session)
super(SelectionTaskForm, self).do_process(session)
Modified: mgmt/newdata/cumin/python/cumin/usergrid/widgets.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/usergrid/widgets.py 2010-07-06 14:17:52 UTC (rev
4071)
+++ mgmt/newdata/cumin/python/cumin/usergrid/widgets.py 2010-07-06 15:30:41 UTC (rev
4072)
@@ -32,7 +32,7 @@
return self.get_title(session)
def get_title(self, session):
- return "User Grid"
+ return "Grid User"
class MainView(CuminMainView):
def __init__(self, app, name, user):
@@ -68,8 +68,8 @@
#self.view = UserSubmissionSet(app, "view", user)
#self.add_mode(self.view)
- #self.submission = SubmissionFrame(app, "submission")
- #self.add_mode(self.submission)
+ self.submission = SubmissionFrame(app, "submission")
+ self.add_mode(self.submission)
def render_title(self, session):
return "Submissions"
Modified: mgmt/newdata/wooly/python/wooly/__init__.py
===================================================================
--- mgmt/newdata/wooly/python/wooly/__init__.py 2010-07-06 14:17:52 UTC (rev 4071)
+++ mgmt/newdata/wooly/python/wooly/__init__.py 2010-07-06 15:30:41 UTC (rev 4072)
@@ -208,11 +208,8 @@
assert isinstance(child, Widget), (self, child)
assert child is not self, self
assert child not in self.children, (self, child, self.children)
+ assert child.name not in self.children_by_name, child.name
- # XXX assert child.name not in self.children_by_name
- if child.name in self.children_by_name:
- log.error("%s is already in %s", child.name, self)
-
self.children.append(child)
self.children_by_name[child.name] = child
child.parent = self
@@ -505,6 +502,8 @@
def init(self):
for page in self.pages:
page.init()
+
+ for page in self.pages:
page.seal()
def add_page(self, page):
Modified: mgmt/newdata/wooly/python/wooly/tables.py
===================================================================
--- mgmt/newdata/wooly/python/wooly/tables.py 2010-07-06 14:17:52 UTC (rev 4071)
+++ mgmt/newdata/wooly/python/wooly/tables.py 2010-07-06 15:30:41 UTC (rev 4072)
@@ -55,8 +55,9 @@
self.add_child(column)
header = column.header_class(self.app, "head", column)
+
self.set_header(column, header)
- self.add_child(header)
+ column.add_child(header)
if self.scolumn.default is None:
self.scolumn.default = column.name