summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorMarko Kreen2010-11-19 13:17:51 +0000
committerMarko Kreen2010-11-26 11:27:32 +0000
commitaa17c0ac14027a52949636643a769d8adb2dd23b (patch)
treea6fab89f88557a4f6f5bec708cb8730fa7c97544 /python
parent14c1dcaea895d5507a9c1844d3792f70c562c769 (diff)
londiste: call handler at add-table time
Diffstat (limited to 'python')
-rw-r--r--python/londiste/setup.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/python/londiste/setup.py b/python/londiste/setup.py
index a323ab20..9ea44bbb 100644
--- a/python/londiste/setup.py
+++ b/python/londiste/setup.py
@@ -162,20 +162,21 @@ class LondisteSetup(CascadeAdmin):
self.log.warning('Table "%s" missing on subscriber, use --create if necessary' % tbl)
return
- attrs = {}
+ tgargs = []
+ if self.options.trigger_arg:
+ tgargs = self.options.trigger_arg
+ tgflags = self.options.trigger_flags
+ if tgflags:
+ tgargs.append('tgflags='+tgflags)
+ attrs = {}
hlist = self.options.handler
if hlist:
p = londiste.handler.build_handler(tbl, hlist)
attrs['handlers'] = ":".join(hlist)
+ p.add(tgargs)
# actual table registration
- tgflags = self.options.trigger_flags
- tgargs = self.options.trigger_arg # None by default
- if tgflags:
- if not tgargs:
- tgargs = []
- tgargs.append('tgflags='+tgflags)
q = "select * from londiste.local_add_table(%s, %s, %s)"
self.exec_cmd(dst_curs, q, [self.set_name, tbl, tgargs])