Merge branch 'master' of ayu.incorporeal.org:dr.botzo
This commit is contained in:
commit
2875bacae4
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
*.pyc
|
||||||
|
*.swp
|
6
dr.botzo.cfg
Normal file
6
dr.botzo.cfg
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
[IRC]
|
||||||
|
server = irc.foonetic.net
|
||||||
|
port = 6667
|
||||||
|
channel = #lh
|
||||||
|
nick = dr_devzo
|
||||||
|
name = dr. devzo
|
22
dr.botzo.py
Executable file
22
dr.botzo.py
Executable file
@ -0,0 +1,22 @@
|
|||||||
|
#!/usr/bin/env python3.1
|
||||||
|
|
||||||
|
from configparser import *
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
|
config = ConfigParser()
|
||||||
|
config.read([os.path.expanduser('~/.dr.botzo.cfg'), 'dr.botzo.cfg'])
|
||||||
|
|
||||||
|
try:
|
||||||
|
# load connection info
|
||||||
|
server = config.get('IRC', 'server')
|
||||||
|
port = config.getint('IRC', 'port')
|
||||||
|
channel = config.get('IRC', 'channel')
|
||||||
|
nick = config.get('IRC', 'nick')
|
||||||
|
ircname = config.get('IRC', 'name')
|
||||||
|
except NoSectionError as e:
|
||||||
|
sys.exit("Aborted due to error with necessary configuration: " + str(e))
|
||||||
|
except NoOptionError as e:
|
||||||
|
sys.exit("Aborted due to error with necessary configuration: " + str(e))
|
||||||
|
|
||||||
|
# vi:tabstop=4:expandtab:autoindent
|
Loading…
Reference in New Issue
Block a user