예제 #1
0
파일: frame.py 프로젝트: kt3k/cilib
 def make(self):
     import os
     scr = os.environ['SCRIPT_FILENAME']
     scr = scr[scr.find(RA_S)+len(RA_S):]
     pymark = img(src=self.icon, alt='source').nohead()
     navigate = (
         ('HOME', self.home),
         (pymark, '/cat?'+scr),
         ('lineBBS', '/shirakawa_st/'),
         ('mandarin', '/_mandarin/'),
         ('crm', '/betto-cho/'),
         ('css tank', '/css/'),
         ('image tank', '/images/'),
         ('a-box', '/a-box/test.py'),
         ('site map', '/sitemap.py'),
         ('mandarin forge', '/_mandarin/?forge'),
         ('crm forge', '/betto-cho/?forge'),
         ('Twice Board', '/twice/'),
         ('連絡BBS', '/ren/'),
         ('shallow','/shallow'),
         ('',''),
     )
     navigate = [navigate[i] for i in self.rule]
     for i, j in navigate:
         self.nav.additem(i, j)
예제 #2
0
파일: app.py 프로젝트: kt3k/cilib
#! /usr/bin/env python

import os
import sys
import time
import chip

now = int(time.time())

def recent(second):
    return abs(now - second) < 172800

xmark = chip.img(src = '/images/silkapp')
pymark = chip.img(src = '/images/py.gif')
dirmark = chip.img(src = '/images/silkfolder')
textmark = chip.img(src = '/images/silktext')
picmark = chip.img(src = '/images/silkimg')

def item(l, dir):
    suf = l.endswith
    st = os.stat(dir+l)
    sz = st.st_size
    if suf('.py'):
        a = chip.a(l,url='/cat?' + dir+l)
        mark = chip.a(pymark, dir+l)
        ln = len(map(lambda x:1,open(dir+l)))
    elif suf('.pyc'):
        a = chip.spangray(l)
        mark = ''
        ln = ''
    elif filter(suf,('.cgi','.ml','.scm')):