Пример #1
0
 def render(self):
     a = cilib.a('return to board', url='./')
     cilib.ciprint(
         title = 'Log Archive',
         subtitle = (n,'--->',a),
         content = cilib.table(self.rows)(**{'class':'smaller'}),
     )
Пример #2
0
 def render(self):
     log = (self.log_line(l) for l in self.data)
     d = zip(map(cilib.number, xrange(1,len(self.data)+1)), log)
     numbered_log = cilib.table(d)(**{'class':'log'})
     lnk = cilib.a('return to Log List', url='./list')
     cilib.ciprint(
         title = 'Log : "%s"' % self.log_name ,
         subtitle = ('\n--->', lnk),
         pymark = '/images/py.gif',
         bar = 'shallow',
         content = numbered_log,
     )
Пример #3
0
 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();',
     )
Пример #4
0
Файл: yaml.py Проект: kt3k/cilib
    if s and file:
        raise Exception('cilib.util.parse : ambiguous call')
    elif file:
        return compose(tokenize(open(file)))
    else:
        if isinstance(s, str):
            return compose(tokenize(s.strip().split('\n')))
        else:
            return compose(tokenize(s))

if __name__ == '__main__':
    import user
    from cilib import ciprint
    from pprint import pformat

    source = '../../index.yml'
    text = open(source).read()
    l = list(tokenize(open(source)))
    tokens = '\n'.join(str(x)for x in l)
    sep1 = '\n\n     vvv tokenize vvv\n\n\n'
    sep2 = '\n\n\n     vvv compose vvv\n\n\n'
    text += sep1 + tokens + sep2 + pformat(parse(open(source)))

    ciprint(
        text = text,
        title = 'yaml.py',
        subtitle = '- nothing -',
        separate = True,
        css = '/css/cross',
    )
Пример #5
0
#! /usr/bin/env python

import cgitb;cgitb.enable()
import os
import cgi
import pprint
import cookielib
#import session

class SuperGlobals(object):
    def __init__(self):
        self.method = os.environ['REQUEST_METHOD']
        self.server = os.environ
        arg = {}
        f = cgi.FieldStorage()
        for k in f:
            arg[k] = f.getfirst(k)
        self.arg = arg
        self.f = f

G = SuperGlobals


if __name__ == '__main__':
    g = G()
    import user
    import cilib
    cilib.ciprint(
        text = str(g.arg),
    )
Пример #6
0
Файл: chip.py Проект: kt3k/cilib
    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',
    )