From 44176ad5d8c959245bf114007d35e00c1909a196 Mon Sep 17 00:00:00 2001 From: jason Date: Sat, 21 Jul 2012 05:37:53 -0600 Subject: Added support for an external settings file. --- settings.py | 12 ++++++++++++ warmachine.py | 6 ++++-- 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 settings.py diff --git a/settings.py b/settings.py new file mode 100644 index 0000000..7884422 --- /dev/null +++ b/settings.py @@ -0,0 +1,12 @@ +NICKNAME = 'warmachine' + +SERVER = 'irc.freenode.org' +PORT = 6667 +IDENT = 'warmachine' + +CHANNELS = ('#antitech-dev',) + +try: + from local_settings.py import * +except ImportError: + pass \ No newline at end of file diff --git a/warmachine.py b/warmachine.py index 1134c75..148ad65 100755 --- a/warmachine.py +++ b/warmachine.py @@ -92,7 +92,9 @@ class IRC(object): print e if __name__ == '__main__': - i = IRC('irc.freenode.org', 'warmachine', 'warmachine') + import settings + i = IRC(settings.SERVER, settings.NICKNAME, settings.IDENT) i.connect() - i.join('#antitech-dev') + for channel in settings.CHANNELS: + i.join(channel) i.MainLoop() -- cgit v1.2.1