Commit 812c597f authored by Romain Bignon's avatar Romain Bignon

minor fixes

parent b08db003
......@@ -34,5 +34,5 @@ class DLFPBackend(Backend, ICapMessages, ICapMessagesReply, ICapUpdatable):
def iter_messages(self):
articles_list = ArticlesList('newspaper')
for article in articles_list.iter_articles():
yield Message('threadid', article._id, article.title, article.author, signature='Bite bite bite bite',
yield Message('threadid', article.id, article.title, article.author, signature='Bite bite bite bite',
content='Content content\nContent content.')
......@@ -24,7 +24,7 @@ import time
class Message:
def __init__(self, thread_id, _id, title, sender, date=None, reply_id=u'', content=u'', signature=u''):
self.thread_id = unicode(thread_id)
self._id = unicode(_id)
self.id = unicode(_id)
self.reply_id = unicode(reply_id)
self.title = unicode(title)
self.sender = unicode(sender)
......@@ -40,13 +40,13 @@ class Message:
return int(time.strftime('%Y%m%d%H%M%S', self.get_date().timetuple()))
def get_full_id(self):
return '%s.%s' % (self._id, self.thread_id)
return '%s.%s' % (self.id, self.thread_id)
def get_full_reply_id(self):
return '%s.%s' % (self.reply_id, self.thread_id)
def get_id(self):
return self._id
return self.id
def get_thread_id(self):
return self.thread_id
......@@ -72,9 +72,9 @@ class Message:
def is_new(self):
return self.new
def __str__(self):
result = '<Message title="%s" date="%s" from="%s" content="%s">' % (
self.title, self.date, self.sender, self.content)
def __repr__(self):
result = '<Message id="%s" title="%s" date="%s" from="%s">' % (
self.id, self.title, self.date, self.sender)
return result.encode('utf-8')
class ICapMessages:
......
......@@ -47,7 +47,6 @@ class Application(BaseApplication):
self.weboob.load_modules(ICapMessages)
self.weboob.schedule(self.config['interval'], self.process)
self.weboob.config.save()
self.weboob.loop()
def process(self):
......
......@@ -32,11 +32,6 @@ class Application(BaseApplication):
CONFIG = {}
def main(self, argv):
#if not self.config:
# print >>sys.stderr, "Error: %s is not configured yet. Please call 'weboob.travel -c'" % argv[0]
# print >>sys.stderr, "Also, you need to use 'weboobcfg' to set backend configs"
# return -1
self.weboob.load_modules(ICapTravel)
if len(argv) == 1:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment