Refactor probe sending

darcs-hash:20070408175758-86b55-933dcd6fc56871993bd9b8dfecd98b61d68db070.gz
This commit is contained in:
David Rousselie
2007-04-08 19:57:58 +02:00
parent ca0d636b33
commit 47aed647a2
2 changed files with 35 additions and 41 deletions

View File

@@ -30,6 +30,7 @@ import logging
from jcl.jabber.component import JCLComponent
from jcl.lang import Lang
from jcl.model.account import Account
class FeederComponent(JCLComponent):
"""Implement a feeder sender behavior based on the
@@ -61,8 +62,8 @@ class FeederComponent(JCLComponent):
def handle_tick(self):
"""Implement main feed/send behavior"""
self.db_connect()
for _account in self.account_classes[0].select(clauseTables = ["account"], \
orderBy = "user_jid"):
for _account in Account.select(clauseTables = ["account"], \
orderBy = "user_jid"):
for data in self.feeder.feed(_account):
self.sender.send(_account, data)
self.db_disconnect()