def main(): if os.path.exists(config.content_root): print 'Content directory exists.' return os.makedirs(config.content_root) content = rcstore(fsdb.fsdb(config.content_root, 1)) start = open('start-page.txt').read() syntax_ref = open('markdown-ref.txt').read() start_html = os.popen("./md2html < start-page.txt").read() syntax_html = os.popen("./md2html < markdown-ref.txt").read() metadata = { 'timestamp': datetime.datetime.now(), 'username': '******', 'useremail': 'μWiki' } content.store('Start', start, start_html, metadata) content.store('SyntaxGuide', syntax_ref, syntax_html, metadata) print 'μWiki content successfully initialized.' return
def main(): if os.path.exists(config.content_root): print 'Content directory exists.' return os.makedirs(config.content_root) content = rcstore(fsdb.fsdb(config.content_root, 1)) start = open('start-page.txt').read() syntax_ref = open('markdown-ref.txt').read() start_html = os.popen("./md2html < start-page.txt").read() syntax_html = os.popen("./md2html < markdown-ref.txt").read() metadata = {'timestamp' : datetime.datetime.now(), 'username' : 'μWiki', 'useremail': 'μWiki'} content.store('Start', start, start_html, metadata) content.store('SyntaxGuide', syntax_ref, syntax_html, metadata) print 'μWiki content successfully initialized.' return
template = open(config.data_root + '/local/uWiki.template').read() separator = ' | ' content_type_header = content_type # From utils # For inclusion on editing page helptext = open(config.data_root + '/local/markdown-ref.txt').read() auth.login_banner = HTMLString( '<center><br><br><h1>Welcome to μWiki!</h1><br><br>') import fsdb from rcstore import rcstore, pickle content = rcstore(fsdb.fsdb(config.data_root + '/wikidata/content')) # The URL for static content needs to be computed dynamically because # don't know our application name until we're called. This could and # probably should be cached, but KISS for now. # def spath(): return mpath('/static') def stylesheet(): return Tag('link', rel="stylesheet", type="text/css", href=mpath("/static/uwiki.css")) def init(): try: auth.restore_state() except: pass return
template = open(config.data_root + '/local/uWiki.template').read() separator = ' | ' content_type_header = content_type # From utils # For inclusion on editing page helptext = open(config.data_root + '/local/markdown-ref.txt').read() auth.login_banner = HTMLString( '<center><br><br><h1>Welcome to μWiki!</h1><br><br>') import fsdb from rcstore import rcstore, pickle content = rcstore(fsdb.fsdb(config.data_root + '/wikidata/content')) # The URL for static content needs to be computed dynamically because # don't know our application name until we're called. This could and # probably should be cached, but KISS for now. # def spath(): return mpath('/static') def stylesheet(): return Tag('link', rel="stylesheet", type="text/css", href=mpath("/static/uwiki.css"))