projects
/
yourule
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ee98f53
)
fixed several bugs
author
<mako@atdot.cc>
<>
Sun, 16 Sep 2007 21:24:49 +0000
(17:24 -0400)
committer
<mako@atdot.cc>
<>
Sun, 16 Sep 2007 21:24:49 +0000
(17:24 -0400)
yourule.py
patch
|
blob
|
history
diff --git
a/yourule.py
b/yourule.py
index 3de9e7b4f03cd56323f730adf4fa1d0bbd37e6ca..d6f44bdfbabe0ed7b1b57527ceb2e335c656cfae 100755
(executable)
--- a/
yourule.py
+++ b/
yourule.py
@@
-4,17
+4,20
@@
from __future__ import division
import web
import sys, os, re
from storm.locals import *
import web
import sys, os, re
from storm.locals import *
+
+# recalculate the path based on the location of the file
+sys.path.append(os.path.dirname(__file__))
from svgruler import SVGRuler
from jinja import Environment, FileSystemLoader
jinja_env = Environment('<%', '%>', '<%=', '%>', '<%#', '%>',
from svgruler import SVGRuler
from jinja import Environment, FileSystemLoader
jinja_env = Environment('<%', '%>', '<%=', '%>', '<%#', '%>',
- loader=FileSystemLoader(
'templates/'
))
+ loader=FileSystemLoader(
os.path.dirname(__file__) + "/templates/"
))
def render(filename, vars):
web.header("Content-Type","text/html; charset=utf-8")
tmpl = jinja_env.get_template(filename + '.tmpl')
print tmpl.render(vars)
def render(filename, vars):
web.header("Content-Type","text/html; charset=utf-8")
tmpl = jinja_env.get_template(filename + '.tmpl')
print tmpl.render(vars)
- web.debug(web.ctx)
+ print web.ctx
# the url map for the application
urls = ( '/?', 'index',
# the url map for the application
urls = ( '/?', 'index',
@@
-222,5
+225,5
@@
web.webapi.internalerror = web.debugerror
if __name__ == "__main__":
web.run(urls, globals(), web.reloader)
if __name__ == "__main__":
web.run(urls, globals(), web.reloader)
-
#
application = web.wsgifunc(web.webpyfunc(urls, globals()))
+application = web.wsgifunc(web.webpyfunc(urls, globals()))
Benjamin Mako Hill
||
Want to submit a patch?