r4923 - trunk/cumin/python/cumin/grid
by croberts@fedoraproject.org
Author: croberts
Date: 2011-08-12 19:56:19 +0000 (Fri, 12 Aug 2011)
New Revision: 4923
Modified:
trunk/cumin/python/cumin/grid/tags.py
Log:
More tagging code cleanup, pydoc additions
Modified: trunk/cumin/python/cumin/grid/tags.py
===================================================================
--- trunk/cumin/python/cumin/grid/tags.py 2011-08-12 15:25:19 UTC (rev 4922)
+++ trunk/cumin/python/cumin/grid/tags.py 2011-08-12 19:56:19 UTC (rev 4923)
@@ -326,6 +326,11 @@
return("Tag name(s): ")
class TagsList(CheckboxItemSetField):
+ '''
+ This class, note the rendering handled in tags.strings::filtered_select_html,
+ takes care of displaying the tags for the given node in a filterable select box
+ that is pageable.
+ '''
def __init__(self, app, name):
item_parameter = SymbolParameter(app, "tag")
super(RemoveTags.TagsList, self).__init__(app, name, item_parameter)
@@ -346,6 +351,10 @@
return tags_string
def do_get_items(self, session):
+ '''
+ Returns the tags returned from the wallaby call formatted as checkboxitems
+ (which are used as select options in this case)
+ '''
tags = fetchTags(self, session)
items = list()
@@ -412,7 +421,7 @@
such that when the user enters text, they will be greeted with
a set of tags that match their text entry, or "No matches"
- If we decide against this sort of interface, this class can be removed
+ **** If we decide against this sort of interface, this class can be removed
'''
def __init__(self, app, name, form, param):
super(TagSelectField, self).__init__(app, name)
@@ -493,9 +502,8 @@
class TagsList(CheckboxItemSetField):
'''
- This class, note the rendering handled in tags.strings::double_filtered_select_html,
- takes care of displaying the tags for the given node in a filterable select box with additions
- being moved to a second box.
+ This class takes care of displaying the tags for the given node in a filterable select box
+ that is pageable. Note the rendering handled in tags.strings::filtered_select_html
'''
def __init__(self, app, name):
item_parameter = SymbolParameter(app, "tag")
@@ -587,9 +595,13 @@
return value
def render_inputs(self, session, *args):
+ '''
+ Show the initial value passed-in, truncated to trunc_length characters
+ '''
+ trunc_length = 50
value = self.input.get(session)
- if(len(value) > 50):
- value = value[:50] + "..." #indicate truncated value
+ if(len(value) > trunc_length):
+ value = value[:trunc_length] + "..." #indicate truncated value
return value
class DisabledInput(StringInput):
@@ -667,7 +679,7 @@
return items
def render_title(self, session):
- return "Nodes"
+ return "Update nodes"
class NodeName(StringField):
def __init__(self, app, name):
@@ -686,8 +698,9 @@
def render_inputs(self, session, *args):
value = self.input.get(session)
- if(len(value) > 50):
- value = value[:50] + "..." #indicate truncated value
+ trunc_length = 50
+ if(len(value) > trunc_length):
+ value = value[:trunc_length] + "..." #indicate truncated value
return value
def render_title(self, session):
@@ -891,7 +904,7 @@
wallaby_tags = self.app.wallaby.get_data(WBTypes.TAGS)
tag_list = list()
- for i, tag in enumerate(wallaby_tags):
+ for tag in wallaby_tags:
tag_list.append(str(tag.name))
tag_list.sort()
@@ -904,7 +917,7 @@
wallaby_nodes = self.app.wallaby.get_data(WBTypes.NODES)
node_list = list()
- for i, node in enumerate(wallaby_nodes):
+ for node in wallaby_nodes:
node_list.append(str(node.name))
node_list.sort()
12 years, 8 months
r4922 - in trunk: cumin/resources wooly/resources
by croberts@fedoraproject.org
Author: croberts
Date: 2011-08-12 15:25:19 +0000 (Fri, 12 Aug 2011)
New Revision: 4922
Modified:
trunk/cumin/resources/app.css
trunk/wooly/resources/mootools.js
Log:
Additional style tweaks for the large select utility.
Modified: trunk/cumin/resources/app.css
===================================================================
--- trunk/cumin/resources/app.css 2011-08-11 20:40:18 UTC (rev 4921)
+++ trunk/cumin/resources/app.css 2011-08-12 15:25:19 UTC (rev 4922)
@@ -704,16 +704,26 @@
padding:7px 0;
}
-.mtms_filtercontrols a,.mtms_paginator a,.mtms_filterlabel {
- color:#000;
+.mtms_filtercontrols a,.mtms_paginator a {
+ color:#000;
padding:0 4px 0 6px;
+ text-decoration:underline;
}
+.mtms_filterlabel {
+ color:#000;
+ padding:0 4px 0 0;
+}
+
.mtms_paginator {
clear:both;
padding:5px;
}
+.mtms_paginator .selected, .mtms_paginator .disabled{
+ text-decoration:none;
+}
+
.mtmultiselect ol {
padding:0;
}
Modified: trunk/wooly/resources/mootools.js
===================================================================
--- trunk/wooly/resources/mootools.js 2011-08-11 20:40:18 UTC (rev 4921)
+++ trunk/wooly/resources/mootools.js 2011-08-12 15:25:19 UTC (rev 4922)
@@ -1846,12 +1846,12 @@
case_sensitive: false,
displaylist: null,
inputpos: 'top',
- labels: {'total': 'total',
- 'selected': 'selected',
- 'unselected': 'unselected',
- 'selectall': 'select all',
- 'selectnone': 'select none',
- 'filter': 'filter',
+ labels: {'total': 'Total:',
+ 'selected': 'Selected:',
+ 'unselected': 'Unselected:',
+ 'selectall': 'Select all',
+ 'selectnone': 'Select none',
+ 'filter': 'Filter',
'in': 'in',
'out': 'out',
'page': 'page'
@@ -1929,7 +1929,7 @@
makebtn: function(label, func, prefix){
var li = new Element('li');
var btn = new Element('a', {'html': label,
- 'href': '#cpcspswdnbd',
+ 'href': '#',
'events': {
// You might have to bind this differently
'click': func.bind(this)
12 years, 8 months
r4921 - trunk/cumin/resources
by croberts@fedoraproject.org
Author: croberts
Date: 2011-08-11 20:40:18 +0000 (Thu, 11 Aug 2011)
New Revision: 4921
Modified:
trunk/cumin/resources/app.css
Log:
New color scheme for the hybrid large select box utility. Not sure if it's the winner, but it's an improvement.
Modified: trunk/cumin/resources/app.css
===================================================================
--- trunk/cumin/resources/app.css 2011-08-11 17:58:20 UTC (rev 4920)
+++ trunk/cumin/resources/app.css 2011-08-11 20:40:18 UTC (rev 4921)
@@ -666,7 +666,7 @@
.mtmultiselect {
width:400px;
- background:#0D171A;
+ background:#E7E7F7;
font:12px verdana;
}
@@ -700,12 +700,12 @@
}
.mtms_filtercontrols {
- color:#B4A6A6;
+ color:#000;
padding:7px 0;
}
.mtms_filtercontrols a,.mtms_paginator a,.mtms_filterlabel {
- color:#8C8CD9;
+ color:#000;
padding:0 4px 0 6px;
}
@@ -726,7 +726,7 @@
}
.mtmultiselect ol li:hover {
- background-color:#84D1E0;
+ background-color:#22BB22;
color:#111;
}
12 years, 8 months
r4920 - trunk/cumin/resources
by croberts@fedoraproject.org
Author: croberts
Date: 2011-08-11 17:58:20 +0000 (Thu, 11 Aug 2011)
New Revision: 4920
Modified:
trunk/cumin/resources/app.css
Log:
Fixing css formatting for recent additions.
Modified: trunk/cumin/resources/app.css
===================================================================
--- trunk/cumin/resources/app.css 2011-08-11 15:06:46 UTC (rev 4919)
+++ trunk/cumin/resources/app.css 2011-08-11 17:58:20 UTC (rev 4920)
@@ -664,60 +664,71 @@
clear: both;
}
- .mtmultiselect{
- width: 400px;
- background: #0D171A;
- font: 12px verdana;
- }
- .mtmultiselect .selected{
- background-color: #E8F7E8;
- }
- .mtmultiselect ol .selected{
- background-color: #E8F7E8;
- background-image: url('resource?name=check-mark.png');
- background-position: left;
- background-repeat: no-repeat;
- }
- .mtmultiselect ul li{
- display:inline;
- }
- .disabled{
- color: #ccc;
- }
- .mtms_filterbox{
- float: left;
- padding: 5px;
- }
- .mtms_filterbox input{
- background: #FFF;
- border: 1px solid #141212;
- }
- .mtms_filtercontrols{
- padding: 7px 0;
- color: #B4A6A6;l
- }
- .mtms_filtercontrols a, .mtms_paginator a,
- .mtms_filterlabel{
- color: #8C8CD9;
- padding: 0 4px 0 6px;
- }
- .mtms_paginator{
- clear: both;
- padding: 5px;
- }
- .mtmultiselect ol{
- padding: 0;
- }
- .mtmultiselect ol li{
- list-style-type: none;
- padding: 1px 5px 1px 25px;
- background-color: #FFF;
- color: #000;
- }
- .mtmultiselect ol li:hover{
- background-color: #84D1E0;
- color: #111;
- }
+.mtmultiselect {
+ width:400px;
+ background:#0D171A;
+ font:12px verdana;
+}
+
+.mtmultiselect .selected {
+ background-color:#E8F7E8;
+}
+
+.mtmultiselect ol .selected {
+ background-color:#E8F7E8;
+ background-image:url(resource?name=check-mark.png);
+ background-position:left;
+ background-repeat:no-repeat;
+}
+
+.mtmultiselect ul li {
+ display:inline;
+}
+
+.disabled {
+ color:#ccc;
+}
+
+.mtms_filterbox {
+ float:left;
+ padding:5px;
+}
+
+.mtms_filterbox input {
+ background:#FFF;
+ border:1px solid #141212;
+}
+
+.mtms_filtercontrols {
+ color:#B4A6A6;
+ padding:7px 0;
+}
+
+.mtms_filtercontrols a,.mtms_paginator a,.mtms_filterlabel {
+ color:#8C8CD9;
+ padding:0 4px 0 6px;
+}
+
+.mtms_paginator {
+ clear:both;
+ padding:5px;
+}
+
+.mtmultiselect ol {
+ padding:0;
+}
+
+.mtmultiselect ol li {
+ list-style-type:none;
+ background-color:#FFF;
+ color:#000;
+ padding:1px 5px 1px 25px;
+}
+
+.mtmultiselect ol li:hover {
+ background-color:#84D1E0;
+ color:#111;
+}
ul.autocompleter-choices
{
12 years, 8 months
r4919 - trunk/sage/python/sage/wallaby
by croberts@fedoraproject.org
Author: croberts
Date: 2011-08-11 15:06:46 +0000 (Thu, 11 Aug 2011)
New Revision: 4919
Modified:
trunk/sage/python/sage/wallaby/wallabyoperations.py
Log:
Removing parens from definition of the WBTypes class. The empty parens don't seem to play well in python 2.4.
Modified: trunk/sage/python/sage/wallaby/wallabyoperations.py
===================================================================
--- trunk/sage/python/sage/wallaby/wallabyoperations.py 2011-08-10 20:57:40 UTC (rev 4918)
+++ trunk/sage/python/sage/wallaby/wallabyoperations.py 2011-08-11 15:06:46 UTC (rev 4919)
@@ -17,7 +17,7 @@
log = logging.getLogger("sage.wallaby")
-class WBTypes():
+class WBTypes:
'''
Wrap symbolic names for data items tracked by WallabyOperations.
May be helpful in avoiding typos, good for interpreter help
12 years, 8 months
r4918 - trunk/cumin/python/cumin/grid
by croberts@fedoraproject.org
Author: croberts
Date: 2011-08-10 20:57:40 +0000 (Wed, 10 Aug 2011)
New Revision: 4918
Modified:
trunk/cumin/python/cumin/grid/tags.py
trunk/cumin/python/cumin/grid/tags.strings
Log:
Fixing-up labels for consistency and alignment
Modified: trunk/cumin/python/cumin/grid/tags.py
===================================================================
--- trunk/cumin/python/cumin/grid/tags.py 2011-08-10 20:32:16 UTC (rev 4917)
+++ trunk/cumin/python/cumin/grid/tags.py 2011-08-10 20:57:40 UTC (rev 4918)
@@ -230,6 +230,9 @@
def render_header_content(self, session):
return "Last checkin"
+
+ def render_text_align(self, session):
+ return "right"
class TagsColumn(ObjectTableColumn):
def render_cell_content(self, session, data):
@@ -664,7 +667,7 @@
return items
def render_title(self, session):
- return "Tags"
+ return "Nodes"
class NodeName(StringField):
def __init__(self, app, name):
@@ -688,7 +691,7 @@
return value
def render_title(self, session):
- return "Current nodes:"
+ return "Current nodes"
class DisabledInput(StringInput):
pass
@@ -701,7 +704,7 @@
self.replace_child(self.input)
def render_title(self, session):
- return "Tag:"
+ return "Tag"
def get(self,session):
value = self.input.get(session)
Modified: trunk/cumin/python/cumin/grid/tags.strings
===================================================================
--- trunk/cumin/python/cumin/grid/tags.strings 2011-08-10 20:32:16 UTC (rev 4917)
+++ trunk/cumin/python/cumin/grid/tags.strings 2011-08-10 20:57:40 UTC (rev 4918)
@@ -104,7 +104,7 @@
//]]>
</script>
<tr>
- <th><div class="title">Nodes:</div></th>
+ <th><div class="title">{title}</div></th>
<td>
<div style='width:250px;height:375px;'>
<select class='multiselect' name="{id}.inputs.param" multiple="multiple" id="{id}.inputs.param" size="10" style="width:400px">
12 years, 8 months
r4917 - trunk/cumin/python/cumin/grid
by croberts@fedoraproject.org
Author: croberts
Date: 2011-08-10 20:32:16 +0000 (Wed, 10 Aug 2011)
New Revision: 4917
Modified:
trunk/cumin/python/cumin/grid/tags.py
trunk/cumin/python/cumin/grid/tags.strings
Log:
More adjustments to the tagging forms. Now truncating the display of multiple input nodes or tags and using the MTMSelect widget for all of the "large select box" operations.
Modified: trunk/cumin/python/cumin/grid/tags.py
===================================================================
--- trunk/cumin/python/cumin/grid/tags.py 2011-08-10 15:42:25 UTC (rev 4916)
+++ trunk/cumin/python/cumin/grid/tags.py 2011-08-10 20:32:16 UTC (rev 4917)
@@ -497,7 +497,8 @@
def __init__(self, app, name):
item_parameter = SymbolParameter(app, "tag")
super(EditNodeTagsForm.TagsList, self).__init__(app, name, item_parameter)
- self._tmpl = WidgetTemplate(self, "double_filtered_select_html")
+ #self._tmpl = WidgetTemplate(self, "double_filtered_select_html")
+ self._tmpl = WidgetTemplate(self, "filtered_select_html")
self.update_enabled = False
@@ -510,8 +511,14 @@
items = self.do_get_items(session)
tags_string = ""
+ given_node = self.form.node_name.input.param.get(session)
+ selected_tags = self.app.wallaby.get_tag_names(given_node)
+
for i, tag in enumerate(items):
- tags_string = tags_string + "<option id='" + str(i) + "'>" + tag.title + "</option>\n"
+ selected = ""
+ if(selected_tags and tag.title in selected_tags):
+ selected = " selected='selected' "
+ tags_string = tags_string + "<option id='" + str(i) + "'" + selected + ">" + tag.title + "</option>\n"
return tags_string
@@ -541,7 +548,7 @@
return items
def render_title(self, session):
- return "Update tags:"
+ return "Update tags"
class NodeName(StringField):
def __init__(self, app, name):
@@ -572,7 +579,15 @@
def get(self,session):
value = self.input.get(session)
+ if not value or value == "":
+ value = "No tagss currently selected"
return value
+
+ def render_inputs(self, session, *args):
+ value = self.input.get(session)
+ if(len(value) > 50):
+ value = value[:50] + "..." #indicate truncated value
+ return value
class DisabledInput(StringInput):
pass
@@ -660,10 +675,18 @@
def get(self,session):
value = self.input.get(session)
+
if not value or value == "":
value = "No nodes currently selected"
+
return value
+ def render_inputs(self, session, *args):
+ value = self.input.get(session)
+ if(len(value) > 50):
+ value = value[:50] + "..." #indicate truncated value
+ return value
+
def render_title(self, session):
return "Current nodes:"
Modified: trunk/cumin/python/cumin/grid/tags.strings
===================================================================
--- trunk/cumin/python/cumin/grid/tags.strings 2011-08-10 15:42:25 UTC (rev 4916)
+++ trunk/cumin/python/cumin/grid/tags.strings 2011-08-10 20:32:16 UTC (rev 4917)
@@ -145,9 +145,6 @@
-
-
-
[TagsList.double_filtered_select_html]
<script type="text/javascript">
//<![CDATA[
12 years, 8 months
r4916 - branches/clarity/mint/python/mint
by croberts@fedoraproject.org
Author: croberts
Date: 2011-08-10 15:42:25 +0000 (Wed, 10 Aug 2011)
New Revision: 4916
Modified:
branches/clarity/mint/python/mint/session.py
Log:
Addressing BZ 728960 by suppressing the "username/password" portion of the broker URI. It will still show the host and port in the log entry. Source pulled to clarity branch from trunk.
Modified: branches/clarity/mint/python/mint/session.py
===================================================================
--- branches/clarity/mint/python/mint/session.py 2011-08-10 15:41:37 UTC (rev 4915)
+++ branches/clarity/mint/python/mint/session.py 2011-08-10 15:42:25 UTC (rev 4916)
@@ -93,7 +93,8 @@
self.qmf_session.delBroker(qmf_broker)
def __repr__(self):
- return "%s(%s)" % (self.__class__.__name__, self.broker_uris)
+ uris_without_password = [x[x.rfind("@")+1:] for x in self.broker_uris]
+ return "%s(%s)" % (self.__class__.__name__, uris_without_password)
class MintConsole(Console):
def __init__(self, model):
12 years, 8 months
r4915 - trunk/mint/python/mint
by croberts@fedoraproject.org
Author: croberts
Date: 2011-08-10 15:41:37 +0000 (Wed, 10 Aug 2011)
New Revision: 4915
Modified:
trunk/mint/python/mint/session.py
Log:
Addressing BZ 728960 by suppressing the "username/password" portion of the broker URI. It will still show the host and port in the log entry.
Modified: trunk/mint/python/mint/session.py
===================================================================
--- trunk/mint/python/mint/session.py 2011-08-09 21:21:51 UTC (rev 4914)
+++ trunk/mint/python/mint/session.py 2011-08-10 15:41:37 UTC (rev 4915)
@@ -93,7 +93,8 @@
self.qmf_session.delBroker(qmf_broker)
def __repr__(self):
- return "%s(%s)" % (self.__class__.__name__, self.broker_uris)
+ uris_without_password = [x[x.rfind("@")+1:] for x in self.broker_uris]
+ return "%s(%s)" % (self.__class__.__name__, uris_without_password)
class MintConsole(Console):
def __init__(self, model):
12 years, 8 months
r4914 - trunk/cumin/python/cumin/grid
by croberts@fedoraproject.org
Author: croberts
Date: 2011-08-09 21:21:51 +0000 (Tue, 09 Aug 2011)
New Revision: 4914
Modified:
trunk/cumin/python/cumin/grid/tags.py
Log:
Truncate the tags column of the node inventory at 50 characters.
Modified: trunk/cumin/python/cumin/grid/tags.py
===================================================================
--- trunk/cumin/python/cumin/grid/tags.py 2011-08-08 20:42:48 UTC (rev 4913)
+++ trunk/cumin/python/cumin/grid/tags.py 2011-08-09 21:21:51 UTC (rev 4914)
@@ -239,7 +239,10 @@
for tag in tags_list:
tags = tags + "," + str(tag)
tags = tags[1:]
- return tags
+ retval = len(tags) > 0 and tags or ""
+ if(len(tags) > 50):
+ retval = tags[:50] + "..." #indicate that we truncated the name
+ return retval
class NodeColumn(ObjectTableColumn):
def render_cell_content(self, session, data):
12 years, 9 months