Commits

Chris Mulligan committed d246344

Hopefully final tweaks for the yougov rollout of pmxbot1003.

  • Participants
  • Parent commits 2ad1bb4

Comments (0)

Files changed (5)

 include pmxbot/popquotes.sqlite
-include pmxbotweb/templates/*html
+include pmxbotweb/templates/*

pmxbot/botbase.py

 			return
 		if time.time() - warn_history.get(nick, 0) > LOGWARN_EVERY:
 			warn_history[nick] = time.time()
-			msg = LOGWARN_MESSAGE % (', '.join(['#'+chan for chan in self._channels if '#'+chan not in self._nolog]))
+			msg = LOGWARN_MESSAGE % (', '.join([chan for chan in sorted(self._channels) if chan not in self._nolog]))
 			for line in msg.splitlines():
 				c.notice(nick, line)
 	
 				c.action(channel, s.split(' ', 1)[-1].lstrip())
 			else:
 				c.privmsg(channel, s)
-				if channel not in self._nolog and not secret:
+				if channel in self._channels and channel not in self._nolog and not secret:
 					logger.message(channel, self._nickname, s)
 		if res:
 			if isinstance(res, basestring):
 	if rest:
 		name = rest.strip()
 		karmaChange(botbase.logger.db, name, -1)
-	#qt = bartletts(botbase.logger.db, 'simpsons', nick, 'pardon my zinger')
-	#if qt:	return qt
 	return "OH MAN!!! %s TOTALLY GOT ZING'D!" % (name.upper())
 
 @command("motivate", aliases=("m", "appreciate", "thanks", "thank"), doc="Motivate someone")
 def motivate(client, event, channel, nick, rest):
 	if rest:
 		r = rest.strip()
-		karmaChange(botbase.logger.db, r, 1)
 	else:
 		r = channel
+	karmaChange(botbase.logger.db, r, 1)
 	return "you're doing good work, %s!" % r
 
 @command("imotivate", aliases=("im", 'ironicmotivate',), doc='''Ironically "Motivate" someone''')
 def demotivate(client, event, channel, nick, rest):
 	if rest:
 		r = rest.strip()
-		karmaChange(botbase.logger.db, r, -1)
 	else:
 		r = channel
+	karmaChange(botbase.logger.db, r, -1)
 	return "you're doing horrible work, %s!" % r
 
 @command("8ball", aliases=("8",), doc="Ask the magic 8ball a question")

pmxbotweb/pmxbotweb.py

 # vim:ts=4:sw=4:noexpandtab
 """
 pmxbotweb.py
-
-s
 """
 
 import sys
         	config.web_base = '/%s' % config.web_base
 	except AttributeError:
 		config.web_base = '/'
+	if config.web_base[-1] == '/':
+		config.web_base = config.web_base[:-1]
 	try:
 		config.web_host
 	except AttributeError:
 from setuptools import setup
 
 setup(name="pmxbot",
-    version="1003-beta1",
+    version="1003",
     packages=["pmxbot", "pmxbotweb",],
-    data_files=[('pmxbot', ["popquotes.sqlite",]),
-		('pmxbotweb/templates', ["*.html"]),
+    data_files=[('pmxbot', ["pmxbot/popquotes.sqlite",]),
+		('pmxbotweb/templates', ["pmxbotweb/templates/base.html",
+			"pmxbotweb/templates/channel.html",
+			"pmxbotweb/templates/day.html",
+			"pmxbotweb/templates/help.html",
+			"pmxbotweb/templates/index.html",
+			"pmxbotweb/templates/karma.html",
+			"pmxbotweb/templates/search.html",
+			"pmxbotweb/templates/pmxbot.png",
+			]),
 		],
     entry_points={
             'console_scripts' :