From 98270d7d44d0b7230794752cf69d1f28ecc5ecf0 Mon Sep 17 00:00:00 2001 From: yvesf Date: Sun, 24 Jul 2011 19:22:01 +0200 Subject: echo=True in web_dev --- bin/web_dev.py | 2 +- ebus/webapp/soup_plugin.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/bin/web_dev.py b/bin/web_dev.py index 7dd5d87..c04c071 100644 --- a/bin/web_dev.py +++ b/bin/web_dev.py @@ -5,7 +5,7 @@ from ebus import webapp from ebus.webapp.soup_plugin import SoupPlugin if __name__ == "__main__": - soup = SoupPlugin(url="postgresql://ebus:ebus@10.2.2.26:5432/ebus") + soup = SoupPlugin(url="postgresql://ebus:ebus@10.2.2.26:5432/ebus", echo=True) webapp.app.install(soup) bottle.debug(True) diff --git a/ebus/webapp/soup_plugin.py b/ebus/webapp/soup_plugin.py index 68120af..b6292c6 100644 --- a/ebus/webapp/soup_plugin.py +++ b/ebus/webapp/soup_plugin.py @@ -9,9 +9,10 @@ from sqlalchemy.ext.sqlsoup import SqlSoup class SoupPlugin(object): name = 'soup' - def __init__(self, url, keyword='soup'): + def __init__(self, url, echo=False, keyword='soup'): self.url = url self.keyword = keyword + self.echo = echo def setup(self, app): for other in app.plugins: @@ -20,7 +21,7 @@ class SoupPlugin(object): raise PluginError("Found another soup plugin with "\ "conflicting settings (non-unique keyword).") - self.engine = create_engine(self.url) + self.engine = create_engine(self.url, echo=self.echo) self.soup = SqlSoup(self.engine) -- cgit v1.2.1