Author: eallen
Date: 2008-10-20 10:53:58 -0400 (Mon, 20 Oct 2008)
New Revision: 2659
Modified:
mgmt/trunk/cumin/python/cumin/formats.py
mgmt/trunk/cumin/python/cumin/job.py
mgmt/trunk/cumin/python/cumin/model.py
Log:
Show a few characters at the end of the shortened job group names
Modified: mgmt/trunk/cumin/python/cumin/formats.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/formats.py 2008-10-18 02:33:01 UTC (rev 2658)
+++ mgmt/trunk/cumin/python/cumin/formats.py 2008-10-20 14:53:58 UTC (rev 2659)
@@ -123,12 +123,12 @@
(id and "id=\"%s\"" % id or "", href, class_ and
" class=\"%s\" " % class_ or " ",
link_title and "title=\"%s\"" % link_title or
"", content)
-def fmt_olink(session, object, selected=False, name=None):
+def fmt_olink(session, object, selected=False, name=None, pre=16, post=0):
if name is None:
name = getattr(object, "name", fmt_none())
# don't shorten None since it will result in
# invalid xml
elif isinstance(name, basestring):
- name = fmt_shorten(name)
+ name = fmt_shorten(name, pre, post)
return fmt_link(session.marshal(), name, selected and "selected")
Modified: mgmt/trunk/cumin/python/cumin/job.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/job.py 2008-10-18 02:33:01 UTC (rev 2658)
+++ mgmt/trunk/cumin/python/cumin/job.py 2008-10-20 14:53:58 UTC (rev 2659)
@@ -108,8 +108,7 @@
if job_group:
branch = session.branch()
self.frame.show_job_group(branch, job_group).show_view(branch)
- name = fmt_shorten(data[self.name])
- return fmt_olink(branch, job_group, name=name)
+ return fmt_olink(branch, job_group, name=data[self.name], pre=12,
post=3)
class CustomIdColumn(SqlTableColumn):
def render_title(self, session, data):
@@ -120,7 +119,7 @@
if data[self.name]:
branch = session.branch()
self.frame.show_job(branch, job).show_view(branch)
- return fmt_olink(branch, job, name=data[self.name])
+ return fmt_olink(branch, job, name=data[self.name], pre=12, post=3)
else:
return data[self.name] # none
@@ -139,7 +138,7 @@
#if job:
branch = session.branch()
self.frame.show_job(branch, job).show_view(branch)
- return fmt_olink(branch, job, name=data[self.name])
+ return fmt_olink(branch, job, name=data[self.name], pre=12, post=3)
else:
return data[self.name] # none
@@ -164,8 +163,7 @@
if data["submitter"]:
branch = session.branch()
self.frame.show_submitter(branch, submitter).show_view(branch)
- name = fmt_shorten(data["submitter"])
- return fmt_olink(branch, submitter, name=name)
+ return fmt_olink(branch, submitter, name=data[self.name])
else:
return data["submitter"]
@@ -178,8 +176,7 @@
if data["scheduler"]:
branch = session.branch()
self.frame.show_scheduler(branch, scheduler).show_view(branch)
- name = fmt_shorten(data["scheduler"])
- return fmt_olink(branch, scheduler, name=name)
+ return fmt_olink(branch, scheduler, name=data[self.name])
else:
return data["scheduler"]
Modified: mgmt/trunk/cumin/python/cumin/model.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/model.py 2008-10-18 02:33:01 UTC (rev 2658)
+++ mgmt/trunk/cumin/python/cumin/model.py 2008-10-20 14:53:58 UTC (rev 2659)
@@ -1914,7 +1914,7 @@
try:
group = JobGroup(job.CustomGroup)
frame.show_job_group(branch, group)
- return fmt_olink(branch, group, name=group.get_id())
+ return fmt_olink(branch, group, name=group.get_id(), pre=12, post=3)
except Exception, e:
return "Unavailable"