Author: eallen
Date: 2008-09-19 10:08:54 -0400 (Fri, 19 Sep 2008)
New Revision: 2498
Modified:
mgmt/trunk/cumin/python/cumin/formats.py
Log:
Added optional argument to display seconds with fmt_datetime
Added optional argument to display title= on a link formated with fmt_link
Modified: mgmt/trunk/cumin/python/cumin/formats.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/formats.py 2008-09-18 17:32:03 UTC (rev 2497)
+++ mgmt/trunk/cumin/python/cumin/formats.py 2008-09-19 14:08:54 UTC (rev 2498)
@@ -6,9 +6,12 @@
def fmt_count(count):
return "<span class=\"count\">(%i)</span>" % count
-def fmt_datetime(dtime):
+def fmt_datetime(dtime, sec=False):
if dtime:
- tstamp = dtime.strftime("%d %b %Y %H:%M")
+ if sec:
+ tstamp = dtime.strftime("%d %b %Y %H:%M:%S")
+ else:
+ tstamp = dtime.strftime("%d %b %Y %H:%M")
else:
tstamp = fmt_none()
@@ -112,9 +115,10 @@
else:
return string
-def fmt_link(href, content, class_="", id=""):
- return "<a %s href=\"%s\"%s>%s</a>" % \
- (id and "id=\"%s\"" % id or "", href, class_ and
" class=\"%s\" " % class_ or " ", content)
+def fmt_link(href, content, class_="", id="",
link_title=""):
+ return "<a %s href=\"%s\"%s%s>%s</a>" % \
+ (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):
if name is None:
Show replies by date