Skip to content
Browse files

Updated to allow for external hook files

  • Loading branch information...
1 parent f7eb816 commit 77ddb18f02e8bce2161c9cbcc162de9ccbfb9bcd Dustin Lacewell committed Apr 1, 2011
Showing with 5 additions and 2 deletions.
  1. BIN capn/__init__.pyc
  2. +5 −2 capn/config.py
  3. BIN capn/config.pyc
  4. BIN capn/util.pyc
View
BIN capn/__init__.pyc
Binary file not shown.
View
7 capn/config.py
@@ -39,12 +39,15 @@ def get_configuration():
return config
def add_external_hook(filename, path, hooktype=DEFAULT_TYPE,
- enter=None, exit=None):
+ enter=[], exit=[]):
'''
Will add an external hook to the YAML specfified
YAML file.
'''
- config = load_yaml(filename)
+ if os.path.isfile(filename):
+ config = load_yaml(filename)
+ else:
+ config = {'hooks': []}
hook = {'path': path, 'type': hooktype}
if enter:
hook['enter'] = enter
View
BIN capn/config.pyc
Binary file not shown.
View
BIN capn/util.pyc
Binary file not shown.

0 comments on commit 77ddb18

Please sign in to comment.
Something went wrong with that request. Please try again.