Author: justi9
Date: 2010-08-11 17:08:27 -0400 (Wed, 11 Aug 2010)
New Revision: 4200
Added:
mgmt/newdata/cumin/python/cumin/task.py
mgmt/newdata/cumin/python/cumin/task.strings
Modified:
mgmt/newdata/cumin/python/cumin/account/widgets.py
mgmt/newdata/cumin/python/cumin/grid/daemon.py
mgmt/newdata/cumin/python/cumin/grid/job.py
mgmt/newdata/cumin/python/cumin/grid/limit.py
mgmt/newdata/cumin/python/cumin/grid/main.py
mgmt/newdata/cumin/python/cumin/grid/negotiator.py
mgmt/newdata/cumin/python/cumin/grid/pool.py
mgmt/newdata/cumin/python/cumin/grid/scheduler.py
mgmt/newdata/cumin/python/cumin/grid/submission.py
mgmt/newdata/cumin/python/cumin/main.py
mgmt/newdata/cumin/python/cumin/messaging/binding.py
mgmt/newdata/cumin/python/cumin/messaging/broker.py
mgmt/newdata/cumin/python/cumin/messaging/brokergroup.py
mgmt/newdata/cumin/python/cumin/messaging/brokerlink.py
mgmt/newdata/cumin/python/cumin/messaging/connection.py
mgmt/newdata/cumin/python/cumin/messaging/exchange.py
mgmt/newdata/cumin/python/cumin/messaging/queue.py
mgmt/newdata/cumin/python/cumin/objectframe.py
mgmt/newdata/cumin/python/cumin/objectselector.py
mgmt/newdata/cumin/python/cumin/objecttask.py
mgmt/newdata/cumin/python/cumin/objecttask.strings
mgmt/newdata/cumin/python/cumin/parameters.py
mgmt/newdata/cumin/python/cumin/usergrid/widgets.py
mgmt/newdata/cumin/python/cumin/usergrid/widgets.strings
mgmt/newdata/cumin/python/cumin/widgets.py
Log:
This change addresses bz 620706. The task modeling that we had until
this change precluded linking to a task form from more than one
context. To fix this without touching too much code, I moved the
existing task implementation to new names. A newer, more flexible
variant is now in cumin/task.py.
Also:
* Cleaned up usergrid overview
* Temporarily removed vm and dag jobs; these are coming back shortly
using the new task model
* Changed scheduler filtering in the submit UI so that it gets
filtered by pool when appropriate
Modified: mgmt/newdata/cumin/python/cumin/account/widgets.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/account/widgets.py 2010-08-11 17:07:24 UTC (rev 4199)
+++ mgmt/newdata/cumin/python/cumin/account/widgets.py 2010-08-11 21:08:27 UTC (rev 4200)
@@ -208,7 +208,7 @@
conn.commit()
- task = Task(self.app)
+ task = ObjectTask(self.app)
invoc = task.start(session, None)
invoc.description = "Password changed"
invoc.end()
Modified: mgmt/newdata/cumin/python/cumin/grid/daemon.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/grid/daemon.py 2010-08-11 17:07:24 UTC (rev 4199)
+++ mgmt/newdata/cumin/python/cumin/grid/daemon.py 2010-08-11 21:08:27 UTC (rev 4200)
@@ -1,6 +1,7 @@
-from cumin.objecttask import *
+from cumin.objectframe import *
+from cumin.objectselector import *
-class DaemonStart(ObjectTask):
+class DaemonStart(ObjectFrameTask):
def __init__(self, app, frame, target):
super(DaemonStart, self).__init__(app, frame)
@@ -21,7 +22,7 @@
master.Start(completion, self.target)
-class DaemonStop(ObjectTask):
+class DaemonStop(ObjectFrameTask):
def __init__(self, app, frame, target):
super(DaemonStop, self).__init__(app, frame)
@@ -42,7 +43,7 @@
master.Stop(completion, self.target)
-class DaemonSelectionStart(SelectionTask):
+class DaemonSelectionStart(ObjectSelectorTask):
def __init__(self, app, selector, target):
super(DaemonSelectionStart, self).__init__(app, selector)
@@ -63,7 +64,7 @@
master.Start(completion, self.target)
-class DaemonSelectionStop(SelectionTask):
+class DaemonSelectionStop(ObjectSelectorTask):
def __init__(self, app, selector, target):
super(DaemonSelectionStop, self).__init__(app, selector)
Modified: mgmt/newdata/cumin/python/cumin/grid/job.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/grid/job.py 2010-08-11 17:07:24 UTC (rev 4199)
+++ mgmt/newdata/cumin/python/cumin/grid/job.py 2010-08-11 21:08:27 UTC (rev 4200)
@@ -188,11 +188,11 @@
status = self.field.get_content(session, record)
return JobStatusInfo.get_status_string(status)
-class JobSelectionTask(SelectionTask):
+class JobObjectSelectorTask(ObjectSelectorTask):
def __init__(self, app, selector, verb):
- super(JobSelectionTask, self).__init__(app, selector)
+ super(JobObjectSelectorTask, self).__init__(app, selector)
- self.form = JobSelectionTaskForm(app, self.name, self, verb)
+ self.form = JobObjectSelectorTaskForm(app, self.name, self, verb)
self.method = None
def do_invoke(self, invoc, job_id, scheduler, reason):
@@ -211,7 +211,7 @@
submission = self.selector.submission.get(osession)
self.form.submission_id.set(session, submission._id)
-class JobSelectionHold(JobSelectionTask):
+class JobSelectionHold(JobObjectSelectorTask):
def __init__(self, app, selector, verb):
super(JobSelectionHold, self).__init__(app, selector, verb)
@@ -220,7 +220,7 @@
def get_title(self, session):
return "Hold"
-class JobSelectionRelease(JobSelectionTask):
+class JobSelectionRelease(JobObjectSelectorTask):
def __init__(self, app, selector, verb):
super(JobSelectionRelease, self).__init__(app, selector, verb)
@@ -229,7 +229,7 @@
def get_title(self, session):
return "Release"
-class JobSelectionRemove(JobSelectionTask):
+class JobSelectionRemove(JobObjectSelectorTask):
def __init__(self, app, selector, verb):
super(JobSelectionRemove, self).__init__(app, selector, verb)
@@ -238,9 +238,9 @@
def get_title(self, session):
return "Remove"
-class JobSelectionTaskForm(SelectionTaskForm):
+class JobObjectSelectorTaskForm(ObjectSelectorTaskForm):
def __init__(self, app, name, task, verb):
- super(JobSelectionTaskForm, self).__init__(app, name, task)
+ super(JobObjectSelectorTaskForm, self).__init__(app, name, task)
self.submission_id = IntegerParameter(app, "sub")
self.add_parameter(self.submission_id)
@@ -723,7 +723,7 @@
self.add_state("t", "Tail", "Display end of
file")
self.add_state("h", "Head", "Display beginning of
file")
-class JobAction(ObjectTask):
+class JobAction(ObjectFrameTask):
def __init__(self, app, frame, verb):
super(JobAction, self).__init__(app, frame)
@@ -746,7 +746,7 @@
invoc.status_code = results.status
invoc.end()
-class JobActionForm(ObjectTaskForm):
+class JobActionForm(ObjectFrameTaskForm):
def __init__(self, app, name, task, verb):
super(JobActionForm, self).__init__(app, name, task)
@@ -813,7 +813,7 @@
def get_title(self, session):
return "Remove Job"
-class JobSetAttribute(ObjectTask):
+class JobSetAttribute(ObjectFrameTask):
def get_title(self, session):
pass
Modified: mgmt/newdata/cumin/python/cumin/grid/limit.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/grid/limit.py 2010-08-11 17:07:24 UTC (rev 4199)
+++ mgmt/newdata/cumin/python/cumin/grid/limit.py 2010-08-11 21:08:27 UTC (rev 4200)
@@ -117,7 +117,7 @@
self.set_limit = NegotiatorLimitTask(app, self)
-class NegotiatorLimitTask(ObjectTask):
+class NegotiatorLimitTask(ObjectFrameTask):
def __init__(self, app, frame):
super(NegotiatorLimitTask, self).__init__(app, frame)
@@ -139,7 +139,7 @@
invoc.status_code = results.status
invoc.end()
-class NegotiatorLimitForm(ObjectTaskForm):
+class NegotiatorLimitForm(ObjectFrameTaskForm):
def __init__(self, app, name, task):
super(NegotiatorLimitForm, self).__init__(app, name, task)
Modified: mgmt/newdata/cumin/python/cumin/grid/main.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/grid/main.py 2010-08-11 17:07:24 UTC (rev 4199)
+++ mgmt/newdata/cumin/python/cumin/grid/main.py 2010-08-11 21:08:27 UTC (rev 4200)
@@ -16,6 +16,8 @@
def __init__(self, app, name):
super(Module, self).__init__(app, name)
+ self.job_submit = JobSubmit(app)
+
# cls = app.model.com_redhat_grid.Job
# JobHold(self, cls)
Modified: mgmt/newdata/cumin/python/cumin/grid/negotiator.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/grid/negotiator.py 2010-08-11 17:07:24 UTC (rev 4199)
+++ mgmt/newdata/cumin/python/cumin/grid/negotiator.py 2010-08-11 21:08:27 UTC (rev 4200)
@@ -447,7 +447,7 @@
def get_default(self, session):
return dict()
-class GroupAddForm(ObjectTaskForm):
+class GroupAddForm(ObjectFrameTaskForm):
def __init__(self, app, name, task):
super(GroupAddForm, self).__init__(app, name, task)
@@ -485,7 +485,7 @@
ret = True
return ret
-class GroupForm(ObjectTaskForm):
+class GroupForm(ObjectFrameTaskForm):
def __init__(self, app, name, task):
super(GroupForm, self).__init__(app, name, task)
@@ -938,7 +938,7 @@
return params
-class NegotiatorLimitSet(ObjectTask):
+class NegotiatorLimitSet(ObjectFrameTask):
def __init__(self, app, frame):
super(NegotiatorLimitSet, self).__init__(app, frame)
@@ -965,7 +965,7 @@
invoc.end()
-class NegotiatorGroupTask(ObjectTask):
+class NegotiatorGroupTask(ObjectFrameTask):
def do_exit(self, session):
self.app.main_page.main.grid.pool.negotiator.view.show(session)
Modified: mgmt/newdata/cumin/python/cumin/grid/pool.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/grid/pool.py 2010-08-11 17:07:24 UTC (rev 4199)
+++ mgmt/newdata/cumin/python/cumin/grid/pool.py 2010-08-11 21:08:27 UTC (rev 4200)
@@ -93,9 +93,10 @@
self.limits = LimitSet(app, "limits", self.object)
self.view.add_tab(self.limits)
- self.submission_add = SubmissionAdd(app, self)
- self.submission_vm_add = SubmissionVMAdd(app, self)
- self.submission_dag_add = SubmissionDagAdd(app, self)
+ # XXX
+ #self.submission_add = SubmissionAdd(app, self)
+ #self.submission_vm_add = SubmissionVMAdd(app, self)
+ #self.submission_dag_add = SubmissionDagAdd(app, self)
def do_process(self, session):
#self.limits.limit_count.process(session)
Modified: mgmt/newdata/cumin/python/cumin/grid/scheduler.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/grid/scheduler.py 2010-08-11 17:07:24 UTC (rev 4199)
+++ mgmt/newdata/cumin/python/cumin/grid/scheduler.py 2010-08-11 21:08:27 UTC (rev 4200)
@@ -70,15 +70,18 @@
self.stop = DaemonSelectionStop(app, self, "SCHEDD")
class SchedulerSelectField(ScalarField):
- def __init__(self, app, name):
+ def __init__(self, app, name, pool_name):
super(SchedulerSelectField, self).__init__(app, name, None)
+ self.pool_name = pool_name
+
self.param = IntegerParameter(app, "param")
self.add_parameter(self.param)
cls = self.app.model.com_redhat_grid.Scheduler
self.object = ObjectAttribute(self, "object", cls, self.param)
+ self.add_attribute(self.object)
self.input = self.SchedulerOptions(app, "input", self.param)
self.add_child(self.input)
@@ -105,13 +108,12 @@
(session)
def do_get_items(self, session):
- collector = self.form.object.get(session)
-
cls = self.app.model.com_redhat_grid.Scheduler
- if collector:
- schedulers = cls.get_selection \
- (session.cursor, Pool=collector.Pool)
+ pool_name = self.parent.pool_name.get(session)
+
+ if pool_name:
+ schedulers = cls.get_selection(session.cursor, Pool=pool_name)
else:
schedulers = cls.get_selection(session.cursor)
Modified: mgmt/newdata/cumin/python/cumin/grid/submission.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/grid/submission.py 2010-08-11 17:07:24 UTC (rev 4199)
+++ mgmt/newdata/cumin/python/cumin/grid/submission.py 2010-08-11 21:08:27 UTC (rev 4200)
@@ -85,7 +85,15 @@
col = ObjectTableColumn(app, attr.name, attr)
self.insert_column(2, col)
-class SubmissionAdd(ObjectTask):
+ link = self.PoolSubmitLink(app, "add", app.grid.job_submit)
+ self.links.add_child(link)
+
+ class PoolSubmitLink(TaskLink):
+ def do_enter(self, session, obj, form_session):
+ pool = self.parent.pool.get(session)
+ self.form.pool_name.set(form_session, pool.Pool)
+
+class JobSubmit(Task):
EXPR_TYPE, INTEGER_TYPE, FLOAT_TYPE, STRING_TYPE = 0, 1, 2, 3
UNIVERSE = {"VANILLA": 5,
"SCHEDULER": 7,
@@ -95,18 +103,15 @@
"LOCAL": 12,
"VM": 13}
- def __init__(self, app, frame):
- super(SubmissionAdd, self).__init__(app, frame)
+ def __init__(self, app):
+ super(JobSubmit, self).__init__(app)
- self.form = self.get_add_form(app)
+ self.form = JobSubmitForm(app, self.name, self)
- def get_add_form(self, app):
- return SubmissionAddForm(app, self.name, self)
+ def get_title(self, session, scheduler):
+ return "Submit job"
- def get_title(self, session):
- return "Create submission"
-
- def do_invoke(self, invoc, scheduler,
+ def do_invoke(self, session, scheduler, invoc,
description,
executable,
arguments=None,
@@ -124,9 +129,6 @@
ad["Cmd"] = executable
ad["Owner"] = invoc.user.name
- # XXX temporary
- ad["JobUniverse"] = 5
-
def put(name, value):
if value:
ad[name] = value
@@ -148,17 +150,21 @@
ad["!!descriptors"] = descriptors
- invoc.description = "Create submission '%s'" % description
+ invoc.description = "Submit job '%s'" % description
self.qmf_call(invoc, scheduler, "SubmitJob", ad)
-class SubmissionAddForm(ObjectTaskForm):
+class JobSubmitForm(ObjectTaskForm):
def __init__(self, app, name, task):
- super(SubmissionAddForm, self).__init__(app, name, task)
+ cls = app.model.com_redhat_grid.Scheduler
+ super(JobSubmitForm, self).__init__(app, name, task, cls)
+ self.pool = Attribute(app, "pool")
+ self.add_attribute(self.pool)
+
from scheduler import SchedulerSelectField # XXX
- self.scheduler = SchedulerSelectField(app, "scheduler")
+ self.scheduler = SchedulerSelectField(app, "scheduler", self.pool)
self.scheduler.required = True
self.scheduler.help = "Create submission at this scheduler"
self.add_field(self.scheduler)
@@ -169,9 +175,6 @@
self.description.help = "This text will identify the submission"
self.add_field(self.description)
- self.add_fields(app)
-
- def add_fields(self, app):
self.command = self.CommandField(app, "command")
self.command.input.columns = 50
self.command.required = True
@@ -257,7 +260,7 @@
usrlog=usrlog,
attrs=attrs)
- self.task.exit_with_redirect(session)
+ self.task.exit_with_redirect(session, scheduler)
def parse_attributes(self, session):
attrs = dict()
@@ -312,7 +315,7 @@
class TemplateField(FormField):
def __init__(self, app, name):
- super(SubmissionAddForm.TemplateField, self).__init__(app, name)
+ super(JobSubmitForm.TemplateField, self).__init__(app, name)
param = Parameter(app, "param")
self.add_parameter(param)
@@ -347,7 +350,7 @@
class UniverseField(ScalarField):
def __init__(self, app, name):
- super(SubmissionAddForm.UniverseField, self).__init__ \
+ super(JobSubmitForm.UniverseField, self).__init__ \
(app, name, None)
self.param = IntegerParameter(app, "param")
@@ -418,193 +421,193 @@
def render_title(self, session):
return "Extra attributes"
-class SubmissionVMAdd(SubmissionAdd):
- def get_add_form(self, app):
- return SubmissionAddVMForm(app, self.name, self)
+# class SubmissionVMAdd(SubmissionAdd):
+# def get_add_form(self, app):
+# return SubmissionAddVMForm(app, self.name, self)
- def get_title(self, session):
- return "Create VM submission"
+# def get_title(self, session):
+# return "Create VM submission"
- def do_invoke(self, invoc, scheduler,
- description,
- executable,
- arguments=None,
- requirements=None,
- universe=None,
- iwd=None,
- stdin=None,
- stdout=None,
- stderr=None,
- usrlog=None,
- attrs={}):
+# def do_invoke(self, invoc, scheduler,
+# description,
+# executable,
+# arguments=None,
+# requirements=None,
+# universe=None,
+# iwd=None,
+# stdin=None,
+# stdout=None,
+# stderr=None,
+# usrlog=None,
+# attrs={}):
- cmd = "%s %s" % (executable, arguments)
- arguments = None
- super(SubmissionVMAdd, self).do_invoke(invoc, scheduler,
- description, cmd, arguments,
- requirements, universe, iwd,
- stdin, stdout, stderr, usrlog,
- attrs)
+# cmd = "%s %s" % (executable, arguments)
+# arguments = None
+# super(SubmissionVMAdd, self).do_invoke(invoc, scheduler,
+# description, cmd, arguments,
+# requirements, universe, iwd,
+# stdin, stdout, stderr, usrlog,
+# attrs)
-class SubmissionAddVMForm(SubmissionAddForm):
- def add_fields(self, app):
- self.disk = self.DiskField(app, "disk")
- self.disk.input.size = 50
- self.disk.required = True
- self.disk.help = "VM disk img file location"
- self.add_field(self.disk)
+# class SubmissionAddVMForm(SubmissionAddForm):
+# def add_fields(self, app):
+# self.disk = self.DiskField(app, "disk")
+# self.disk.input.size = 50
+# self.disk.required = True
+# self.disk.help = "VM disk img file location"
+# self.add_field(self.disk)
- self.requirements = self.RequirementsField(app, "requirements")
- self.requirements.input.columns = 50
- self.requirements.required = True
- self.requirements.help = "Attributes controlling where and when " + \
- "this submission will run"
- self.add_field(self.requirements)
+# self.requirements = self.RequirementsField(app, "requirements")
+# self.requirements.input.columns = 50
+# self.requirements.required = True
+# self.requirements.help = "Attributes controlling where and when " +
\
+# "this submission will run"
+# self.add_field(self.requirements)
- self.universe = Attribute(app, "universe")
- self.universe.default = self.task.UNIVERSE["VM"]
- self.add_attribute(self.universe)
+# self.universe = Attribute(app, "universe")
+# self.universe.default = self.task.UNIVERSE["VM"]
+# self.add_attribute(self.universe)
- self.attributes_ = self.VMAttributes(app, "attributes")
- self.add_attribute(self.attributes_)
+# self.attributes_ = self.VMAttributes(app, "attributes")
+# self.add_attribute(self.attributes_)
- self.command = Attribute(app, "command")
- self.command.default = "QMF Submitted VM"
- self.add_attribute(self.command)
+# self.command = Attribute(app, "command")
+# self.command.default = "QMF Submitted VM"
+# self.add_attribute(self.command)
- self.directory = Attribute(app, "directory")
- self.directory.default = "/tmp"
- self.add_attribute(self.directory)
+# self.directory = Attribute(app, "directory")
+# self.directory.default = "/tmp"
+# self.add_attribute(self.directory)
- self.stdin = Attribute(app, "stdin")
- self.add_attribute(self.stdin)
+# self.stdin = Attribute(app, "stdin")
+# self.add_attribute(self.stdin)
- self.stdout = Attribute(app, "stdout")
- self.add_attribute(self.stdout)
+# self.stdout = Attribute(app, "stdout")
+# self.add_attribute(self.stdout)
- self.stderr = Attribute(app, "stderr")
- self.add_attribute(self.stderr)
+# self.stderr = Attribute(app, "stderr")
+# self.add_attribute(self.stderr)
- self.usrlog = Attribute(app, "usrlog")
- self.add_attribute(self.usrlog)
+# self.usrlog = Attribute(app, "usrlog")
+# self.add_attribute(self.usrlog)
- class DiskField(StringField):
- def render_title(self, session):
- return "Disk"
+# class DiskField(StringField):
+# def render_title(self, session):
+# return "Disk"
- class VMAttributes(Attribute):
- def get(self, session):
- vm_ads = list()
- vm_ads.append("ShouldTransferFiles=NEVER")
- vm_ads.append("JobVMType=kvm")
- vm_ads.append("JobVMMemory=512")
- vm_ads.append("VMPARAM_Xen_Kernel=included")
+# class VMAttributes(Attribute):
+# def get(self, session):
+# vm_ads = list()
+# vm_ads.append("ShouldTransferFiles=NEVER")
+# vm_ads.append("JobVMType=kvm")
+# vm_ads.append("JobVMMemory=512")
+# vm_ads.append("VMPARAM_Xen_Kernel=included")
- disk = self.widget.disk.get(session)
- vm_ads.append("VMPARAM_Xen_Disk=%s:hda:w" % disk)
+# disk = self.widget.disk.get(session)
+# vm_ads.append("VMPARAM_Xen_Disk=%s:hda:w" % disk)
- return "\n".join(vm_ads)
+# return "\n".join(vm_ads)
-class SubmissionDagAdd(SubmissionAdd):
- def __init__(self, app, frame):
- super(SubmissionDagAdd, self).__init__(app, frame)
+# class SubmissionDagAdd(SubmissionAdd):
+# def __init__(self, app, frame):
+# super(SubmissionDagAdd, self).__init__(app, frame)
- def get_add_form(self, app):
- return SubmissionAddDagForm(app, self.name, self)
+# def get_add_form(self, app):
+# return SubmissionAddDagForm(app, self.name, self)
- def get_title(self, session):
- return "Create DAG submission"
+# def get_title(self, session):
+# return "Create DAG submission"
-class SubmissionAddDagForm(SubmissionAddForm):
- def add_fields(self, app):
- self.dag = self.DagField(app, "dag")
- self.dag.input.size = 50
- self.dag.required = True
- self.dag.help = "DAG descriptor file location"
- self.add_field(self.dag)
+# class SubmissionAddDagForm(SubmissionAddForm):
+# def add_fields(self, app):
+# self.dag = self.DagField(app, "dag")
+# self.dag.input.size = 50
+# self.dag.required = True
+# self.dag.help = "DAG descriptor file location"
+# self.add_field(self.dag)
- self.requirements = self.RequirementsField(app, "requirements")
- self.requirements.input.columns = 50
- self.requirements.required = True
- self.requirements.help = "Attributes controlling where and when " + \
- "this submission will run"
- self.add_field(self.requirements)
+# self.requirements = self.RequirementsField(app, "requirements")
+# self.requirements.input.columns = 50
+# self.requirements.required = True
+# self.requirements.help = "Attributes controlling where and when " +
\
+# "this submission will run"
+# self.add_field(self.requirements)
- self.universe = Attribute(app, "universe")
- self.universe.default = self.task.UNIVERSE["SCHEDULER"]
- self.add_attribute(self.universe)
+# self.universe = Attribute(app, "universe")
+# self.universe.default = self.task.UNIVERSE["SCHEDULER"]
+# self.add_attribute(self.universe)
- self.attributes_ = self.DagAttributes(app, "attributes")
- self.add_attribute(self.attributes_)
+# self.attributes_ = self.DagAttributes(app, "attributes")
+# self.add_attribute(self.attributes_)
- self.directory = self.Iwd(app, "directory")
- self.add_attribute(self.directory)
+# self.directory = self.Iwd(app, "directory")
+# self.add_attribute(self.directory)
- self.stdin = Attribute(app, "stdin")
- self.add_attribute(self.stdin)
+# self.stdin = Attribute(app, "stdin")
+# self.add_attribute(self.stdin)
- self.command = self.DagCommand(app, "command")
- self.add_attribute(self.command)
+# self.command = self.DagCommand(app, "command")
+# self.add_attribute(self.command)
- self.stdout = self.StdoutField(app, "stdout")
- self.stdout.input.size = 50
- self.stdout.help = "Send process output to this file"
- self.stdout.input.param.default = "diamond.dag.lib.out"
- self.add_extra_field(self.stdout)
+# self.stdout = self.StdoutField(app, "stdout")
+# self.stdout.input.size = 50
+# self.stdout.help = "Send process output to this file"
+# self.stdout.input.param.default = "diamond.dag.lib.out"
+# self.add_extra_field(self.stdout)
- self.stderr = self.StderrField(app, "stderr")
- self.stderr.input.size = 50
- self.stderr.help = "Send error output to this file"
- self.stderr.input.param.default = "diamond.dag.lib.err"
- self.add_extra_field(self.stderr)
+# self.stderr = self.StderrField(app, "stderr")
+# self.stderr.input.size = 50
+# self.stderr.help = "Send error output to this file"
+# self.stderr.input.param.default = "diamond.dag.lib.err"
+# self.add_extra_field(self.stderr)
- self.usrlog = self.UsrLogField(app, "usrlog")
- self.usrlog.input.size = 50
- self.usrlog.help = "User Log File"
- self.usrlog.input.param.default = "diamond.dag.dagman.log"
- self.add_extra_field(self.usrlog)
+# self.usrlog = self.UsrLogField(app, "usrlog")
+# self.usrlog.input.size = 50
+# self.usrlog.help = "User Log File"
+# self.usrlog.input.param.default = "diamond.dag.dagman.log"
+# self.add_extra_field(self.usrlog)
- self.condor = self.CondorVersionField(app, "cv")
- self.condor.required = True
- self.condor.input.size = 50
- self.condor.help = "Condor Version"
- self.condor.input.param.default = "'7.4.3' 'Mar'
'16' '2010' 'BuildID:' 'RH-7.4.3-0.5.el5'
'PRE-RELEASE'"
- self.add_extra_field(self.condor)
+# self.condor = self.CondorVersionField(app, "cv")
+# self.condor.required = True
+# self.condor.input.size = 50
+# self.condor.help = "Condor Version"
+# self.condor.input.param.default = "'7.4.3' 'Mar'
'16' '2010' 'BuildID:' 'RH-7.4.3-0.5.el5'
'PRE-RELEASE'"
+# self.add_extra_field(self.condor)
- class DagField(StringField):
- def render_title(self, session):
- return "DAG"
+# class DagField(StringField):
+# def render_title(self, session):
+# return "DAG"
- def get_base_path(self, session):
- dag = self.get(session)
- base, sep, file = rpartition(dag, "/")
- return base
+# def get_base_path(self, session):
+# dag = self.get(session)
+# base, sep, file = rpartition(dag, "/")
+# return base
- class Iwd(Attribute):
- def get(self, session):
- return self.widget.dag.get_base_path(session)
+# class Iwd(Attribute):
+# def get(self, session):
+# return self.widget.dag.get_base_path(session)
- class CondorVersionField(StringField):
- def render_title(self, session):
- return "Condor Version"
+# class CondorVersionField(StringField):
+# def render_title(self, session):
+# return "Condor Version"
- class DagCommand(Attribute):
- def get(self, session):
- dag = self.widget.dag.get(session)
- condor = self.widget.condor.get(session)
- args = """-f -l . -Debug 3 -Lockfile diamond.dag.lock
-AutoRescue 1
- -DoRescueFrom 0 -Dag diamond.dag -CsdVersion $CondorVersion:' %s '
%s"""
+# class DagCommand(Attribute):
+# def get(self, session):
+# dag = self.widget.dag.get(session)
+# condor = self.widget.condor.get(session)
+# args = """-f -l . -Debug 3 -Lockfile diamond.dag.lock
-AutoRescue 1
+# -DoRescueFrom 0 -Dag diamond.dag -CsdVersion $CondorVersion:' %s '
%s"""
- cmd = "/usr/bin/condor_dagman"
- return "%s %s" % (cmd, args % (condor, dag))
+# cmd = "/usr/bin/condor_dagman"
+# return "%s %s" % (cmd, args % (condor, dag))
- class DagAttributes(Attribute):
- def get(self, session):
+# class DagAttributes(Attribute):
+# def get(self, session):
- ads = list()
- ads.append("getenv=True")
- ads.append("remove_kill_sig=SIGUSR1")
- ads.append("on_exit_remove=( ExitSignal =?= 11 || (ExitCode =!=
UNDEFINED && ExitCode>=0 && ExitCode <= 2))")
-
ads.append("environment=_CONDOR_DAGMAN_LOG=diamond.dag.dagman.out;_CONDOR_MAX_DAGMAN_LOG=0")
+# ads = list()
+# ads.append("getenv=True")
+# ads.append("remove_kill_sig=SIGUSR1")
+# ads.append("on_exit_remove=( ExitSignal =?= 11 || (ExitCode =!=
UNDEFINED && ExitCode>=0 && ExitCode <= 2))")
+#
ads.append("environment=_CONDOR_DAGMAN_LOG=diamond.dag.dagman.out;_CONDOR_MAX_DAGMAN_LOG=0")
- return "\n".join(ads)
+# return "\n".join(ads)
Modified: mgmt/newdata/cumin/python/cumin/main.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/main.py 2010-08-11 17:07:24 UTC (rev 4199)
+++ mgmt/newdata/cumin/python/cumin/main.py 2010-08-11 21:08:27 UTC (rev 4200)
@@ -48,6 +48,8 @@
self.modules = list()
self.modules_by_name = dict()
+ self.tasks = list()
+
self.user = None
self.operator_email = None
@@ -85,6 +87,9 @@
for module in self.modules:
module.init()
+ for task in self.tasks:
+ task.init()
+
super(Cumin, self).init()
def add_pages(self):
Modified: mgmt/newdata/cumin/python/cumin/messaging/binding.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/messaging/binding.py 2010-08-11 17:07:24 UTC (rev
4199)
+++ mgmt/newdata/cumin/python/cumin/messaging/binding.py 2010-08-11 21:08:27 UTC (rev
4200)
@@ -15,7 +15,7 @@
strings = StringCatalog(__file__)
log = logging.getLogger("cumin.messaging.exchange")
-class BindingSelectionRemove(SelectionTask):
+class BindingSelectionRemove(ObjectSelectorTask):
def get_title(self, session):
return "Remove"
@@ -38,7 +38,7 @@
self.remove = BindingRemove(app, self)
-class BindingAdd(ObjectTask):
+class BindingAdd(ObjectFrameTask):
def __init__(self, app, frame):
super(BindingAdd, self).__init__(app, frame)
@@ -55,7 +55,7 @@
invoc.end()
-class BindingRemove(ObjectTask):
+class BindingRemove(ObjectFrameTask):
def get_title(self, session):
return "Remove"
@@ -473,7 +473,7 @@
error = FormError("xquery argument is required for this
exchange")
self.form.errors.add(session, error)
-class BindingAddForm(ObjectTaskForm):
+class BindingAddForm(ObjectFrameTaskForm):
def __init__(self, app, name, task):
super(BindingAddForm, self).__init__(app, name, task)
Modified: mgmt/newdata/cumin/python/cumin/messaging/broker.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/messaging/broker.py 2010-08-11 17:07:24 UTC (rev
4199)
+++ mgmt/newdata/cumin/python/cumin/messaging/broker.py 2010-08-11 21:08:27 UTC (rev
4200)
@@ -318,7 +318,7 @@
href = self.page.main.messaging.broker.get_href(session, reg)
return fmt_link(href, fmt_shorten(data["name"]))
-class BrokerEngroupTaskForm(ObjectTaskForm):
+class BrokerEngroupTaskForm(ObjectFrameTaskForm):
def __init__(self, app, name, task):
super(BrokerEngroupTaskForm, self).__init__(app, name, task)
@@ -354,7 +354,7 @@
groups = cls.get_selection(session.cursor)
return (FormInputItem(x._id, title=x.name) for x in groups)
-class BrokerEngroup(ObjectTask):
+class BrokerEngroup(ObjectFrameTask):
def __init__(self, app, selector):
super(BrokerEngroup, self).__init__(app, selector)
Modified: mgmt/newdata/cumin/python/cumin/messaging/brokergroup.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/messaging/brokergroup.py 2010-08-11 17:07:24 UTC (rev
4199)
+++ mgmt/newdata/cumin/python/cumin/messaging/brokergroup.py 2010-08-11 21:08:27 UTC (rev
4200)
@@ -31,10 +31,10 @@
self.remove = BrokerGroupSelectionRemove(app, self)
task = BrokerGroupAdd(app)
- link = TaskLink(app, "brokergroupadd", task)
+ link = ObjectTaskLink(app, "brokergroupadd", task)
self.links.add_child(link)
-class BrokerGroupSelectionRemove(SelectionTask):
+class BrokerGroupSelectionRemove(ObjectSelectorTask):
def get_title(self, session):
return "Remove"
@@ -86,7 +86,7 @@
self.edit = BrokerGroupEdit(app, self)
self.remove = BrokerGroupRemove(app, self)
-class BrokerGroupForm(ObjectTaskForm):
+class BrokerGroupForm(ObjectFrameTaskForm):
def __init__(self, app, name, task):
super(BrokerGroupForm, self).__init__(app, name, task)
@@ -104,7 +104,7 @@
def render_title(self, session):
return "Description"
-class BrokerGroupAdd(Task):
+class BrokerGroupAdd(ObjectTask):
def __init__(self, app):
super(BrokerGroupAdd, self).__init__(app)
@@ -157,7 +157,7 @@
def render_title(self, session):
return self.task.get_title(session)
-class BrokerGroupEdit(ObjectTask):
+class BrokerGroupEdit(ObjectFrameTask):
def __init__(self, app, frame):
super(BrokerGroupEdit, self).__init__(app, frame)
@@ -206,7 +206,7 @@
group = self.object.get(session)
return self.task.get_description(session)
-class BrokerGroupRemove(ObjectTask):
+class BrokerGroupRemove(ObjectFrameTask):
def get_title(self, session):
return "Remove"
@@ -226,7 +226,7 @@
invoc.end()
-class BrokerEngroup(ObjectTask):
+class BrokerEngroup(ObjectFrameTask):
def get_title(self, session):
return "Add to groups"
Modified: mgmt/newdata/cumin/python/cumin/messaging/brokerlink.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/messaging/brokerlink.py 2010-08-11 17:07:24 UTC (rev
4199)
+++ mgmt/newdata/cumin/python/cumin/messaging/brokerlink.py 2010-08-11 21:08:27 UTC (rev
4200)
@@ -29,7 +29,7 @@
self.route_add = RouteAdd(app, self)
self.remove = BrokerLinkRemove(app, self)
-class BrokerLinkRemove(ObjectTask):
+class BrokerLinkRemove(ObjectFrameTask):
def get_title(self, session):
return "Remove"
@@ -62,7 +62,7 @@
# Address column XXX
-class BrokerLinkSelectionRemove(SelectionTask):
+class BrokerLinkSelectionRemove(ObjectSelectorTask):
def get_title(self, session):
return "Remove"
@@ -87,7 +87,7 @@
self.remove = RouteSelectionRemove(app, self)
-class RouteSelectionRemove(SelectionTask):
+class RouteSelectionRemove(ObjectSelectorTask):
def get_title(self, session):
return "Remove"
@@ -96,7 +96,7 @@
# XXX RouteFrame
-class RouteRemove(ObjectTask):
+class RouteRemove(ObjectFrameTask):
def get_title(self, session):
return "Remove"
@@ -207,7 +207,7 @@
def render_title(self, session):
return "Choose an Exchange"
-class RouteAdd(ObjectTask):
+class RouteAdd(ObjectFrameTask):
def __init__(self, app, frame):
super(RouteAdd, self).__init__(app, frame)
@@ -222,7 +222,7 @@
link.durable, exchange.name, exchange.name,
key, tag, excludes, False, False, dynamic, sync)
-class RouteAddForm(ObjectTaskForm):
+class RouteAddForm(ObjectFrameTaskForm):
def __init__(self, app, name, task):
super(RouteAddForm, self).__init__(app, name, task)
@@ -329,7 +329,7 @@
self.object = ListParameter(app, "route", item)
self.add_parameter(self.object)
-class BrokerLinkAdd(ObjectTask):
+class BrokerLinkAdd(ObjectFrameTask):
def __init__(self, app, frame):
super(BrokerLinkAdd, self).__init__(app, frame)
@@ -361,7 +361,7 @@
self.qmf_call(invoc, obj, "connect",
host, port, durable, mech, username, password, transport)
-class BrokerLinkAddForm(ObjectTaskForm):
+class BrokerLinkAddForm(ObjectFrameTaskForm):
def __init__(self, app, name, task):
super(BrokerLinkAddForm, self).__init__(app, name, task)
Modified: mgmt/newdata/cumin/python/cumin/messaging/connection.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/messaging/connection.py 2010-08-11 17:07:24 UTC (rev
4199)
+++ mgmt/newdata/cumin/python/cumin/messaging/connection.py 2010-08-11 21:08:27 UTC (rev
4200)
@@ -33,7 +33,7 @@
self.close = ConnectionClose(app, self)
-class ConnectionClose(ObjectTask):
+class ConnectionClose(ObjectFrameTask):
def get_title(self, session):
return "Close"
@@ -76,7 +76,7 @@
self.close = ConnectionSelectionClose(app, self)
-class ConnectionSelectionClose(SelectionTask):
+class ConnectionSelectionClose(ObjectSelectorTask):
def get_title(self, session):
return "Close"
@@ -161,14 +161,14 @@
self.close = SessionClose(app, self)
self.detach = SessionDetach(app, self)
-class SessionClose(ObjectTask):
+class SessionClose(ObjectFrameTask):
def get_title(self, session):
return "Close"
def do_invoke(self, invoc, sess):
self.qmf_call(invoc, sess, "close")
-class SessionDetach(ObjectTask):
+class SessionDetach(ObjectFrameTask):
def get_title(self, session):
return "Detach"
@@ -195,14 +195,14 @@
self.close = SessionSelectionClose(app, self)
self.detach = SessionSelectionDetach(app, self)
-class SessionSelectionClose(SelectionTask):
+class SessionSelectionClose(ObjectSelectorTask):
def get_title(self, session):
return "Close"
def do_invoke(self, invoc, sess):
self.qmf_call(invoc, sess, "close")
-class SessionSelectionDetach(SelectionTask):
+class SessionSelectionDetach(ObjectSelectorTask):
def get_title(self, session):
return "Detach"
Modified: mgmt/newdata/cumin/python/cumin/messaging/exchange.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/messaging/exchange.py 2010-08-11 17:07:24 UTC (rev
4199)
+++ mgmt/newdata/cumin/python/cumin/messaging/exchange.py 2010-08-11 21:08:27 UTC (rev
4200)
@@ -43,7 +43,7 @@
return title
-class ExchangeRemove(ObjectTask):
+class ExchangeRemove(ObjectFrameTask):
def get_title(self, session):
return "Remove"
@@ -90,7 +90,7 @@
self.remove = ExchangeSelectionRemove(app, self)
-class ExchangeSelectionRemove(SelectionTask):
+class ExchangeSelectionRemove(ObjectSelectorTask):
def get_title(self, session):
return "Remove"
@@ -230,7 +230,7 @@
def render_title(self, session):
return "Advanced options"
-class ExchangeAdd(ObjectTask):
+class ExchangeAdd(ObjectFrameTask):
MSG_SEQUENCE = "qpid.msg_sequence"
IVE = "qpid.ive"
@@ -258,7 +258,7 @@
invoc.end()
-class ExchangeAddForm(ObjectTaskForm):
+class ExchangeAddForm(ObjectFrameTaskForm):
def __init__(self, app, name, task):
super(ExchangeAddForm, self).__init__(app, name, task)
Modified: mgmt/newdata/cumin/python/cumin/messaging/queue.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/messaging/queue.py 2010-08-11 17:07:24 UTC (rev 4199)
+++ mgmt/newdata/cumin/python/cumin/messaging/queue.py 2010-08-11 21:08:27 UTC (rev 4200)
@@ -47,7 +47,7 @@
self.move_messages = MoveQueueMessages(app, self)
self.add_binding = QueueBindingAdd(app, self)
-class QueueRemove(ObjectTask):
+class QueueRemove(ObjectFrameTask):
def get_title(self, session):
return "Remove"
@@ -83,7 +83,7 @@
self.remove = QueueSelectionRemove(app, self)
self.purge = QueueSelectionPurge(app, self)
-class QueueSelectionRemove(SelectionTask):
+class QueueSelectionRemove(ObjectSelectorTask):
def get_title(self, session):
return "Remove"
@@ -94,7 +94,7 @@
invoc.end()
-class QueueSelectionPurge(SelectionTask):
+class QueueSelectionPurge(ObjectSelectorTask):
def get_title(self, session):
return "Purge"
@@ -111,7 +111,7 @@
self.queue_column.visible = False
-class QueueAdd(ObjectTask):
+class QueueAdd(ObjectFrameTask):
def __init__(self, app, frame):
super(QueueAdd, self).__init__(app, frame)
@@ -127,7 +127,7 @@
invoc.end()
-class QueueAddForm(ObjectTaskForm):
+class QueueAddForm(ObjectFrameTaskForm):
def __init__(self, app, name, task):
super(QueueAddForm, self).__init__(app, name, task)
@@ -346,7 +346,7 @@
self.task.invoke(session, vhost, name, durable, args)
self.task.exit_with_redirect(session)
-class QueuePurge(ObjectTask):
+class QueuePurge(ObjectFrameTask):
def __init__(self, app, frame):
super(QueuePurge, self).__init__(app, frame)
@@ -358,7 +358,7 @@
def do_invoke(self, invoc, queue, count=0):
self.qmf_call(invoc, queue, "purge", count)
-class QueuePurgeForm(ObjectTaskForm):
+class QueuePurgeForm(ObjectFrameTaskForm):
def __init__(self, app, name, task):
super(QueuePurgeForm, self).__init__(app, name, task)
@@ -592,7 +592,7 @@
def render_item_value(self, session, queue):
return queue._id
-class MoveMessagesBase(ObjectTask):
+class MoveMessagesBase(ObjectFrameTask):
def get_title(self, session):
return "Move messages"
@@ -618,7 +618,7 @@
self.form = MoveMessagesForm(app, self.name, self)
-class MoveMessagesFormBase(ObjectTaskForm):
+class MoveMessagesFormBase(ObjectFrameTaskForm):
def __init__(self, app, name, task, src_queue):
super(MoveMessagesFormBase, self).__init__(app, name, task)
Modified: mgmt/newdata/cumin/python/cumin/objectframe.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/objectframe.py 2010-08-11 17:07:24 UTC (rev 4199)
+++ mgmt/newdata/cumin/python/cumin/objectframe.py 2010-08-11 21:08:27 UTC (rev 4200)
@@ -2,7 +2,6 @@
from wooly.resources import *
from wooly.widgets import *
-from objecttask import *
from formats import *
from util import *
from widgets import *
@@ -339,3 +338,72 @@
def render_title(self, session):
return "Statistics"
+
+class ObjectFrameTask(ObjectTask):
+ def __init__(self, app, frame):
+ super(ObjectFrameTask, self).__init__(app)
+
+ self.frame = frame
+ self.frame.tasks.append(self)
+
+ def init(self):
+ super(ObjectFrameTask, self).init()
+
+ if not self.form:
+ self.form = ObjectFrameTaskForm(self.app, self.name, self)
+ self.form.init()
+
+ def enter(self, session):
+ id = self.frame.id.get(session)
+
+ nsession = wooly.Session(self.app.form_page)
+
+ self.form.id.set(nsession, id)
+ self.form.return_url.set(nsession, session.marshal())
+ self.form.show(nsession)
+
+ self.do_enter(nsession, session)
+
+ return nsession
+
+ def do_enter(self, session, osession):
+ pass
+
+class ObjectFrameTaskForm(FoldingFieldSubmitForm):
+ def __init__(self, app, name, task):
+ super(ObjectFrameTaskForm, self).__init__(app, name)
+
+ self.task = task
+
+ self.id = IntegerParameter(app, "id")
+ self.add_parameter(self.id)
+
+ self.object = SessionAttribute(self, "object")
+
+ self.app.form_page.modes.add_mode(self)
+
+ def do_process(self, session):
+ id = self.id.get(session)
+
+ if id:
+ # XXX don't love this; impl get_object on OTForm instead
+ obj = self.task.frame.get_object(session, id)
+ self.object.set(session, obj)
+
+ super(ObjectFrameTaskForm, self).do_process(session)
+
+ def process_submit(self, session):
+ obj = self.object.get(session)
+
+ self.task.invoke(session, obj)
+ self.task.exit_with_redirect(session)
+
+ def render_title(self, session):
+ return self.task.get_title(session)
+
+ def render_content(self, session):
+ if len(self.main_fields.fields):
+ return super(ObjectFrameTaskForm, self).render_content(session)
+
+ obj = self.object.get(session)
+ return obj.get_title()
Modified: mgmt/newdata/cumin/python/cumin/objectselector.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/objectselector.py 2010-08-11 17:07:24 UTC (rev 4199)
+++ mgmt/newdata/cumin/python/cumin/objectselector.py 2010-08-11 21:08:27 UTC (rev 4200)
@@ -129,7 +129,7 @@
task.init()
for task in self.tasks:
- button = TaskButton(self.app, task)
+ button = ObjectTaskButton(self.app, task)
self.buttons.add_child(button)
button.init()
@@ -222,3 +222,109 @@
class ObjectSelectorLinks(ObjectSelectorControl):
pass
+
+class ObjectSelectorTask(ObjectTask):
+ def __init__(self, app, selector):
+ super(ObjectSelectorTask, self).__init__(app)
+
+ self.cls = selector.cls
+
+ self.selector = selector
+ self.selector.tasks.append(self)
+
+ self.form = None
+
+ def init(self):
+ super(ObjectSelectorTask, self).init()
+
+ if not self.form:
+ self.form = ObjectSelectorTaskForm(self.app, self.name, self)
+ self.form.init()
+
+ def get_title(self, session):
+ pass
+
+ def enter(self, session):
+ ids = self.selector.ids.get(session)
+
+ nsession = wooly.Session(self.app.form_page)
+
+ self.form.ids.set(nsession, ids)
+ self.form.return_url.set(nsession, session.marshal())
+ self.form.show(nsession)
+
+ self.do_enter(nsession, session)
+
+ return nsession
+
+ def do_enter(self, session, osession):
+ pass
+
+ def invoke(self, session, selection, *args):
+ for item in selection:
+ invoc = self.start(session, item)
+
+ try:
+ self.do_invoke(invoc, item, *args)
+ except Exception, e:
+ invoc.exception = e
+ invoc.status = invoc.FAILED
+ invoc.end()
+
+ def do_invoke(self, invoc, item, *args):
+ pass
+
+ def get_item_content(self, session, item):
+ return item.name
+
+class ObjectSelectorTaskForm(FoldingFieldSubmitForm):
+ def __init__(self, app, name, task):
+ super(ObjectSelectorTaskForm, self).__init__(app, name)
+
+ self.task = task
+
+ self.cls = task.selector.cls
+
+ item = IntegerParameter(app, "item")
+
+ self.ids = ListParameter(app, "id", item)
+ self.add_parameter(self.ids)
+
+ self.selection = SessionAttribute(self, "selection")
+
+ 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(ObjectSelectorTaskForm, self).do_process(session)
+
+ def get_selection(self, session):
+ selection = list()
+
+ self.selection.set(session, selection)
+
+ for id in self.ids.get(session):
+ item = self.cls.get_object_by_id(session.cursor, id)
+ selection.append(item)
+
+ def process_submit(self, session):
+ selection = self.selection.get(session)
+
+ self.task.invoke(session, selection)
+ self.task.exit_with_redirect(session)
+
+ def render_title(self, session):
+ return self.task.get_title(session)
+
+ class SelectionList(ItemSet):
+ def do_get_items(self, session):
+ return self.parent.selection.get(session)
+
+ def render_item_content(self, session, item):
+ return self.parent.task.get_item_content(session, item)
+
+ def render_item_class(self, session, item):
+ return "item"
Modified: mgmt/newdata/cumin/python/cumin/objecttask.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/objecttask.py 2010-08-11 17:07:24 UTC (rev 4199)
+++ mgmt/newdata/cumin/python/cumin/objecttask.py 2010-08-11 21:08:27 UTC (rev 4200)
@@ -8,6 +8,7 @@
from formats import *
from main import *
+from task import *
from util import *
from wooly.widgets import Link
@@ -15,7 +16,7 @@
log = logging.getLogger("cumin.objecttask")
strings = StringCatalog(__file__)
-class Task(object):
+class ObjectTask(object):
def __init__(self, app):
self.app = app
@@ -115,318 +116,17 @@
def __str__(self):
return "%s.%s" % (self.__module__, self.__class__.__name__)
-class ObjectTask(Task):
- def __init__(self, app, frame):
- super(ObjectTask, self).__init__(app)
-
- self.frame = frame
- self.frame.tasks.append(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)
-
- nsession = wooly.Session(self.app.form_page)
-
- self.form.id.set(nsession, id)
- self.form.return_url.set(nsession, session.marshal())
- self.form.show(nsession)
-
- self.do_enter(nsession, session)
-
- return nsession
-
- def do_enter(self, session, osession):
- pass
-
-class TaskInvocation(object):
- PENDING = "Pending"
- FAILED = "Failed"
- OK = "OK"
-
- def __init__(self, task, login_session):
- self.task = task
-
- login_session = login_session
- login_session.task_invocations.append(self)
-
- self.user = login_session.user
-
- self.start_time = None
- self.end_time = None
- self.update_time = None
-
- self.status = None
- self.exception = None
- self.description = None
-
- self.status_code = None
- self.output_args = None
-
- self.dismissed = False
-
- def get_description(self, session):
- if self.description:
- return self.description
-
- return self.task.get_description(session)
-
- def get_status(self, session):
- if self.exception:
- return "%s (%s)" % (self.status, str(self.exception))
-
- #return "%s: %s" % (self.status, str(self.output_args))
- return self.status
-
- def end(self):
- log.debug("Ending %s", self.task)
-
- if self.status is self.PENDING:
- self.status = self.OK
-
- now = datetime.now()
-
- self.end_time = now
- self.update_time = now
-
- log.info("Ended %s", self.task)
-
-class TaskInvocationSet(Widget):
- def __init__(self, app, name):
- super(TaskInvocationSet, self).__init__(app, name)
-
- self.update_enabled = True
-
- self.dismiss = IntegerParameter(app, "dismiss")
- self.add_parameter(self.dismiss)
-
- self.item_widget = TaskInvocationItem(app, "item")
- self.add_child(self.item_widget)
-
- def get_items(self, session):
- login = session.client_session.attributes["login_session"]
- return [x for x in login.task_invocations if not x.dismissed]
-
- def do_process(self, session):
- super(TaskInvocationSet, self).do_process(session)
-
- dismiss = self.dismiss.get(session)
-
- if dismiss:
- for invoc in self.get_items(session):
- if id(invoc) == dismiss:
- invoc.dismissed = True
- break
-
- self.dismiss.set(session, self.dismiss.default)
- #self.dismiss.unset(session)
-
- def do_render(self, session):
- items = self.get_items(session)
-
- if items:
- return super(TaskInvocationSet, self).do_render(session)
-
- def render_items(self, session):
- writer = Writer()
-
- for item in self.get_items(session):
- writer.write(self.item_widget.render(session, item))
-
- return writer.to_string()
-
-class TaskInvocationItem(Widget):
- def render_icon_href(self, session, item):
- return "resource?name=add-20.png"
-
- def render_message(self, session, item):
- description = item.get_description(session)
- description = xml_escape(description)
-
- if not description:
- description = ""
-
- status = item.get_status(session)
-
- return "%s: %s" % (description, status)
-
- def render_dismiss_href(self, session, item):
- branch = session.branch()
- self.parent.dismiss.set(branch, id(item))
- return branch.marshal()
-
-class SelectionTask(Task):
- def __init__(self, app, selector):
- super(SelectionTask, self).__init__(app)
-
- self.cls = selector.cls
-
- self.selector = selector
- self.selector.tasks.append(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
-
- def enter(self, session):
- ids = self.selector.ids.get(session)
-
- nsession = wooly.Session(self.app.form_page)
-
- self.form.ids.set(nsession, ids)
- self.form.return_url.set(nsession, session.marshal())
- self.form.show(nsession)
-
- self.do_enter(nsession, session)
-
- return nsession
-
- def do_enter(self, session, osession):
- pass
-
- def invoke(self, session, selection, *args):
- for item in selection:
- invoc = self.start(session, item)
-
- try:
- self.do_invoke(invoc, item, *args)
- except Exception, e:
- invoc.exception = e
- invoc.status = invoc.FAILED
- invoc.end()
-
- def do_invoke(self, invoc, item, *args):
- pass
-
- def get_item_content(self, session, item):
- return item.name
-
-class TaskForm(FoldingFieldSubmitForm):
+class ObjectTaskLink(Link):
def __init__(self, app, name, task):
- assert isinstance(task, Task)
+ assert isinstance(task, ObjectTask), task
- super(TaskForm, self).__init__(app, name)
+ super(ObjectTaskLink, self).__init__(app, name)
self.task = task
-class ObjectTaskForm(TaskForm):
- def __init__(self, app, name, task):
- super(ObjectTaskForm, self).__init__(app, name, task)
-
- self.id = IntegerParameter(app, "id")
- self.add_parameter(self.id)
-
- self.object = SessionAttribute(self, "object")
-
- self.app.form_page.modes.add_mode(self)
-
- def do_process(self, session):
- id = self.id.get(session)
-
- if id:
- # XXX don't love this; impl get_object on OTForm instead
- obj = self.task.frame.get_object(session, id)
- self.object.set(session, obj)
-
- super(ObjectTaskForm, self).do_process(session)
-
- def process_submit(self, session):
- obj = self.object.get(session)
-
- self.task.invoke(session, obj)
- self.task.exit_with_redirect(session)
-
- def render_title(self, session):
- return self.task.get_title(session)
-
- def render_content(self, session):
- if len(self.main_fields.fields):
- return super(ObjectTaskForm, self).render_content(session)
-
- obj = self.object.get(session)
- return obj.get_title()
-
-class SelectionTaskForm(TaskForm):
- def __init__(self, app, name, task):
- super(SelectionTaskForm, self).__init__(app, name, task)
-
- self.cls = task.selector.cls
-
- item = IntegerParameter(app, "item")
-
- self.ids = ListParameter(app, "id", item)
- self.add_parameter(self.ids)
-
- self.selection = SessionAttribute(self, "selection")
-
- 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)
-
- def get_selection(self, session):
- selection = list()
-
- self.selection.set(session, selection)
-
- for id in self.ids.get(session):
- item = self.cls.get_object_by_id(session.cursor, id)
- selection.append(item)
-
- def process_submit(self, session):
- selection = self.selection.get(session)
-
- self.task.invoke(session, selection)
- self.task.exit_with_redirect(session)
-
- def render_title(self, session):
- return self.task.get_title(session)
-
- class SelectionList(ItemSet):
- def do_get_items(self, session):
- return self.parent.selection.get(session)
-
- def render_item_content(self, session, item):
- return self.parent.task.get_item_content(session, item)
-
- def render_item_class(self, session, item):
- return "item"
-
-class TaskLink(Link):
- def __init__(self, app, name, task):
- assert isinstance(task, Task), task
-
- super(TaskLink, self).__init__(app, name)
-
- self.task = task
-
- def render_href(self, session):
- return self.task.get_href(session)
-
- def render_content(self, session):
- return self.task.get_title(session)
-
-class TaskButton(FormButton):
+class ObjectTaskButton(FormButton):
def __init__(self, app, task):
- super(TaskButton, self).__init__(app, task.name)
+ super(ObjectTaskButton, self).__init__(app, task.name)
self.task = task
Modified: mgmt/newdata/cumin/python/cumin/objecttask.strings
===================================================================
--- mgmt/newdata/cumin/python/cumin/objecttask.strings 2010-08-11 17:07:24 UTC (rev 4199)
+++ mgmt/newdata/cumin/python/cumin/objecttask.strings 2010-08-11 21:08:27 UTC (rev 4200)
@@ -39,12 +39,12 @@
list-style: none;
}
-[TaskLink.css]
-a.TaskLink {
+[ObjectTaskLink.css]
+a.ObjectTaskLink {
font-size: 0.9em;
}
-a.TaskLink:before {
+a.ObjectTaskLink:before {
content: "\00BB \0020";
font-weight: bold;
color: #dc9f2e;
Modified: mgmt/newdata/cumin/python/cumin/parameters.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/parameters.py 2010-08-11 17:07:24 UTC (rev 4199)
+++ mgmt/newdata/cumin/python/cumin/parameters.py 2010-08-11 21:08:27 UTC (rev 4200)
@@ -45,23 +45,26 @@
def do_marshal(self, obj):
return str(obj._id)
-class ObjectAttribute(SessionAttribute):
- def __init__(self, widget, name, cls, id_parameter):
+class ObjectAttribute(Attribute):
+ def __init__(self, widget, name, cls, id):
super(ObjectAttribute, self).__init__(widget, name)
+ assert isinstance(cls, RosemaryClass), cls
+
self.cls = cls
- self.id_parameter = id_parameter
+ self.id = id
- def do_get(self, session):
- id = self.id_parameter.get(session)
+ def process(self, session):
+ id = self.id.get(session)
- conn = self.widget.app.database.get_connection()
- cursor = conn.cursor()
+ if id:
+ obj = self.cls.get_object_by_id(session.cursor, id)
+ self.set(session, obj)
- try:
- return self.cls.get_object_by_id(cursor, id)
- finally:
- cursor.close()
+ def get_default(self, session):
+ self.process(session)
+ obj = session.get(self.path)
+ return obj
class BrokerGroupParameter(Parameter):
def do_unmarshal(self, string):
Added: mgmt/newdata/cumin/python/cumin/task.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/task.py (rev 0)
+++ mgmt/newdata/cumin/python/cumin/task.py 2010-08-11 21:08:27 UTC (rev 4200)
@@ -0,0 +1,329 @@
+from rosemary.model import *
+from wooly.forms import *
+from wooly.resources import *
+from wooly.widgets import *
+
+from formats import *
+from main import *
+from parameters import *
+from util import *
+
+from wooly.widgets import Link
+
+log = logging.getLogger("cumin.task")
+strings = StringCatalog(__file__)
+
+class Task(object):
+ def __init__(self, app):
+ self.app = app
+ self.name = self.__class__.__name__
+ self.form = None
+
+ self.app.tasks.append(self)
+
+ def init(self):
+ log.info("Initializing %s", self)
+
+ assert self.form, self
+ self.app.form_page.modes.add_mode(self.form)
+
+ def get_title(self, session, obj):
+ pass
+
+ def get_description(self, session, obj=None):
+ return self.get_title(session, obj)
+
+ def get_href(self, session, obj):
+ return self.enter(session, obj).marshal()
+
+ def enter(self, session, obj):
+ form_session = wooly.Session(self.app.form_page)
+
+ if obj:
+ self.form.id.set(nsession, obj._id)
+
+ self.form.return_url.set(form_session, session.marshal())
+ self.form.show(form_session)
+
+ self.do_enter(session, obj, form_session)
+
+ return form_session
+
+ def do_enter(self, session, obj, form_session):
+ pass
+
+ def exit(self, session, obj):
+ log.debug("Exiting %s", self)
+
+ url = self.form.return_url.get(session)
+ osession = wooly.Session.unmarshal(self.app, url)
+
+ self.do_exit(osession, obj)
+
+ log.info("Exited %s", self)
+
+ return osession
+
+ def do_exit(self, session, obj):
+ pass
+
+ def exit_with_redirect(self, session, obj):
+ osession = self.exit(session, obj)
+ self.form.page.redirect.set(session, osession.marshal())
+
+ def start(self, session, obj):
+ log.debug("Starting %s", self)
+
+ login = session.client_session.attributes["login_session"]
+
+ invoc = TaskInvocation(self, login)
+
+ now = datetime.now()
+
+ invoc.start_time = now
+ invoc.update_time = now
+ invoc.status = invoc.PENDING
+
+ log.info("Started %s", self)
+
+ return invoc
+
+ def invoke(self, session, obj, *args, **kwargs):
+ if obj:
+ assert isinstance(obj, RosemaryObject), obj
+
+ invoc = self.start(session, obj)
+
+ try:
+ self.do_invoke(session, obj, invoc, *args, **kwargs)
+ except Exception, e:
+ self.exception(invoc, e)
+
+ def do_invoke(self, session, obj, invoc, **kwargs):
+ pass
+
+ def qmf_call(self, invoc, obj, meth, *args):
+ def completion(status_code, output_args):
+ invoc.status_code = status_code
+ invoc.output_args = output_args
+
+ invoc.end()
+
+ session = self.app.session
+ session.call_method(completion, obj, meth, args)
+
+ def exception(self, invoc, e):
+ now = datetime.now()
+
+ invoc.status = invoc.FAILED
+ invoc.end_time = now
+ invoc.update_time = now
+ invoc.exception = e
+
+ log.exception(e)
+
+ def __str__(self):
+ return "%s.%s" % (self.__module__, self.__class__.__name__)
+
+class TaskInvocation(object):
+ PENDING = "Pending"
+ FAILED = "Failed"
+ OK = "OK"
+
+ def __init__(self, task, login_session):
+ self.task = task
+
+ login_session = login_session
+ login_session.task_invocations.append(self)
+
+ self.user = login_session.user
+
+ self.start_time = None
+ self.end_time = None
+ self.update_time = None
+
+ self.status = None
+ self.exception = None
+ self.description = None
+
+ self.status_code = None
+ self.output_args = None
+
+ self.dismissed = False
+
+ def get_description(self, session):
+ if self.description:
+ return self.description
+
+ return self.task.get_description(session)
+
+ def get_status(self, session):
+ if self.exception:
+ return "%s (%s)" % (self.status, str(self.exception))
+
+ #return "%s: %s" % (self.status, str(self.output_args))
+ return self.status
+
+ def end(self):
+ log.debug("Ending %s", self.task)
+
+ if self.status is self.PENDING:
+ self.status = self.OK
+
+ now = datetime.now()
+
+ self.end_time = now
+ self.update_time = now
+
+ log.info("Ended %s", self.task)
+
+class TaskInvocationSet(Widget):
+ def __init__(self, app, name):
+ super(TaskInvocationSet, self).__init__(app, name)
+
+ self.update_enabled = True
+
+ self.dismiss = IntegerParameter(app, "dismiss")
+ self.add_parameter(self.dismiss)
+
+ self.item_widget = TaskInvocationItem(app, "item")
+ self.add_child(self.item_widget)
+
+ def get_items(self, session):
+ login = session.client_session.attributes["login_session"]
+ return [x for x in login.task_invocations if not x.dismissed]
+
+ def do_process(self, session):
+ super(TaskInvocationSet, self).do_process(session)
+
+ dismiss = self.dismiss.get(session)
+
+ if dismiss:
+ for invoc in self.get_items(session):
+ if id(invoc) == dismiss:
+ invoc.dismissed = True
+ break
+
+ self.dismiss.set(session, self.dismiss.default)
+ #self.dismiss.unset(session)
+
+ def do_render(self, session):
+ items = self.get_items(session)
+
+ if items:
+ return super(TaskInvocationSet, self).do_render(session)
+
+ def render_items(self, session):
+ writer = Writer()
+
+ for item in self.get_items(session):
+ writer.write(self.item_widget.render(session, item))
+
+ return writer.to_string()
+
+class TaskInvocationItem(Widget):
+ def render_icon_href(self, session, item):
+ return "resource?name=add-20.png"
+
+ def render_message(self, session, item):
+ description = item.get_description(session)
+ description = xml_escape(description)
+
+ if not description:
+ description = ""
+
+ status = item.get_status(session)
+
+ return "%s: %s" % (description, status)
+
+ def render_dismiss_href(self, session, item):
+ branch = session.branch()
+ self.parent.dismiss.set(branch, id(item))
+ return branch.marshal()
+
+class TaskLink(Link):
+ def __init__(self, app, name, task, object=None):
+ super(TaskLink, self).__init__(app, name)
+
+ self.task = task
+ self.object = object
+
+ def render_href(self, session):
+ obj = None
+
+ if self.object:
+ obj = self.object.get(session)
+
+ return self.task.get_href(session, obj)
+
+ def render_content(self, session):
+ obj = None
+
+ if self.object:
+ obj = self.object.get(session)
+
+ return self.task.get_title(session, obj)
+
+class TaskButton(FormButton):
+ def __init__(self, app, name, task, object=None):
+ super(TaskButton, self).__init__(app, name)
+
+ self.task = task
+ self.object = object
+
+ def process_submit(self, session):
+ obj = None
+
+ if self.object:
+ obj = self.object.get(session)
+
+ href = self.task.get_href(session, obj)
+ self.page.redirect.set(session, href)
+
+ def render_content(self, session):
+ obj = None
+
+ if self.object:
+ obj = self.object.get(session)
+
+ return self.task.get_title(session, obj)
+
+class ObjectTaskForm(FoldingFieldSubmitForm):
+ def __init__(self, app, name, task, cls):
+ super(ObjectTaskForm, self).__init__(app, name)
+
+ self.task = task
+ self.cls = cls
+
+ self.id = IntegerParameter(app, "id")
+ self.add_parameter(self.id)
+
+ self.object = ObjectAttribute(app, "object", self.cls, self.id)
+ self.add_attribute(self.object)
+
+ def do_process(self, session):
+ self.object.process(session)
+
+ super(ObjectTaskForm, self).do_process(session)
+
+ def process_submit(self, session):
+ self.validate(session)
+
+ if not self.errors.get(session):
+ obj = self.object.get(session)
+
+ self.task.invoke(session, obj)
+ self.task.exit_with_redirect(session)
+
+ def render_title(self, session):
+ obj = self.object.get(session)
+ return self.task.get_title(session, obj)
+
+ def render_content(self, session):
+ if len(self.main_fields.fields):
+ return super(ObjectTaskForm, self).render_content(session)
+
+ obj = self.object.get(session)
+ return obj.get_title()
+
+# class SelectionTaskForm
Added: mgmt/newdata/cumin/python/cumin/task.strings
===================================================================
--- mgmt/newdata/cumin/python/cumin/task.strings (rev 0)
+++ mgmt/newdata/cumin/python/cumin/task.strings 2010-08-11 21:08:27 UTC (rev 4200)
@@ -0,0 +1,51 @@
+[TaskInvocationSet.css]
+div.TaskInvocationSet {
+ background-color: #fe0;
+ padding: 1em 2em;
+ -moz-border-radius: 0.5em;
+ -webkit-border-radius: 0.5em;
+ margin: 0.5em auto 1em auto;
+ width: 80%;
+}
+
+div.TaskInvocationSet ul {
+ margin: 0;
+ padding: 0 0 0 1em;
+}
+
+div.TaskInvocationSet a.dismiss {
+ float: right;
+ font-size: 0.9em;
+}
+
+div.TaskInvocationSet a.dismissall {
+ font-size: 0.9em;
+}
+
+[TaskInvocationSet.html]
+<div id="{id}" class="{class}">
+ <!-- <a class="dismissall" href="">Dismiss all</a>
-->
+ <ul>{items}</ul>
+</div>
+
+[TaskInvocationItem.html]
+<li>
+ <a class="dismiss" href="{dismiss_href}">Dismiss</a>
+ {message}
+</li>
+
+[SelectionList.css]
+ul.SelectionList {
+ list-style: none;
+}
+
+[TaskLink.css]
+a.TaskLink {
+ font-size: 0.9em;
+}
+
+a.TaskLink:before {
+ content: "\00BB \0020";
+ font-weight: bold;
+ color: #dc9f2e;
+}
Modified: mgmt/newdata/cumin/python/cumin/usergrid/widgets.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/usergrid/widgets.py 2010-08-11 17:07:24 UTC (rev
4199)
+++ mgmt/newdata/cumin/python/cumin/usergrid/widgets.py 2010-08-11 21:08:27 UTC (rev
4200)
@@ -51,7 +51,7 @@
super(OverviewFrame, self).__init__(app, name)
# XXX temp hack. these are
- # not used but needed for SubmissionAdd ObjectTask
+ # not used but needed for SubmissionAdd ObjectFrameTask
self.tasks = list()
self.id = Attribute(app, "id")
self.id.default = 0
@@ -70,14 +70,18 @@
self.stats = UserJobStatSet(app, "jobs", user)
self.add_child(self.stats)
- task = SubmissionVMAdd(app, frame)
- self.vm_link = TaskLink(app, "submissionvmadd", task)
- self.add_child(self.vm_link)
+ link = TaskLink(app, "job_submit", app.grid.job_submit)
+ self.add_child(link)
- task = SubmissionDagAdd(app, frame)
- self.dag_link = TaskLink(app, "submissiondagadd", task)
- self.add_child(self.dag_link)
+ # XXX
+ # task = SubmissionVMAdd(app)
+ # self.vm_link = ObjectTaskLink(app, "submissionvmadd", task)
+ # self.add_child(self.vm_link)
+ # task = SubmissionDagAdd(app, frame)
+ # self.dag_link = ObjectTaskLink(app, "submissiondagadd", task)
+ # self.add_child(self.dag_link)
+
class SubmissionsFrame(CuminFrame):
def __init__(self, app, name, user):
super(SubmissionsFrame, self).__init__(app, name)
@@ -105,15 +109,9 @@
col = ObjectLinkColumn(app, "name", self.cls.Name, self.cls._id,
frame)
self.insert_column(1, col)
- #task = SubmissionAdd(app) # XXX ugh, pool frame
- task = NullTask(app)
- link = TaskLink(app, "submissionadd", task)
+ link = TaskLink(app, "add", app.grid.job_submit)
self.links.add_child(link)
-class NullTask(Task):
- def get_title(self, session):
- return "Create submission"
-
class UserJobStatSet(NewStatSet):
def __init__(self, app, name, user):
super(UserJobStatSet, self).__init__(app, name)
Modified: mgmt/newdata/cumin/python/cumin/usergrid/widgets.strings
===================================================================
--- mgmt/newdata/cumin/python/cumin/usergrid/widgets.strings 2010-08-11 17:07:24 UTC (rev
4199)
+++ mgmt/newdata/cumin/python/cumin/usergrid/widgets.strings 2010-08-11 21:08:27 UTC (rev
4200)
@@ -24,25 +24,19 @@
}
[OverviewView.html]
-<div class="usergrid heading">
- <ul>
- <li>{submissionvmadd}</li>
- <li>{submissiondagadd}</li>
- </ul><div style="clear:both;"></div>
- <h2>
- <img src="resource?name=job-20.png"/>
- Jobs
- </h2>
-
-</div>
-
<table class="twocol OverviewView">
<tbody>
<tr>
<td>
+ <h2>Job statistics</h2>
{jobs}
</td>
<td>
+ <h2>Tasks</h2>
+
+ <ul style="list-style-type: none; margin: 1 0; padding: 0;">
+ <li>{job_submit}</li>
+ </ul>
</td>
</tr>
</tbody>
Modified: mgmt/newdata/cumin/python/cumin/widgets.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/widgets.py 2010-08-11 17:07:24 UTC (rev 4199)
+++ mgmt/newdata/cumin/python/cumin/widgets.py 2010-08-11 21:08:27 UTC (rev 4200)
@@ -12,6 +12,7 @@
from widgets import *
from charts import *
from formats import *
+from task import *
from user import *
from util import *
@@ -1499,7 +1500,7 @@
return obj_list
-class BindingAddTask(ObjectTask):
+class BindingAddTask(ObjectFrameTask):
def get_title(self, session):
return "Add Binding"