summaryrefslogtreecommitdiffstats
path: root/ircbot
diff options
context:
space:
mode:
authorlassulus <lassulus@googlemail.com>2014-01-06 00:53:37 +0100
committerlassulus <lassulus@googlemail.com>2014-01-06 00:53:37 +0100
commitf2adb4ea677d0651b89b63a9c59e44ff87bd63d0 (patch)
tree97973b52bff22ebed6a8a887f52a181841b16c50 /ircbot
parent020fab58ce23a4f61f82f94a2c3b804d659e9dcd (diff)
ircbot: rename lastpull to lastnew
Diffstat (limited to 'ircbot')
-rwxr-xr-xircbot/contoller.py9
-rwxr-xr-xircbot/rssbot.py4
2 files changed, 7 insertions, 6 deletions
diff --git a/ircbot/contoller.py b/ircbot/contoller.py
index dc1663c9..7964708e 100755
--- a/ircbot/contoller.py
+++ b/ircbot/contoller.py
@@ -36,14 +36,15 @@ class NewsBot(irc.bot.SingleServerIRCBot):
sleep(1)
def on_privmsg(self, connection, event):
+ answer = self.read_message(args_array)
+ self.send(answer)
+
+ def on_pubmsg(self, connection, event):
args_array = event.arguments[0].split()
if args_array[0][:-1]==self.name:
answer = self.read_message(args_array[1:])
self.send(answer)
- def on_pubmsg(self, connection, event):
- self.on_privmsg(connection, event)
-
def read_message(self, args):
try:
if args[0] in [x for x in commands.__dict__.keys() if x.find('_')]:
@@ -125,7 +126,7 @@ class commands():
for data in ['title', 'link', 'updated']:
if data in bots[args[1]].feed.feed:
output_buffer += data + ': ' + bots[args[1]].feed.feed[data] + '\n'
- output_buffer += 'lastpull: ' + bots[args[1]].lastpull.isoformat()
+ output_buffer += 'lastnew: ' + bots[args[1]].lastnew.isoformat()
return output_buffer
else:
return 'bot not found'
diff --git a/ircbot/rssbot.py b/ircbot/rssbot.py
index c3e05d1e..67f407ac 100755
--- a/ircbot/rssbot.py
+++ b/ircbot/rssbot.py
@@ -20,7 +20,7 @@ class RssBot(irc.bot.SingleServerIRCBot):
self.oldnews = []
self.sendqueue = []
self.loop = True
- self.lastpull = datetime.now()
+ self.lastnew = datetime.now()
def start(self):
self.upd_loop = _thread.start_new_thread(self.updateloop, ())
@@ -49,7 +49,7 @@ class RssBot(irc.bot.SingleServerIRCBot):
#except AttributeError:
self.send(entry.title + " " + entry.link)
self.oldnews.append(entry.link)
- self.lastpull = datetime.now()
+ self.lastnew = datetime.now()
sleep(self.to)