Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Move more exceptions into lib, catch config errors

  • Loading branch information...
commit 365e88519bce4f3396db3af75b45636074de64b9 1 parent 8953d70
@richo richo authored
Showing with 12 additions and 8 deletions.
  1. +1 −4 config.py
  2. +1 −1  ircSocket.py
  3. +4 −0 lib.py
  4. +6 −3 pyBawt.py
View
5 config.py
@@ -8,11 +8,8 @@
import logging
import os
+from lib import *
-class InvalidConfig(Exception):
- pass
-class NoConfigFile(Exception):
- pass
CONFIG_FILE = 'pyBawt.conf'
View
2  ircSocket.py
@@ -1,3 +1,4 @@
+from lib import *
import threading
import socket
import sys
@@ -13,7 +14,6 @@
import auth
import logging
-from lib import *
def should_reconnect():
"""This hook lies in here because it'll give the rest of the structure a fairly central place
View
4 lib.py
@@ -42,3 +42,7 @@ class StopHandling(Exception):
class ModuleAlreadyLoaded(Exception):
pass
+class InvalidConfig(Exception):
+ pass
+class NoConfigFile(Exception):
+ pass
View
9 pyBawt.py
@@ -11,18 +11,21 @@
##
# Rich Healey '08
+from lib import *
+import logging
+try:
+ import config
+except InvalidConfig:
+ logging.fatal("Couldn't load config file")
import ircSocket
import time
import sys
import os
import random
-import config
import bModules
-import logging
import traceback
-from lib import *
logging.info("pyBawt started")
Please sign in to comment.
Something went wrong with that request. Please try again.