GitHub & WebStats: Use the new path of the httpserver.

master
Valentin Lorentz 2011-07-01 16:19:08 +02:00
parent d584100c83
commit 615d1da04f
2 changed files with 8 additions and 6 deletions

View File

@ -43,6 +43,7 @@ import supybot.plugins as plugins
import supybot.ircmsgs as ircmsgs
import supybot.ircutils as ircutils
import supybot.callbacks as callbacks
import supybot.httpserver as httpserver
try:
from supybot.i18n import PluginInternationalization
from supybot.i18n import internationalizeDocstring
@ -59,7 +60,7 @@ except:
import supybot.utils.httpserver
class GithubCallback(supybot.utils.httpserver.SupyHTTPServerCallback):
class GithubCallback(httpserver.SupyHTTPServerCallback):
def doPost(self, handler, path, form):
if not handler.address_string().endswith('.rs.github.com'):
log.warning("""'%s' tryed to act as a web hook for Github,
@ -96,7 +97,7 @@ class GitHub(callbacks.Plugin):
callback = GithubCallback()
callback.plugin = self
utils.httpserver.hook('github', callback)
httpserver.hook('github', callback)
class announce(callbacks.Commands):
def _createPrivmsg(self, channel, payload, commit):
@ -258,7 +259,7 @@ class GitHub(callbacks.Plugin):
'disable': 'anything'})])
def die(self):
self.__parent.die()
utils.httpserver.unhook('github')
httpserver.unhook('github')
Class = GitHub

View File

@ -46,6 +46,7 @@ import supybot.plugins as plugins
import supybot.ircmsgs as ircmsgs
import supybot.ircutils as ircutils
import supybot.callbacks as callbacks
import supybot.httpserver as httpserver
try:
import sqlite3
@ -79,7 +80,7 @@ def getTemplate(name):
class FooException(Exception):
pass
class WebStatsServerCallback(utils.httpserver.SupyHTTPServerCallback):
class WebStatsServerCallback(httpserver.SupyHTTPServerCallback):
name = 'WebStats'
def doGet(self, handler, path):
output = ''
@ -449,10 +450,10 @@ class WebStats(callbacks.Plugin):
callback = WebStatsServerCallback()
callback.plugin = self
callback.db = self.db
utils.httpserver.hook('webstats', callback)
httpserver.hook('webstats', callback)
def die(self):
utils.httpserver.unhook('webstats')
httpserver.unhook('webstats')
self.__parent.die()
def doPrivmsg(self, irc, msg):