[prev in list] [next in list] [prev in thread] [next in thread] 

List:       tmda-cvs
Subject:    CVS: tmda/TMDA ChangeLog,1.62,1.63 Defaults.py,1.56,1.57
From:       "Jason R. Mastaler" <jasonrm () users ! sourceforge ! net>
Date:       2001-09-19 16:58:42
[Download RAW message or body]

Update of /cvsroot/tmda/tmda/TMDA
In directory usw-pr-cvs1:/tmp/cvs-serv10519/TMDA

Modified Files:
	ChangeLog Defaults.py 
Log Message:
Add a global configuration file (/etc/tmdarc) that is read first
before ~/.tmdarc.  This allows the system administrator to provide a
global configuration for all users.


Index: ChangeLog
===================================================================
RCS file: /cvsroot/tmda/tmda/TMDA/ChangeLog,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -r1.62 -r1.63
--- ChangeLog	2001/09/19 16:23:38	1.62
+++ ChangeLog	2001/09/19 16:58:40	1.63
@@ -1,3 +1,8 @@
+2001-09-19  Jason R. Mastaler  <jasonrm@nightshade.la.mastaler.com>
+
+	* Defaults.py (GLOBAL_TMDARC): Add a global configuration file
+	(/etc/tmdarc) that is read first before ~/.tmdarc.  
+
 2001-09-18  Jason R. Mastaler  <jasonrm@nightshade.la.mastaler.com>
 
 	* Cookie.py (make_sender_cookie): Support variable length HMACs

Index: Defaults.py
===================================================================
RCS file: /cvsroot/tmda/tmda/TMDA/Defaults.py,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -r1.56 -r1.57
--- Defaults.py	2001/09/19 16:23:38	1.56
+++ Defaults.py	2001/09/19 16:58:40	1.57
@@ -3,8 +3,6 @@
 """TMDA configuration variable defaults."""
 
 
-# Make site-wide configuration changes to this file.  
-
 import os
 import stat
 import string
@@ -25,21 +23,31 @@
 DELIVERY_AGENT = 'TMDA ' + 'v' + TMDA_VERSION + '/Python ' + PYTHON_VERSION \
                  + ' (' + sys.platform + ')'
 
-# Exit codes: everything except 0, 99 and 100 are soft errors.
+# qmail exit codes: everything except 0, 99 and 100 are soft errors.
 ERR_OK = 0          # Success; look at the next .qmail file instruction.
 ERR_INTERNAL = 93   # This program has a bug!  How did that happen?
 ERR_CONFIG = 94     # Something wrong with the config-file; defer delivery.
 ERR_REMOTE = 95     # Remote user error.
-ERR_IO = 96         # Problem with, open, read, write, or close; defer delivery.
+ERR_IO = 96         # Problem with open, read, write, or close; defer delivery.
 ERR_STOP = 99       # Success, but don't look further in the .qmail file.
 ERR_HARD = 100      # Hard error; bounce message back to sender.
 ERR_SOFT = 111      # Soft error; defer delivery.
 
-# Look for the config-file in the environment first then default to ~/.tmdarc.
+# If the file /etc/tmdarc exists, read it before ~/.tmdarc.
+# Make site-wide configuration changes to this file.
+GLOBAL_TMDARC = '/etc/tmdarc'
+if os.path.exists(GLOBAL_TMDARC):
+    try:
+        execfile(GLOBAL_TMDARC)
+    except IOError:
+        pass                            # just skip it if we can't open it
+    
+# Look for the user-config-file in the environment first then default
+# to ~/.tmdarc.
 TMDARC = os.environ.get('TMDARC')
 if not TMDARC:TMDARC = os.path.expanduser("~/.tmdarc")
 
-# Read-in the user's configuration file first.
+# Read-in the user's configuration file.
 if not os.path.exists(TMDARC):
     print "Can't open configuration file:",TMDARC
     sys.exit(ERR_CONFIG)
@@ -68,15 +76,13 @@
 # User configurable settings
 ############################
 
-# Only compute defaults for settings not in user's ~/.tmdarc to speed
-# startup.
+# Only compute defaults for unset variables to speed startup.
 
 # DATADIR
 # Top-level directory which TMDA uses to store its files and
 # directories.  TMDA should be free to create files and directories
 # under DATADIR if need be.  Make sure to include a trailing "/".
 # Default is ~/.tmda/
-
 if not vars().has_key('DATADIR'):
     DATADIR = os.path.expanduser("~/.tmda/")
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic