aboutsummaryrefslogtreecommitdiffstats
path: root/plugin.py
diff options
context:
space:
mode:
authorkongr45gpen <electrovesta@gmail.com>2014-04-27 17:27:51 +0300
committerkongr45gpen <electrovesta@gmail.com>2014-04-27 17:27:51 +0300
commitb83a3d8f35937c128fa3c6076ca04721e313822e (patch)
tree83aac60b2dd9420ce764d698755a1050bee70906 /plugin.py
parente149f5274a8149d9366717b9d762d13097834a53 (diff)
downloadsupybot_github-b83a3d8f35937c128fa3c6076ca04721e313822e.tar.gz
supybot_github-b83a3d8f35937c128fa3c6076ca04721e313822e.tar.bz2
supybot_github-b83a3d8f35937c128fa3c6076ca04721e313822e.zip
Add `port` configuration variable
Diffstat (limited to 'plugin.py')
-rw-r--r--plugin.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/plugin.py b/plugin.py
index 3ea8568..61ff897 100644
--- a/plugin.py
+++ b/plugin.py
@@ -33,6 +33,7 @@ import urlparse
import threading
import BaseHTTPServer
+import supybot.log as log
import supybot.conf as conf
import supybot.utils as utils
import supybot.world as world
@@ -46,20 +47,17 @@ import supybot.callbacks as callbacks
RequestHandler = utils.python.universalImport('handler.GithubHandler', 'local.handler.GithubHandler')
Utility = utils.python.universalImport('local.utility')
-# Possible colours:
-# white, black, (light/dark) blue, (light) green, red, brown, purple,
-# orange, yellow, teal, pink, light/dark gray/grey
-
class Github(callbacks.Plugin):
"""Add the help for \"@plugin help Github\" here
This should describe how to use this plugin."""
threaded = True
+ port = Utility.configValue('port')
pass
- def ServerStart(self, httpd):
+ def ServerStart(self, httpd, port):
try:
- print time.asctime(), 'Server Starts - %s:%s' % ('', 8093)
+ log.info('Server Starts - %s:%s' % ('', port))
httpd.serve_forever()
except:
return
@@ -68,8 +66,8 @@ class Github(callbacks.Plugin):
self.__parent = super(Github, self)
self.__parent.__init__(irc)
server_class = BaseHTTPServer.HTTPServer
- self.httpd = server_class(('', 8093), RequestHandler.GithubHandler)
- t = threading.Thread(target=self.ServerStart, args=(self.httpd,))
+ self.httpd = server_class(('', self.port), RequestHandler.GithubHandler)
+ t = threading.Thread(target=self.ServerStart, args=(self.httpd, self.port))
t.daemon = False
t.start()

© 2014-2024 Faster IT GmbH | imprint | privacy policy