lippathod/app.py -> libpathod/pathod.py

This commit is contained in:
Aldo Cortesi 2012-06-07 08:50:06 +12:00
parent d171e13fd3
commit 049d3d2b45
3 changed files with 7 additions and 7 deletions

6
pathod
View File

@ -1,6 +1,6 @@
#!/usr/bin/env python
import argparse, sys
from libpathod import app, utils, version
from libpathod import pathod, utils, version
import tornado.ioloop
if __name__ == "__main__":
@ -33,7 +33,7 @@ if __name__ == "__main__":
settings = dict(
staticdir=args.staticdir
)
application = app.PathodApp(**settings)
application = pathod.PathodApp(**settings)
for i in args.anchors:
try:
rex, spec = utils.parse_anchor_spec(i, settings)
@ -50,6 +50,6 @@ if __name__ == "__main__":
ssl = None
print "%s listening on port %s"%(version.NAMEVERSION, args.port)
try:
app.run(application, args.port, ssl)
pathod.run(application, args.port, ssl)
except KeyboardInterrupt:
pass

View File

@ -1,10 +1,10 @@
import libpry
from libpathod import app
from libpathod import pathod
from tornado import httpserver
class uApplication(libpry.AutoTree):
def test_anchors(self):
a = app.PathodApp(staticdir=None)
a = pathod.PathodApp(staticdir=None)
a.add_anchor("/foo", "200")
assert a.get_anchors() == [("/foo", "200")]
a.add_anchor("/bar", "400")
@ -15,7 +15,7 @@ class uApplication(libpry.AutoTree):
assert a.get_anchors() == [("/foo", "200")]
def test_logs(self):
a = app.PathodApp(staticdir=None)
a = pathod.PathodApp(staticdir=None)
a.LOGBUF = 3
a.add_log({})
assert a.log[0]["id"] == 0
@ -36,7 +36,7 @@ class uPages(libpry.AutoTree):
def dummy_page(self, path):
# A hideous, hideous kludge, but Tornado seems to have no more sensible
# way to do this.
a = app.PathodApp(staticdir=None)
a = pathod.PathodApp(staticdir=None)
for h in a.handlers[0][1]:
if h.regex.match(path):
klass = h.handler_class