Major code restructuring. Version is now 0.5, templates use Mako, and the code is split off into several files under lib/
import os.path
def readFile (path) :
fo = open(path, 'r')
data = fo.read()
fo.close()
return data
def readTitleDescr (path) :
"""
Read a title.txt or <imgname>.txt file
"""
if os.path.exists(path) :
content = readFile(path)
if '---' in content :
title, descr = content.split('---', 1)
else :
title, descr = content, ''
return title.strip(), descr.strip()
return "", ""
def url_join (*parts) :
return '/'.join(parts)
from optparse import OptionParser
def optparse (options) :
parser = OptionParser()
parser.add_option