diff --git a/mdx_math.py b/mdx_math.py
index dd10755..70885cc 100644
--- a/mdx_math.py
+++ b/mdx_math.py
@@ -11,7 +11,7 @@ class MathPattern(Pattern):
texcode=m.group(2)
el = markdown.util.etree.Element('img')
- el.attrib["src"]="tex.cgi?"+self.unescape(texcode)
+ el.attrib["src"]="tex.cgi?"+self.unescape(texcode.replace(' ','%20'))
el.attrib["alt"]=self.unescape(texcode)
return el
diff --git a/pylog.py b/pylog.py
index c1de35d..82bdcee 100755
--- a/pylog.py
+++ b/pylog.py
@@ -16,11 +16,9 @@ __version = "v0.1-(2012-03-15)"
def header():
- script = sys.argv[0][sys.argv[0].rindex('/')+1:]
print '
'
+ print ''
print ''+cfg.title+''
- print ''
- print ''+cfg.subtitle+'
'
print cfg.header
print ''
@@ -48,7 +46,7 @@ def file_entry(f,path,depth,hidden):
def process_dirs(path='.',disppath='.',depth=0,hidden=False):
dirlist = os.listdir(path)
if len(dirlist)!=0:
- dir_begin(disppath,hidden)
+ dir_begin(disppath,hidden,depth)
dirs = []
files = []
for f in dirlist:
@@ -70,7 +68,7 @@ def process_dirs(path='.',disppath='.',depth=0,hidden=False):
else:
file_entry(f,disppath,depth,hidden)
- dir_end(disppath,hidden)
+ dir_end(disppath,hidden,depth)
def disp_list(path):
if path==cfg.contentdir:
@@ -105,7 +103,7 @@ def disp_file_dict(d,keys):
if typ in prev_actions and not os.path.isdir(f):
sys.stdout.write(' - ',
print datetime.fromtimestamp(int(k)).strftime(cfg.datefmt),
print '
'
@@ -163,14 +161,16 @@ def get_valid_path(path):
return os.path.normpath(path)
if not 'rss' in form:
- sys.stdout.write('Content-type: text/html\n\n')
+ sys.stdout.write('Content-type: text/html; charset=utf-8\n\n')
else:
import xml.etree.ElementTree as ET
sys.stdout.write('Content-type: text/xml\n\n')
script = sys.argv[0][sys.argv[0].rindex('/')+1:]
files,keys=get_newest(cfg.numofposts)
- tz = str(time.timezone)
+ tz = time.timezone
+ tzHHMM = "%03d%02d" % (tz/3600,abs((tz%3600)/60))
+
print '''
@@ -183,7 +183,7 @@ else:
print " Pylog"+__version+""
if len(keys)>0:
date=datetime.fromtimestamp(int(keys[0])).strftime("%a, %d %b %Y %H:%M:%S ")
- print " "+date+tz+""
+ print " "+date+tzHHMM+""
for k in keys:
date=datetime.fromtimestamp(int(k)).strftime("%a, %d %b %Y %H:%M:%S ")
@@ -207,7 +207,7 @@ else:
print " ",
ET.dump(link)
- print " "+date+tz+""
+ print " "+date+tzHHMM+""
print " "
print ""
@@ -217,16 +217,19 @@ else:
+script = sys.argv[0][sys.argv[0].rindex('/')+1:]
path = cfg.contentdir
if 'path' in form:
path=form['path'].value
path=get_valid_path(path)
+print ''
print ''
header()
print ''
-
+print ''
+print ''+cfg.subtitle+'
'
print ''
diff --git a/pylog_action_impl.py b/pylog_action_impl.py
index 43e52c0..103f864 100644
--- a/pylog_action_impl.py
+++ b/pylog_action_impl.py
@@ -7,20 +7,24 @@ import markdown
from HTMLParser import HTMLParser
-def dir_begin(path,hidden):
+def dir_begin(path,hidden,depth):
+ if depth!=0:
+ print ''
print ''
-def dir_end(path,hidden):
+def dir_end(path,hidden,depth):
print '
'
+ if depth!=0:
+ print ''
def dir_link(name,f,depth,hidden):
script = sys.argv[0][sys.argv[0].rindex('/')+1:]
print ' '
- print ' '
+ print ' '
print ' '
def file_link(name,f,depth,hidden):
script = sys.argv[0][sys.argv[0].rindex('/')+1:]
@@ -28,7 +32,7 @@ def file_link(name,f,depth,hidden):
if hidden:
print ' hidden',
print '">'
- print ' '
+ print ' '
print ' '
def disp_txt(path):
diff --git a/source.css b/source.css
index 9fc9f5b..b04c44e 100644
--- a/source.css
+++ b/source.css
@@ -6,7 +6,6 @@
.Comment { color: #8080ff; }
.sourcecode {
- white-space:wrap;
font-size:10pt;
font-family:monospace;
color:#cccccc;
diff --git a/style.css b/style.css
index 4f2450b..6e8277b 100644
--- a/style.css
+++ b/style.css
@@ -6,8 +6,8 @@ a {
color:#aa6735;
text-decoration:underline;
font-weight:bold;
-a:hover{
}
+a:hover{
text-decoration:none;
}