Skip to content

Commit

Permalink
봇 SSL 사용 옵션 처리
Browse files Browse the repository at this point in the history
  • Loading branch information
sim0629 committed Oct 8, 2013
1 parent b0a0113 commit 0697a5a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 5 additions & 2 deletions bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import irc.client
import irc.connection

import ssl
import pymongo
import datetime

Expand All @@ -14,7 +13,11 @@

class SBot(irc.bot.SingleServerIRCBot):
def __init__(self):
factory = irc.connection.Factory(wrapper=ssl.wrap_socket)
if config.USE_SSL:
import ssl
factory = irc.connection.Factory(wrapper=ssl.wrap_socket)
else:
factory = irc.connection.Factory()
irc.bot.SingleServerIRCBot.__init__(self,
[(config.SERVER, config.PORT), ],
config.BOT_NAME,
Expand Down
1 change: 1 addition & 0 deletions config.py.example
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ NOTIFY_NAME = '!'

# IRC
SERVER = 'irc.uriirc.org'
USE_SSL = True
PORT = 16662
BOT_NAME = 's'
OPERATOR_NAME = 'sgm'
Expand Down

0 comments on commit 0697a5a

Please sign in to comment.