[Otfbot-dev] [Git] OTFBot branch, master, updated. e5235b9f614a96388a1807c71888945a26f0b6f7

git version control gitrepo at otfbot.org
Mo Nov 1 01:20:11 CET 2010


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "OTFBot".

The branch, master has been updated
       via  e5235b9f614a96388a1807c71888945a26f0b6f7 (commit)
       via  851e54c7e496c31509a07c9c8cce747adcbfe60e (commit)
      from  893cb9e33196873e50a7cc55e6d7da8a8418a098 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit e5235b9f614a96388a1807c71888945a26f0b6f7
Author: allo <allo at laxu.de>
Date:   Mon Nov 1 01:19:29 2010 +0100

    removed old blocking comments

diff --git a/otfbot/plugins/ircClient/log.py b/otfbot/plugins/ircClient/log.py
index e67d938..7f629ba 100644
--- a/otfbot/plugins/ircClient/log.py
+++ b/otfbot/plugins/ircClient/log.py
@@ -93,7 +93,6 @@ class Plugin(chatMod.chatMod):
                 logmsg = filtercolors(string) + "\n"
                 if timestamp:
                     logmsg = self.ts() + " " + logmsg
-                #TODO: blocking
                 self.files[channel].write(logmsg.encode("UTF-8"))
                 self.files[channel].flush()
         reactor.callInThread(real_log, self, channel, string, timestamp)
@@ -105,7 +104,6 @@ class Plugin(chatMod.chatMod):
                 dic = self.timemap()
                 dic['c'] = string.lower(user)
                 filename = Template(self.logpath).safe_substitute(dic)
-                #TODO: blocking
                 if not os.path.exists(os.path.dirname(filename)):
                     os.makedirs(os.path.dirname(filename))
                 file = open(filename, "a")
commit 851e54c7e496c31509a07c9c8cce747adcbfe60e
Author: allo <allo at laxu.de>
Date:   Mon Nov 1 01:18:14 2010 +0100

    Thread for parsenews

diff --git a/otfbot/plugins/ircClient/feed.py b/otfbot/plugins/ircClient/feed.py
index 92112de..4dfaf58 100644
--- a/otfbot/plugins/ircClient/feed.py
+++ b/otfbot/plugins/ircClient/feed.py
@@ -21,6 +21,8 @@
 Post Headlines and Links from a Newsfeed
 """
 
+from twisted.internet import reactor
+
 from otfbot.lib import chatMod, urlutils
 from otfbot.lib.pluginSupport.decorators import callback
 
@@ -130,11 +132,12 @@ class Plugin(chatMod.chatMod):
         urlutils.download(url).addCallback(self.parseNews, url)
 
     def parseNews(self, feedcontent, url):
-        #TODO: also a blocking call?
-        parsed = self.feedparser.parse(feedcontent)
-        self.feedHeadlines[url] = []
-        for entry in parsed['entries']:
-            self.feedHeadlines[url].append((entry['link'], entry['title']))
+        def parseNewsThread(self, feedcontent, url):
+            parsed = self.feedparser.parse(feedcontent)
+            self.feedHeadlines[url] = []
+            for entry in parsed['entries']:
+                self.feedHeadlines[url].append((entry['link'], entry['title']))
+        reactor.callInThread(parseNewsThread, self, feedcontent, url)
 
     def postNews(self, channel, url, feedPostMax):
         had_new = False #new urls? needed for wait-time modification
-----------------------------------------------------------------------

Summary of changes:
 otfbot/plugins/ircClient/feed.py |   13 ++++++++-----
 otfbot/plugins/ircClient/log.py  |    2 --
 2 files changed, 8 insertions(+), 7 deletions(-)


hooks/post-receive
-- 
OTFBot



Mehr Informationen über die Mailingliste Otfbot-dev