[Hepserver-commits] hep/hep/web messages.py,1.1,1.2
Status: Alpha
Brought to you by:
abefettig
|
From: <abe...@us...> - 2003-08-07 03:29:38
|
Update of /cvsroot/hepserver/hep/hep/web
In directory sc8-pr-cvs1:/tmp/cvs-serv15283/hep/web
Modified Files:
messages.py
Log Message:
use new message API with dict-like interface
for headers (still in flux).
Index: messages.py
===================================================================
RCS file: /cvsroot/hepserver/hep/hep/web/messages.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** messages.py 10 Jul 2003 16:09:36 -0000 1.1
--- messages.py 7 Aug 2003 03:29:35 -0000 1.2
***************
*** 58,62 ****
else:
td.text(str(curDay))
- print "DONE GENERATING CALENDAR"
--- 58,61 ----
***************
*** 67,95 ****
div['class'] = 'message'
head = div.div(_class='messageHeader')
! if message.link:
! head.h4().a(href=message.link).text(message.title)
else:
! head.h4().text(message.title)
- if 0: #for header in ('author', 'to', 'link'):
- headerValue = getattr(message, header, '')
- if headerValue:
- head.strong().text(header.capitalize())
- head.text(": ")
- if header == 'link':
- head.a(href=headerValue).text(headerValue)
- elif header == 'author':
- fromText = headerValue.address and headerValue or headerValue.name
- head.text(headerValue.name)
- else:
- head.text(headerValue)
- head.br()
head.br()
div.text(message.getHTML(bodyOnly=1, safeTagsOnly=1) or "", raw=1)
div.div(_class='timestamp').small().text("%s, %s" % (
! message.author.address and message.author or message.author.name,
! time.strftime('%I:%M %p', message.timestamp)))
!
! print "DONE GENERATING MESSAGE"
class BlogView(view.View):
--- 66,79 ----
div['class'] = 'message'
head = div.div(_class='messageHeader')
! if message.get('link'):
! head.h4().a(href=message['link']).text(message['title'])
else:
! head.h4().text(message['title'])
head.br()
div.text(message.getHTML(bodyOnly=1, safeTagsOnly=1) or "", raw=1)
div.div(_class='timestamp').small().text("%s, %s" % (
! message['author'].address and message['author'] or message['author'].name,
! time.strftime('%I:%M %p', message.getTimestamp())))
class BlogView(view.View):
***************
*** 134,139 ****
item = list.li()
! a = item.a(href="/messages//" + storePath)
! if "/".join(request.postpath[:-1]) == storePath[1:]:
a['class'] = 'selected'
a.img(src='/images/icons/small/%s.png' % store.url.protocol, align='absmiddle')
--- 118,123 ----
item = list.li()
! a = item.a(href='/'.join(['/messages', '', storePath, '']))
! if '/'.join(request.postpath).strip('/') == storePath.strip('/'):
a['class'] = 'selected'
a.img(src='/images/icons/small/%s.png' % store.url.protocol, align='absmiddle')
|