Skip to content

Instantly share code, notes, and snippets.

@shiroyuki
Created April 1, 2010 02:45
Show Gist options
  • Save shiroyuki/351260 to your computer and use it in GitHub Desktop.
Save shiroyuki/351260 to your computer and use it in GitHub Desktop.
import sys, os
basePath = os.path.abspath(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(basePath)
# Add the experimental package of Yotsuba 3
if not os.path.exists('/path/to/your/copy'):
raise Exception("Required Yotsuba 3 experimental package")
sys.path.append('/path/to/your/copy')
from yotsuba3.lib import tori
tori.setup('config.xml')
class websiteObjectWithToriBaseInterface(tori.baseInterface):
def index():
return self.render("demo.html", msg = "Hello, world")
index.exposed = True
class websiteObjectWithoutToriBaseInterface:
def index():
return "Hello, world"
index.exposed = True
application = tori.serverInterface.auto(websiteObjectWithToriBaseInterface(), tori.baseURI)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment