diff options
| author | jason | 2012-07-21 05:37:53 -0600 |
|---|---|---|
| committer | jason | 2012-07-21 05:37:53 -0600 |
| commit | 44176ad5d8c959245bf114007d35e00c1909a196 (patch) | |
| tree | afb8cc286c5a14c029d84a908affcd0f1c9e4a78 | |
| parent | a195443e5eb259a63de0a55ba9b1df5c757067ed (diff) | |
| download | warmachine-44176ad5d8c959245bf114007d35e00c1909a196.tar.gz warmachine-44176ad5d8c959245bf114007d35e00c1909a196.zip | |
Added support for an external settings file.
| -rw-r--r-- | settings.py | 12 | ||||
| -rwxr-xr-x | warmachine.py | 6 |
2 files changed, 16 insertions, 2 deletions
diff --git a/settings.py b/settings.py new file mode 100644 index 0000000..7884422 --- /dev/null +++ b/settings.py | |||
| @@ -0,0 +1,12 @@ | |||
| 1 | NICKNAME = 'warmachine' | ||
| 2 | |||
| 3 | SERVER = 'irc.freenode.org' | ||
| 4 | PORT = 6667 | ||
| 5 | IDENT = 'warmachine' | ||
| 6 | |||
| 7 | CHANNELS = ('#antitech-dev',) | ||
| 8 | |||
| 9 | try: | ||
| 10 | from local_settings.py import * | ||
| 11 | except ImportError: | ||
| 12 | 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): | |||
| 92 | print e | 92 | print e |
| 93 | 93 | ||
| 94 | if __name__ == '__main__': | 94 | if __name__ == '__main__': |
| 95 | i = IRC('irc.freenode.org', 'warmachine', 'warmachine') | 95 | import settings |
| 96 | i = IRC(settings.SERVER, settings.NICKNAME, settings.IDENT) | ||
| 96 | i.connect() | 97 | i.connect() |
| 97 | i.join('#antitech-dev') | 98 | for channel in settings.CHANNELS: |
| 99 | i.join(channel) | ||
| 98 | i.MainLoop() | 100 | i.MainLoop() |