Esempio n. 1
0
File: app.py Progetto: kt3k/cilib
        tm = chip.stamp(tm)
    else:
        tm = chip.stamp(tm).format('%Y/%m/%d')
    return mark, a, tm, ln, sz

def ls(dir):
    if '..' in dir:
        print 'Location: http://cutter.ivory.ne.jp/ls\n\n'
    if not os.path.exists('./' + dir):
        print 'Location: http://cutter.ivory.ne.jp/ls\n\n'
    lst = os.listdir('./' + dir)
    if dir and not dir.endswith('/'):
        dir += '/'
    lst.sort()
    filter = open('ok.dat').read().split()
    if not dir or dir == './':
        lst = [x for x in lst if not x in filter]
    else:
        lst = ['..'] + [x for x in lst if not x in filter]
    return list(item(l, dir) for l in lst)

def lt(dir=''):
    head = [''] + map(chip.spanmint, ('filename', 'last modified', 'lines', 'size'))
    return chip.table([head]+ls(dir))(**{'class':'smaller'})

if __name__ == '__main__':
    import ppage
    ppage.ciprint(
        title = 'app.py',
    )
Esempio n. 2
0
File: frame.py Progetto: kt3k/cilib
        return xx

class signature(lamone):
    def __init__(self):
        br = EL('br')
        basmala = div('\nبسم الله الرحمن الرحيم')
        sakura = a('sakura internet', url='http://www.sakura.ne.jp/')
        python = a('python', url='http://www.python.org/')
        kt3k = a('kt3k', url='http://kt3k.org/')
        image_licenses = a('about image licenses', url='/images/')
        stmp = time_stamp(bracket_style=('"','" JST'))
        self.lamone = div('''
%(br)s%(basmala)s
%(br)s%(stmp)s%(br)s
%(br)s
hosted by%(sakura)s%(br)s
powered by%(python)s%(br)s
%(br)s
Copyright (C) 2005-2012%(kt3k)s
some rights reserved.%(br)s
%(br)s''' % locals())['footer']

if __name__ == '__main__':
    import ppage

    ppage.ciprint(
        title = 'frame.py',
        text = open('frame.py').read(),
        css = '/css/vanfog',
    )
Esempio n. 3
0
File: lamone.py Progetto: kt3k/cilib
        else:
            return self.TP + self.start_label() + self.indented() + self.end_label()
    def __getitem__(self, x):
        if not isinstance(x, str):
            raise TypeError('class name must be str, not %s'%type(x))
        else:
            self.attrs['class'] = x
            return self
    def __call__(self, *v, **a):
        if v:
            self.extend(*v)
        if a:
            self.modify(**a)
        return self
    def __nonzero__(self):
        return (self.name or self.stack) and 1 or 0
    def nohead(self):
        self.TP = ''

EL = Lamone

if __name__ == '__main__':
    from ppage import ciprint

    ciprint(
        separate = True,
        title = 'lamone.py',
        css = '/css/cross',
        text = open('lamone.py').read(),
    )