Пример #1
0
  def as_news_item(self):               # As a line in the blotter
    iso_date = time.strftime(config.datetime_format,
                             time.gmtime(calendar.timegm(email.Utils.parsedate(xhtml.unescape(self["date"])))))

    s = str(xhtml.comment("$Id$")) + str(xhtml.span(xhtml.quote(self["subject"]), {"class" : "newstitle"})
                      + xhtml.span(xhtml.quote(iso_date), {"class" : "newsdate"}))

    s = xhtml.h1(s + " ", {"class" : "newsheading"})

    img = ""
    if icon_by_name(self["image"]) != "":
      img = xhtml.image({"src" : config.icon_dir + icon_by_name(self["image"])})
      pass

    s += str(xhtml.div(img + as_para(self["body"]), {"class" : "news"}))

    return (s)
Пример #2
0
def xhtml_init():
  ssi = apache_ssi.processor()
  ssi.document_root = config.DocumentRoot_path
  s = ssi.parse(config.DocumentRoot_path + '/includes/wgo-xhtml-init.xhtml')
  s += xhtml.comment("This document was automatically generated by wgo.py $Revision$ and friends.")
  return (s)