$ pip install falcon
$ python3 app.py
alternatively with Gunicorn (for HTTP/1.1):
$ pip install gunicorn
$ gunicorn app:app
# in the plugin file itself, called tiddlydocs.py | |
app_tiddlers = [ | |
"file:///home/fnd/Dev/TiddlyWiki/TiddlyWiki.org/association/serversides/cctiddly/Trunk/plugins/TiddlyDocs/files/split.recipe" | |
] | |
def init(config): | |
#print "invoking TiddlyDocs" # don't do prints here, will blow up ever called by mod_wsgi, better to import loggin;logging.debug(message) | |
config["instance_tiddlers"] = config["instance_tiddlers"] + [("common", app_tiddlers)] |
""" | |
Simple plugin to display the env. | |
""" | |
from pprint import pformat | |
def env(environ, start_response): | |
start_response('200 OK', [('Content-Type', 'text/plain')]) | |
return [pformat(environ)] |
""" | |
test case for the following error: | |
UnicodeEncodeError: | |
'ascii' codec can't encode character u'\xf6' in position 1: | |
ordinal not in range(128) | |
""" | |
import html5lib |
from jinja2 import Environment, FileSystemLoader | |
from tiddlywebplugins import replace_handler | |
def homepage(environ, start_response): | |
template_env = Environment(loader=FileSystemLoader('templates/new')) | |
template = template_env.get_template('newTheme.html') | |
return _generate_response(template.generate(), environ, start_response) | |
def _generate_response(content_generator, environ, start_response): | |
content_header = ('Content-Type', 'text/html; charset=UTF-8') |
#!/usr/bin/env python | |
""" | |
SAC | |
SAC ain't Cook (and he doesn't like it either) | |
""" | |
import sys |
from time import time | |
starts = [ | |
1248637121, | |
1248818005, | |
1248819043, | |
1248819661, | |
1248820029, | |
1248862668, | |
1248976328, |
*.pyc |
#!/usr/bin/env python | |
""" | |
simplewiki instantiation | |
""" | |
import sys | |
from tiddlyweb.config import config |
*.pyc |