summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryvesf <yvesf-git@xapek.org>2011-07-24 19:22:01 +0200
committeryvesf <yvesf-git@xapek.org>2011-07-24 19:22:01 +0200
commit98270d7d44d0b7230794752cf69d1f28ecc5ecf0 (patch)
tree010a35817e5960b3ee26d8fb0b7d861116282ebf
parent0f50ff74d21875918efaa35cd9915a197e4e81c1 (diff)
downloadebus-alt-98270d7d44d0b7230794752cf69d1f28ecc5ecf0.tar.gz
ebus-alt-98270d7d44d0b7230794752cf69d1f28ecc5ecf0.zip
echo=True in web_dev
-rw-r--r--bin/web_dev.py2
-rw-r--r--ebus/webapp/soup_plugin.py5
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)