|
|
|
|
@ -3,25 +3,24 @@ |
|
|
|
|
import os,os.path, sys |
|
|
|
|
import urllib, cgi |
|
|
|
|
|
|
|
|
|
import cgitb |
|
|
|
|
cgitb.enable() |
|
|
|
|
form = cgi.FieldStorage() |
|
|
|
|
|
|
|
|
|
from datetime import datetime |
|
|
|
|
|
|
|
|
|
from pylog_action import * |
|
|
|
|
import pylog_config as cfg |
|
|
|
|
|
|
|
|
|
form = {} |
|
|
|
|
def init(): |
|
|
|
|
global form |
|
|
|
|
import cgitb |
|
|
|
|
cgitb.enable() |
|
|
|
|
form = cgi.FieldStorage() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print 'Content-type: text/html\n\n' |
|
|
|
|
|
|
|
|
|
def header(): |
|
|
|
|
print '<head>' |
|
|
|
|
print '<title>'+cfg.title+'</title>' |
|
|
|
|
print '<h1>'+cfg.blogtitle+'</h1>' |
|
|
|
|
print '<h2>'+cfg.subtitle+'</h2>' |
|
|
|
|
print '<h1 id="blogtitle">'+cfg.blogtitle+'</h1>' |
|
|
|
|
print '<h2 id="subtitle">'+cfg.subtitle+'</h2>' |
|
|
|
|
print cfg.header |
|
|
|
|
print '</head>' |
|
|
|
|
|
|
|
|
|
@ -93,12 +92,12 @@ def disp_list(path): |
|
|
|
|
typ = '' |
|
|
|
|
name = os.path.basename(f) |
|
|
|
|
if typ in prev_actions and not os.path.isdir(f): |
|
|
|
|
sys.stdout.write('<h3><a class="entryheader" href="'+script+'?') |
|
|
|
|
sys.stdout.write('<h1><a class="entryheader" href="'+script+'?') |
|
|
|
|
sys.stdout.write(urllib.urlencode({'path': os.path.normpath(os.path.dirname(f)), \ |
|
|
|
|
'disp':os.path.normpath(f)})+'">') |
|
|
|
|
print name+'</a> - <span class="entrydate">', |
|
|
|
|
print datetime.fromtimestamp(int(k)).strftime(cfg.datefmt), |
|
|
|
|
print '</span></h3>' |
|
|
|
|
print '</span></h1>' |
|
|
|
|
prev_actions[typ](f) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -111,7 +110,6 @@ def get_valid_path(path): |
|
|
|
|
return cfg.contentdir |
|
|
|
|
return os.path.normpath(path) |
|
|
|
|
|
|
|
|
|
init() |
|
|
|
|
path = cfg.contentdir |
|
|
|
|
if 'path' in form: |
|
|
|
|
path=form['path'].value |
|
|
|
|
@ -141,12 +139,12 @@ try: |
|
|
|
|
typ = '' |
|
|
|
|
name = disp |
|
|
|
|
if typ in disp_actions: |
|
|
|
|
sys.stdout.write('<h3><span class="entryheader">') |
|
|
|
|
sys.stdout.write('<h1><span class="entryheader">') |
|
|
|
|
print name+'</span> - <span class="entrydate">', |
|
|
|
|
print datetime.fromtimestamp( \ |
|
|
|
|
int(os.path.getctime(validdisp)) \ |
|
|
|
|
).strftime(cfg.datefmt), |
|
|
|
|
print '</span></h3>' |
|
|
|
|
print '</span></h1>' |
|
|
|
|
|
|
|
|
|
disp_actions[typ](validdisp) |
|
|
|
|
else: |
|
|
|
|
|