From d505e6597280b16b5714d9d57177e27229eaaa9a Mon Sep 17 00:00:00 2001 From: David Rousselie Date: Wed, 4 Oct 2006 19:03:05 +0200 Subject: [PATCH] Classes and modules documentation completion darcs-hash:20061004170305-86b55-b85772708e21531de456b86db1560a866f42a008.gz --- src/jcl/__init__.py | 3 ++- src/jcl/jabber/__init__.py | 2 ++ src/jcl/jabber/component.py | 2 +- src/jcl/jabber/feeder.py | 25 +++++++++---------------- src/jcl/jabber/x.py | 2 +- src/jcl/lang.py | 3 +-- src/jcl/model/__init__.py | 3 +++ src/jcl/model/account.py | 14 +++++++++++++- 8 files changed, 32 insertions(+), 22 deletions(-) diff --git a/src/jcl/__init__.py b/src/jcl/__init__.py index 2d9fb23..5f9d567 100644 --- a/src/jcl/__init__.py +++ b/src/jcl/__init__.py @@ -1 +1,2 @@ -__revision__ = "$Id: __init__.py dax $" +"""JCL module""" +__revision__ = "" diff --git a/src/jcl/jabber/__init__.py b/src/jcl/jabber/__init__.py index e69de29..5ba0328 100644 --- a/src/jcl/jabber/__init__.py +++ b/src/jcl/jabber/__init__.py @@ -0,0 +1,2 @@ +"""Jabber related classes""" +__revision__ = "" diff --git a/src/jcl/jabber/component.py b/src/jcl/jabber/component.py index eff5f9c..0c5fc7b 100644 --- a/src/jcl/jabber/component.py +++ b/src/jcl/jabber/component.py @@ -24,7 +24,7 @@ """JCL base component """ -__revision__ = "" +__revision__ = "$Id: component.py,v 1.3 2005/09/18 20:24:07 dax Exp $" import thread import threading diff --git a/src/jcl/jabber/feeder.py b/src/jcl/jabber/feeder.py index 75216fe..3fb5cd9 100644 --- a/src/jcl/jabber/feeder.py +++ b/src/jcl/jabber/feeder.py @@ -22,10 +22,9 @@ ## """FeederComponent with default Feeder and Sender -implementation -""" +implementation""" -__revision__ = "$Id: feeder.py dax $" +__revision__ = "$Id: feeder.py,v 1.3 2005/09/18 20:24:07 dax Exp $" import logging @@ -36,8 +35,7 @@ class FeederComponent(JCLComponent): """Implement a feeder sender behavior based on the regular interval behavior of JCLComponent feed data from given Feeder and send it to user - through the given Sender. - """ + through the given Sender.""" def __init__(self, jid, secret, @@ -57,34 +55,29 @@ class FeederComponent(JCLComponent): self.__logger = logging.getLogger("jcl.jabber.JCLComponent") def handle_tick(self): - """Implement main feed/send behavior - """ - for account in Account.select("*"): + """Implement main feed/send behavior""" + for account in Account.select(): for data in self.feeder.feed(account): self.sender.send(account, data) class Feeder(object): - """Abstract feeder class - """ + """Abstract feeder class""" def __init__(self): pass def feed(self, account): - """Feed data for given account - """ + """Feed data for given account""" pass class Sender(object): - """Abstract sender class - """ + """Abstract sender class""" def __init__(self): pass def send(self, to_account, data): - """Send data to given account - """ + """Send data to given account""" pass diff --git a/src/jcl/jabber/x.py b/src/jcl/jabber/x.py index a2201ea..f74af4c 100644 --- a/src/jcl/jabber/x.py +++ b/src/jcl/jabber/x.py @@ -23,7 +23,7 @@ """X -- X data handling """ -__revision__ = "" +__revision__ = "$Id: x.py,v 1.3 2005/09/18 20:24:07 dax Exp $" from pyxmpp.stanza import common_doc diff --git a/src/jcl/lang.py b/src/jcl/lang.py index 0617a2c..f23b478 100644 --- a/src/jcl/lang.py +++ b/src/jcl/lang.py @@ -24,8 +24,7 @@ """lang -- contains translations """ -# TODO get help to generate revision -__revision__ = "$Id: lang.py dax $" +__revision__ = "$Id: lang.py,v 1.3 2005/09/18 20:24:07 dax Exp $" # TODO delete JMC translation class Lang: diff --git a/src/jcl/model/__init__.py b/src/jcl/model/__init__.py index e69de29..97f885b 100644 --- a/src/jcl/model/__init__.py +++ b/src/jcl/model/__init__.py @@ -0,0 +1,3 @@ +"""Contains data model classes""" +__revision__ = "" + diff --git a/src/jcl/model/account.py b/src/jcl/model/account.py index a857a26..5c9bf3a 100644 --- a/src/jcl/model/account.py +++ b/src/jcl/model/account.py @@ -21,12 +21,24 @@ ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ## -from sqlobject import * +"""Basic Account implementation +""" + +__revision__ = "$Id: account.py,v 1.3 2005/09/18 20:24:07 dax Exp $" + +from sqlobject.main import SQLObject +from sqlobject.col import StringCol class Account(SQLObject): + """Base Account class""" user_jid = StringCol() name = StringCol() jid = StringCol() + def get_long_name(self): + """Return Human readable account name""" + return self.name + long_name = property(get_long_name) +