Example #1
0
    def joinMessage(self, message, packages):
        content = []

        branch = XML.digValue(message.xml, str, "message", "source", "branch")
        if branch:
            content.append(Nouvelle.tag('strong')[ self.format_branch(branch.strip()) ])

        for package in packages:
            if content:
                content.append(Nouvelle.tag('br'))
            content.append(package)

        return content
Example #2
0
    def joinMessage(self, message, packages):
        content = []

        branch = XML.digValue(message.xml, str, "message", "source", "branch")
        if branch:
            content.append(Nouvelle.tag('strong')[ self.format_branch(branch.strip()) ])

        for package in packages:
            if content:
                content.append(Nouvelle.tag('br'))
            content.append(package)

        return content
Example #3
0
    def render_dataTable(self, context):
        data = []

        for id in BZFlag.Players.keys():
            player = BZFlag.Players[id]
            data.append([
                id, player.callsign, player.wins - player.losses, player.team
            ])

        return MyTable(data, [
            Nouvelle.IndexedColumn('id', 0),
            Nouvelle.IndexedColumn('callsign', 1),
            Nouvelle.IndexedColumn('score', 2),
            Nouvelle.IndexedColumn('team', 3),
        ],
                       id='players')
Example #4
0
 def render_data(self, context, row):
     path = row[self.index]
     if path:
         return Nouvelle.tag('img', src = '/images/db/' + path,
                             width = row[self.widthIndex],
                             height = row[self.heightIndex])
     else:
         return ()
Example #5
0
 def render_data(self, context, row):
     path = row[self.index]
     if path:
         return Nouvelle.tag('img',
                             src='/images/db/' + path,
                             width=row[self.widthIndex],
                             height=row[self.heightIndex])
     else:
         return ()
Example #6
0
 def format(self, args):
     from LibCIA.Web import Template
     return [
         Nouvelle.tag('p')[ColortextToXHTML.format(self, args), ],
         Template.longError[
             "This message was received in CIA's legacy format, 'colorText'. "
             "To see much more detailed information about each commit, "
             "ask this project's administrators to upgrade their client script."],
     ]
Example #7
0
 def format(self, args):
     return [
         Nouvelle.tag('p')[
             ColortextToXHTML.format(self, args),
         ],
         Template.longError[
             "This message was received in CIA's legacy format, 'colorText'. "
             "To see much more detailed information about each commit, "
             "ask this project's administrators to upgrade their client script."],
         ]
Example #8
0
 def element_color(self, element):
     """Convert the fg and bg attributes, if we have them, to <span> tags"""
     style = ''
     for attr, css in (
         ('fg', 'color'),
         ('bg', 'background'),
         ):
         attrValue = element.getAttributeNS(None, attr)
         if attrValue:
             try:
                 style = "%s%s: %s;" % (style, css, self.colorTable[attrValue])
             except KeyError:
                 pass
     return Nouvelle.tag('span', style=style)[self.element_colorText(element)]
Example #9
0
 def element_color(self, element):
     """Convert the fg and bg attributes, if we have them, to <span> tags"""
     style = ''
     for attr, css in (
         ('fg', 'color'),
         ('bg', 'background'),
     ):
         attrValue = element.getAttributeNS(None, attr)
         if attrValue:
             try:
                 style = "%s%s: %s;" % (style, css,
                                        self.colorTable[attrValue])
             except KeyError:
                 pass
     return Nouvelle.tag('span',
                         style=style)[self.element_colorText(element)]
Example #10
0
class MessageList(Template.Section):
    """A list of messages, with metadata and hyperlinks. Must be
       constructed with a list of Message instances.
       """
    title = "messages"

    columns = [
        MessageDateColumn(),
        MessageProjectColumn(),
        MessageContentColumn(),
        Nouvelle.AttributeColumn('link', 'hyperlink'),
    ]

    def renderMessages(self, context, messages):
        return [
            Template.Table(messages,
                           self.columns,
                           defaultSortReversed=True,
                           id='message'),
        ]
Example #11
0
 def element_u(self, element):
     # We can't use <u> here, it's been deprecated and XHTML
     # strict can't contain it. Just use some inline CSS instead.
     return Nouvelle.tag('span', style="text-decoration: underline;")[
         self.element_colorText(element)]
Example #12
0
 def element_u(self, element):
     # We can't use <u> here, it's been deprecated and XHTML
     # strict can't contain it. Just use some inline CSS instead.
     return Nouvelle.tag('span', style="text-decoration: underline;")[ self.element_colorText(element) ]
Example #13
0
 def element_b(self, element):
     return Nouvelle.tag('b')[ self.element_colorText(element) ]
Example #14
0
 def element_br(self, element):
     return Nouvelle.tag('br')
Example #15
0
 def link_url(self, match):
     url = match.group()
     return Nouvelle.tag('a', href=url)[ url ]
Example #16
0
 def element_br(self, element):
     return Nouvelle.tag('br')
Example #17
0
 def link_url(self, match):
     url = match.group()
     return Nouvelle.tag('a', href=url)[url]
Example #18
0
 def element_b(self, element):
     return Nouvelle.tag('b')[self.element_colorText(element)]