1 # synarere -- a highly modular and stable IRC bot.
2 # Copyright (C) 2010 Michael Rodriguez.
3 # Rights to this code are documented in docs/LICENSE.
5 '''Initialization code.'''
7 __all__
= ['command', 'confparse', 'event', 'io', 'irc', 'logger', 'module', 'timer', 'var']
9 def shutdown(code
, reason
):
10 '''Exit gracefully.'''
14 # Import required Python functions.
18 # Import required source modules.
19 import logger
, var
, irc
, module
21 logger
.info('shutdown(): exiting with code %d: %s' % (code
, reason
))
22 irc
.quit_all('shutdown(): exiting with code %d: %s' % (code
, reason
))
25 # Remove the PID file.
27 pid_file
= open(var
.conf
.get('options', 'pidfile')[0], 'r')