Add SSL support

This commit is contained in:
Brendan Molloy
2010-09-12 21:33:15 +10:00
parent b45c1e94f7
commit 4969c0d603
3 changed files with 18 additions and 6 deletions

13
phenny
View File

@@ -25,8 +25,12 @@ def check_python_version():
def create_default_config(fn):
f = open(fn, 'w')
print >> f, trim("""\
import os
nick = 'phenny'
host = 'irc.example.net'
port = 6667
ssl = False
channels = ['#example', '#test']
owner = 'yournickname'
@@ -44,7 +48,7 @@ def create_default_config(fn):
# Directories to load user modules from
# e.g. /path/to/my/modules
extra = []
extra = ['os.path.expanduser("~/.phenny/modules")']
# Services to load: maps channel names to white or black lists
external = {
@@ -59,7 +63,8 @@ def create_default_config(fn):
def create_dotdir(dotdir):
print 'Creating a config directory at ~/.phenny...'
try: os.mkdir(dotdir)
try:
os.mkdir(dotdir)
except Exception, e:
print >> sys.stderr, 'There was a problem creating %s:' % dotdir
print >> sys.stderr, e.__class__, str(e)
@@ -68,6 +73,7 @@ def create_dotdir(dotdir):
print 'Creating a default config file at ~/.phenny/default.py...'
default = os.path.join(dotdir, 'default.py')
os.mkdir(os.path.join(dotdir, 'modules'))
create_default_config(default)
print 'Done; now you can edit default.py, and run phenny! Enjoy.'
@@ -135,6 +141,9 @@ def main(argv=None):
if not hasattr(module, 'port'):
module.port = 6667
if not hasattr(module, 'ssl'):
module.ssl = False
if not hasattr(module, 'password'):
module.password = None