Commits

Anonymous committed c3ca542

Better local settings handling

  • Participants
  • Parent commits d1963e2

Comments (0)

Files changed (1)

     'pagination',
     'contact_form',
     # Transifex specific apps:
-    'transifex',    
+    'transifex',
     'vcs',
     'translations',
     'languages',
 # Default submit message format for decentralized VCSs. Backends can override
 # this.
 DVCS_SUBMIT_MSG = """%(message)s
-            
+
 Transmitted-via: Transifex (%(domain)s)"""
 
 ####################
 TRANS_CHOICES = {'POT': 'POT files',
                  'INTLTOOL': 'POT files using intltool',}
 
-# The classes which implement the TransHandler support. The full "path" 
+# The classes which implement the TransHandler support. The full "path"
 # to the class is the concatenation of the BASE and the NAME of the class.
 TRANS_CLASS_BASE = 'projects.handlers.types'
 TRANS_CLASS_NAMES = {'POT': 'pot.POTHandler',
 
 # Put any settings specific to the particular host in settings_local.py
 
+QUIT_ON_LOCAL_LOAD_FAILURE = True
+
+import sys
+import traceback
+
 try:
-    execfile('settings_local.py')
-except IOError:
-    pass
+    if os.path.exists('settings_local.py'):
+        execfile('settings_local.py')
+except StandardError, e:
+    print >> sys.stderr, 'Unable to load local settings: %r' % (e,)
+    print >> sys.stderr, 'Full traceback:'
+    traceback.print_exc(file=sys.stderr)
+    if QUIT_ON_LOCAL_LOAD_FAILURE:
+        sys.exit(1)