# -*- coding: utf-8 -*- import os import re import calendar import pytz import time from time import strptime from trac.util.datefmt import localtz from datetime import datetime from calendar import month_name from trac.core import * from trac.perm import IPermissionRequestor from trac.config import Option, ListOption from trac.web.chrome import INavigationContributor, ITemplateProvider, \ add_stylesheet, add_script from trac.web.main import IRequestHandler from trac.util.html import escape, html, Markup from trac.util.text import to_unicode from trac.util.datefmt import utc from pyndexter import Framework, READWRITE from pyndexter.util import quote from genshi.builder import tag class IrcLogsView(Component): implements(INavigationContributor, ITemplateProvider, IRequestHandler, \ IPermissionRequestor) _url_re = re.compile(r'^/irclogs(/(?P\d{4})(/(?P\d{2})' r'(/(?P\d{2}))?)?)?(/(?Pfeed)(/(?P\d+?))?)?/?$') # TODO: make the line format somewhat configurable # Uncomment the following line if using a pipe as a divider and a space # between the date adn time. Make sure to comment out the existing # _line_re. # _line_re = re.compile('%s %s \| (%s)$' % ( _line_re = re.compile('%sT%s (%s)$' % ( r'(?P\d{4}-\d{2}-\d{2})', r'(?P