예제 #1
0
def get(useSkeleton, channels):
    output = content
    if len(channels) == 0:
        output %= _('Stats available for no channels')
    elif len(channels) == 1:
        output %= _('Stats available for a channel:')
    elif len(channels):
        output %= _('Stats available for channels:')
    output += '<ul class="chanslist">'
    for channel in channels:
        output += '<li><a href="/global/%s/" title="%s">%s</a></li>' % (
                  channel[1:].replace('#', ' '), # Strip the leading #
                  _('View the stats for the %s channel') % channel,
                  channel)
    output += '</ul>'
    if useSkeleton:
        output = ''.join([skeleton.start, output, skeleton.end])
    return output
예제 #2
0
def get(useSkeleton, channels):
    output = content
    if len(channels) == 0:
        output %= _('Stats available for no channels')
    elif len(channels) == 1:
        output %= _('Stats available for a channel:')
    elif len(channels):
        output %= _('Stats available for channels:')
    output += '<ul class="chanslist">'
    for channel in channels:
        output += '<li><a href="/webstats/global/%s/" title="%s">%s</a></li>'%\
                  (channel[1:].replace('#', ' '), # Strip the leading #
                  _('View the stats for the %s channel') % channel,
                  channel)
    output += '</ul>'
    if useSkeleton:
        output = ''.join([skeleton.start, output, skeleton.end])
    return output
예제 #3
0
        index, row = row
        output += '<tr><td>%s</td>' % index
        for cell in (progressbar(row[0],
                                 max_[0]), progressbar(row[1], max_[1]),
                     progressbar(row[3],
                                 max_[3]), progressbar(row[4], max_[4]),
                     progressbar(row[5],
                                 max_[5]), progressbar(row[6], max_[6]),
                     progressbar(row[7],
                                 max_[7]), progressbar(row[8], max_[8])):
            output += cell
        output += '</tr>'
    return output, nbDisplayed


headers = (_('Lines'), _('Words'), _('Joins'), _('Parts'), _('Quits'),
           _('Nick changes'), _('Kicks'), _('Kicked'))
tableHeaders = '<table><tr><th><a href="%s">%s</a></th>'
for header in headers:
    tableHeaders += '<th style="width: 150px;"><a href="%%s%s/">%s</a></th>' %\
                    (header, header)
tableHeaders += '</tr>'

nameToColumnIndex = {
    _('lines'): 0,
    _('words'): 1,
    _('chars'): 2,
    _('joins'): 3,
    _('parts'): 4,
    _('quits'): 5,
    _('nick changes'): 6,
예제 #4
0
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" >
    <head>
        <title>Supybot WebStats</title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <link rel="stylesheet" media="screen" type="text/css" title="Design" href="/webstats/design.css" />
    </head>
    <body>
        <p id="header">
            WebStats
        </p>
        <ul id="menu">
            <li><a href="/webstats/" title="%s">%s</a></li>
            <li><a href="/webstats/%s/" title="%s">%s</a></li>
        </ul>
""" % (
    _("Come back to the root page"),
    _("Home"),
    _("about"),
    _("Get more informations about this website"),
    _("About"),
)

end = """
        <p id="footer">
            <a href="http://supybot.com">Supybot</a> and
            <a href="https://github.com/ProgVal/Supybot-plugins/tree/master/WebStats/">WebStats</a> powered.<br />
            Libre software available under BSD licence.<br />
            Page generated at %s.
        </p>
    </body>
</html>""" % (
예제 #5
0
start = \
"""<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" >
    <head>
        <title>Supybot WebStats</title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <link rel="stylesheet" media="screen" type="text/css" title="Design" href="/design.css" />
    </head>
    <body>
        <p id="header">
            WebStats
        </p>
        <ul id="menu">
            <li><a href="/" title="%s">%s</a></li>
            <li><a href="/%s/" title="%s">%s</a></li>
        </ul>
""" % (_('Come back to the root page'), _('Home'),
       _('about'), _('Get more informations about this website'), _('About'))

end = \
"""
        <p id="footer">
            <a href="http://supybot.com">Supybot</a> and
            <a href="http://supybot-fr.tk/WebStats">WebStats</a> powered.<br />
            Libre software available under BSD licence.<br />
            Page generated at %s.
        </p>
    </body>
</html>""" % (time.strftime('%H:%M:%S'))
예제 #6
0
        index, row = row
        output += '<tr><td>%s</td>' % index
        for cell in (progressbar(row[0], max_[0]),
                     progressbar(row[1], max_[1]),
                     progressbar(row[3], max_[3]),
                     progressbar(row[4], max_[4]),
                     progressbar(row[5], max_[5]),
                     progressbar(row[6], max_[6]),
                     progressbar(row[7], max_[7]),
                     progressbar(row[8], max_[8])
                     ):
            output += cell
        output += '</tr>'
    return output, nbDisplayed

headers = (_('Lines'), _('Words'), _('Joins'), _('Parts'),
           _('Quits'), _('Nick changes'), _('Kicks'), _('Kicked'))
tableHeaders = '<table><tr><th><a href="%s">%s</a></th>'
for header in headers:
    tableHeaders += '<th style="width: 150px;"><a href="%%s%s/">%s</a></th>' %\
                    (header, header)
tableHeaders += '</tr>'

nameToColumnIndex = {_('lines'):0,_('words'):1,_('chars'):2,_('joins'):3,
                     _('parts'):4,_('quits'):5,_('nick changes'):6,_('kickers'):7,
                     _('kicked'):8,_('kicks'):7}
def getTable(firstColumn, items, channel, urlLevel, page, orderby):
    percentParameter = tuple()
    for foo in range(1, len(tableHeaders.split('%s'))-1):
        percentParameter += ('./' + '../'*(urlLevel-4),)
        if len(percentParameter) == 1: