def twice_log_line(l): name, time, topic, comment = l if topic: col = ColorTable[topic%len(ColorTable)] else: col = 'black' a = cilib.span(name, style='color:'+col) b = cilib.span(str(topic), style='color:'+col) c = cilib.span(comment, style='color:'+col) d = cilib.stamp(time)(*'[]').format('%Y/%m/%d(%a) %X') return cilib.p(a, ' > ', b,' > ', c, d)
def __init__(self, seconds=0, bracket_style='[]', format='%Y/%m/%d %X'): if seconds: self.time = time.localtime(seconds) else: self.time = time.localtime() L, R = bracket_style self.lamone = span()['stamp'] self.lamone(time.strftime(L+format+R, self.time))
def __init__(self, seconds=0): self.L = '( ' self.R = ' )' self.FORMAT = '%Y/%m/%d %X' if seconds: self.time = time.localtime(seconds) else: self.time = time.localtime() self.lamone = span()['stamp']
def render(self): ciform = cilib.frog_box(action = './', value = 'submit', mode = self.textmode, onclick = 'setcookie();', line = self.line) lnk = cilib.a('Log List', url='./list') cilib.ciprint( title = self.TITLE, subtitle = cilib.span('\n--->', lnk), js = '/js/frog', pymark = '/images/py.gif', bar = 'shallow', content = (twice_log_line(l) for l in self.data[-self.line:]), postcontent = (cilib.div(cilib.hr()), ciform), onload = 'getcookie();', )
def thread_row(d): name = d.name start = d.start end = d.end anno = d.annotation lines = d.lines rel = d.related or '-' lfmt = '%Y/%m/%d' + recent(end)*' %X' sfmt = '%Y/%m/%d' + recent(start)*' %X' if anno: anno = cilib.spangray(' - ' + anno) mark = cilib.a(diskmark, url='browse?'+str(name)) sp = cilib.span(cilib.a(name, url='browse?'+str(name)),n, anno) return ( mark, sp, cilib.stamp(start).format(sfmt), cilib.stamp(end).format(lfmt), lines, rel, )
for m, x in enumerate(v): b.append(x) if m%n == n-1: yield b b = [] if b: b += [d] * (n - len(b)) yield b def fold_(v, n, d=''): pass if __name__ == '__main__': from cilib import ciprint from cilib import span from random import randrange, choice as c a = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" st = 'background:#%03x;font-family:terminal;padding:0px;margin:0px;' content = [ [span(c(a)+c(a)+c(a))(style=st%(randrange(16**3))) for x in range(19)] for y in range(57)] ciprint( title = 'chip.py', content = table(content)(cellspacing=0)(cellpadding=0)['test'], separate = True, css = '/css/basic2', )
def shirakawa_archive_log_line(l): name, time, col, comment = l a = cilib.span(name, style='color:'+col) b = cilib.span(comment, style='color:'+col) c = cilib.stamp(time)(*'[]').format('%Y/%m%d(%a) %X') return cilib.p(a, ' > ', b, c)