This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from tiddlyweb.model.tiddler import Tiddler | |
from tiddlyweb.web.http import HTTP302 | |
SKIP_FIELDS = [] # add string fields that we don't want in the tiddler data | |
def handler(environ, start_response): | |
input = environ['tiddlyweb.query'] | |
store = environ['tiddlyweb.store'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import deque | |
class Addable(object): | |
def __init__(self): | |
self.holder = deque() | |
def adder(self): | |
while True: | |
try: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
what ho? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Play around with getting stuff out of the store. | |
This is probably best described as "the new way" | |
since much of my code doesn't do it this way. | |
I'm trying to toe a line here with the correct | |
use of a control, which tries to help remove | |
some duplication and centralize the controlling of | |
bag and recipe contents and processing somewhere | |
other than bag and recipe objects (so they can be |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
SAC | |
SAC ain't Cook (and he doesn't like it either) | |
""" | |
import sys |
OlderNewer