r4799 - trunk/cumin/python/cumin/grid
by tmckay@fedoraproject.org
Author: tmckay
Date: 2011-06-02 14:00:58 +0000 (Thu, 02 Jun 2011)
New Revision: 4799
Modified:
trunk/cumin/python/cumin/grid/limit.py
Log:
Add an error message on negative limit value, in addition to code that
replaces negative limits with 0 on send.
(BZ696697 modification)
Modified: trunk/cumin/python/cumin/grid/limit.py
===================================================================
--- trunk/cumin/python/cumin/grid/limit.py 2011-06-02 13:47:16 UTC (rev 4798)
+++ trunk/cumin/python/cumin/grid/limit.py 2011-06-02 14:00:58 UTC (rev 4799)
@@ -265,14 +265,20 @@
def validate(self, session):
value = self.input.get(session)
+ message = None
if value:
try:
if value.lower() not in ("unlimited", "na", "n/a"):
value = float(value)
+ if value < 0:
+ message = "The '%s' field may not be less than zero" \
+ % self.render_title(session)
except:
- title = self.render_title(session)
- message = "The '%s' field must be either \"unlimited\", an integer or a float" % title
- self.form.errors.add(session, FormError(message))
+ message = "The '%s' field must be either \"unlimited\", " \
+ "an integer or a float" % self.render_title(session)
+
+ if message:
+ self.form.errors.add(session, FormError(message))
12 years, 11 months
r4798 - trunk/cumin/python/cumin/grid
by croberts@fedoraproject.org
Author: croberts
Date: 2011-06-02 13:47:16 +0000 (Thu, 02 Jun 2011)
New Revision: 4798
Modified:
trunk/cumin/python/cumin/grid/limit.py
Log:
Removing unused code.
Modified: trunk/cumin/python/cumin/grid/limit.py
===================================================================
--- trunk/cumin/python/cumin/grid/limit.py 2011-06-02 12:17:59 UTC (rev 4797)
+++ trunk/cumin/python/cumin/grid/limit.py 2011-06-02 13:47:16 UTC (rev 4798)
@@ -180,10 +180,7 @@
self.limit_max = self.LimitMax(app, "max")
self.limit_max.required = True
self.add_field(self.limit_max)
-
-# self.reset_button = self.ResetLimitFormButton(app, "resetbutton")
-# self.add_field(self.reset_button)
-
+
def process_submit(self, session):
new_max_value = self.limit_max.input.get(session)
unlimited_check_value = self.limit_max.checkbox.param.get(session)
12 years, 11 months
r4797 - trunk/cumin/python/cumin/grid
by croberts@fedoraproject.org
Author: croberts
Date: 2011-06-02 12:17:59 +0000 (Thu, 02 Jun 2011)
New Revision: 4797
Modified:
trunk/cumin/python/cumin/grid/submission.py
Log:
Setting the truncation length for submission name to 50 characters after the UI review.
Modified: trunk/cumin/python/cumin/grid/submission.py
===================================================================
--- trunk/cumin/python/cumin/grid/submission.py 2011-06-01 21:23:06 UTC (rev 4796)
+++ trunk/cumin/python/cumin/grid/submission.py 2011-06-02 12:17:59 UTC (rev 4797)
@@ -115,8 +115,8 @@
class PoolSubmissionObjectLinkColumn(ObjectLinkColumn):
def render_cell_content(self, session, record):
retval = len(record) > 0 and record[self.field.index] or ""
- if(len(record[self.field.index]) > 80):
- retval = record[self.field.index][:80] + "..." #indicate that we truncated the name
+ if(len(record[self.field.index]) > 50):
+ retval = record[self.field.index][:50] + "..." #indicate that we truncated the name
return retval
12 years, 11 months
r4796 - trunk/cumin/python/cumin/grid
by croberts@fedoraproject.org
Author: croberts
Date: 2011-06-01 21:23:06 +0000 (Wed, 01 Jun 2011)
New Revision: 4796
Modified:
trunk/cumin/python/cumin/grid/limit.py
trunk/cumin/python/cumin/grid/limit.strings
Log:
Addressing BZ https://bugzilla.redhat.com/show_bug.cgi?id=697016 . Changing from the "unlimited" button to a checkbox.
Modified: trunk/cumin/python/cumin/grid/limit.py
===================================================================
--- trunk/cumin/python/cumin/grid/limit.py 2011-06-01 11:11:42 UTC (rev 4795)
+++ trunk/cumin/python/cumin/grid/limit.py 2011-06-01 21:23:06 UTC (rev 4796)
@@ -7,7 +7,7 @@
from cumin.qmfadapter import ObjectQmfAdapter
from cumin.widgets import CuminView
from wooly.forms import StringField, StringInput, IntegerField, RealField, \
- FormButton, FormField, FormError
+ FormButton, FormField, FormError, CheckboxInput
from wooly.util import StringCatalog
from wooly.widgets import TabbedModeSet
from wooly.parameters import *
@@ -181,11 +181,12 @@
self.limit_max.required = True
self.add_field(self.limit_max)
- self.reset_button = self.ResetLimitFormButton(app, "resetbutton")
- self.add_field(self.reset_button)
+# self.reset_button = self.ResetLimitFormButton(app, "resetbutton")
+# self.add_field(self.reset_button)
def process_submit(self, session):
new_max_value = self.limit_max.input.get(session)
+ unlimited_check_value = self.limit_max.checkbox.param.get(session)
self.limit_max.validate(session)
if not self.errors.get(session):
@@ -207,19 +208,32 @@
def render_form_class(self, session):
return " ".join((super(NegotiatorLimitForm, self).render_form_class(session), "mform"))
- class ResetLimitFormButton(FormField):
+ class StringFieldWithCheckbox(StringField):
def __init__(self, app, name):
- super(NegotiatorLimitForm.ResetLimitFormButton, self).__init__(app, name)
- self.button_tmpl = WidgetTemplate(self, "reset_button_html")
-
+ super(NegotiatorLimitForm.StringFieldWithCheckbox, self).__init__(app, name)
+ self.button_tmpl = WidgetTemplate(self, "input_with_checkbox_html")
+
+ self.checkbox = CheckboxInput(app, "unlimitedcheck")
+ self.add_child(self.checkbox)
+
def do_render(self, session):
writer = Writer()
self.button_tmpl.render(writer, session)
- return writer.to_string()
+ return writer.to_string()
- def render_class(self, session):
- return "midformbutton"
+ def render_field_value(self,session):
+ return self.input.get(session)
+ def render_field_name(self,session):
+ return self.input.param.path
+
+ def render_checkbox_name(self,session):
+ return self.checkbox.param.path
+
+ def render_onclick_attr(self, session, *args):
+ value = "toggleLimitInput(this, '%s', '%s')" % (self.checkbox.param.path, self.input.param.path)
+ return "onclick=\"%s\"" % value
+
class LimitName(StringField):
def __init__(self, app, name):
super(NegotiatorLimitForm.LimitName, self).__init__(app, name)
@@ -234,7 +248,7 @@
# used to override html and css
pass
- class LimitMax(StringField):
+ class LimitMax(StringFieldWithCheckbox):
def render_title(self, session):
return "Max Allowance"
@@ -262,6 +276,8 @@
title = self.render_title(session)
message = "The '%s' field must be either \"unlimited\", an integer or a float" % title
self.form.errors.add(session, FormError(message))
+
+
class LimitView(CuminView):
def __init__(self, app, name, limit):
Modified: trunk/cumin/python/cumin/grid/limit.strings
===================================================================
--- trunk/cumin/python/cumin/grid/limit.strings 2011-06-01 11:11:42 UTC (rev 4795)
+++ trunk/cumin/python/cumin/grid/limit.strings 2011-06-01 21:23:06 UTC (rev 4796)
@@ -31,15 +31,27 @@
//]]>
</script>
-[ResetLimitFormButton.reset_button_html]
+[StringFieldWithCheckbox.input_with_checkbox_html]
<tr id="{id}">
- <th></th>
- <td><button class="{class}" type="button" name="{id}" onclick="return resetLimitMax();">Unlimited</button></td>
+ <th>
+ <div class="title">Max Allowance<span style="color: #c33">*</span></div>
+ <div class="help"></div>
+ </th>
+ <td>
+ <input type="text" name="{field_name}" id="{field_name}" value="{field_value}" tabindex="100" size="30" />
+ <input type="checkbox" name="{checkbox_name}" id="{checkbox_name}" {onclick_attr}/><label for="{checkbox_name}">Unlimited</label>
+ </td>
</tr>
<script type="text/javascript">
//<![CDATA[
-function resetLimitMax() {
- document.forms[0].elements[1].value="Unlimited";
+function toggleLimitInput(form, checkbox, textinput) {
+ if($(checkbox).checked) {
+ $(textinput).value = "Unlimited";
+ $(textinput).setProperty('readonly', 'readonly');
+ } else {
+ $(textinput).value = "{field_value}";
+ $(textinput).setProperty('readonly', null);
+ }
return false;
}
//]]>
12 years, 11 months
r4794 - in branches/stability/cumin: etc python/cumin/grid
by tmckay@fedoraproject.org
Author: tmckay
Date: 2011-06-01 01:48:31 +0000 (Wed, 01 Jun 2011)
New Revision: 4794
Modified:
branches/stability/cumin/etc/cumin.conf
branches/stability/cumin/python/cumin/grid/submission.py
Log:
Merge revision 4793 from trunk.
BZ708495
Modified: branches/stability/cumin/etc/cumin.conf
===================================================================
--- branches/stability/cumin/etc/cumin.conf 2011-06-01 01:39:44 UTC (rev 4793)
+++ branches/stability/cumin/etc/cumin.conf 2011-06-01 01:48:31 UTC (rev 4794)
@@ -89,7 +89,8 @@
# vacuum-enabled: True
vacuum-interval: 900
include-classes: com.redhat.grid:*
-exclude-classes: com.redhat.grid:Slot, com.redhat.grid:Submission
+exclude-classes: com.redhat.grid:Slot, com.redhat.grid:Submission,
+ com.redhat.grid:JobServer, com.redhat.grid:Submitter, com.redhat.grid:Scheduler
[data.grid-slots]
# log-file: $CUMIN_HOME/log/data.grid-slots.log
@@ -108,7 +109,8 @@
# expire-threshold: 86400
vacuum-enabled: False
# vacuum-interval: 3600
-include-classes: com.redhat.grid:Submission
+include-classes: com.redhat.grid:Submission, com.redhat.grid:JobServer,
+ com.redhat.grid:Submitter, com.redhat.grid:Scheduler
# exclude-classes: [none]
[data.sesame]
Modified: branches/stability/cumin/python/cumin/grid/submission.py
===================================================================
--- branches/stability/cumin/python/cumin/grid/submission.py 2011-06-01 01:39:44 UTC (rev 4793)
+++ branches/stability/cumin/python/cumin/grid/submission.py 2011-06-01 01:48:31 UTC (rev 4794)
@@ -51,7 +51,7 @@
table = cls.sql_table
- fmt = "(%s > now() - interval '3 days' or %s > 0 or %s > 0 or %s > 0)"
+ fmt = "(%s > now() - interval '10 days' or %s > 0 or %s > 0 or %s > 0)"
args = (table._qmf_update_time.identifier,
table.Idle.identifier,
table.Running.identifier,
12 years, 11 months
r4793 - trunk/cumin/etc
by tmckay@fedoraproject.org
Author: tmckay
Date: 2011-06-01 01:39:44 +0000 (Wed, 01 Jun 2011)
New Revision: 4793
Modified:
trunk/cumin/etc/cumin.conf
Log:
Change distribution of QMF classes across cumin-data instances.
BZ708495
Modified: trunk/cumin/etc/cumin.conf
===================================================================
--- trunk/cumin/etc/cumin.conf 2011-05-27 17:44:59 UTC (rev 4792)
+++ trunk/cumin/etc/cumin.conf 2011-06-01 01:39:44 UTC (rev 4793)
@@ -89,7 +89,8 @@
# vacuum-enabled: True
vacuum-interval: 900
include-classes: com.redhat.grid:*
-exclude-classes: com.redhat.grid:Slot, com.redhat.grid:Submission
+exclude-classes: com.redhat.grid:Slot, com.redhat.grid:Submission,
+ com.redhat.grid:JobServer, com.redhat.grid:Submitter, com.redhat.grid:Scheduler
[data.grid-slots]
# log-file: $CUMIN_HOME/log/data.grid-slots.log
@@ -108,7 +109,8 @@
# expire-threshold: 86400
vacuum-enabled: False
# vacuum-interval: 3600
-include-classes: com.redhat.grid:Submission
+include-classes: com.redhat.grid:Submission, com.redhat.grid:JobServer,
+ com.redhat.grid:Submitter, com.redhat.grid:Scheduler
# exclude-classes: [none]
[data.sesame]
12 years, 11 months