diff roundup/templates/classic/instance_config.py @ 482:fdee2ff82b40 config-0-4-0-branch

Miscellaneous improvements * Altered function names in roundup.config to bE NeAtEr rather_than_ugly; * Created some extra roundup.config exceptions to let people know what's going on; * Modified instance_config.py to use those exceptions, so that syntax errors or other exceptions did *not* trigger the same behavior as import while in the templates/ directory. * Modified roundup.cgi to use the same neater function names, plus did some minor cleanup.
author Titus Brown <titus@users.sourceforge.net>
date Thu, 03 Jan 2002 08:28:17 +0000
parents a5cd27d33516
children
line wrap: on
line diff
--- a/roundup/templates/classic/instance_config.py	Thu Jan 03 04:28:21 2002 +0000
+++ b/roundup/templates/classic/instance_config.py	Thu Jan 03 08:28:17 2002 +0000
@@ -15,7 +15,7 @@
 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 # 
-# $Id: instance_config.py,v 1.10.2.1 2002-01-03 02:12:05 titus Exp $
+# $Id: instance_config.py,v 1.10.2.2 2002-01-03 08:28:17 titus Exp $
 
 import os
 import roundup.config
@@ -23,12 +23,12 @@
 # roundup home is this package's directory
 INSTANCE_HOME=os.path.dirname(__file__)
 
-base_config = roundup.config.load_base_config()
-instances_config = base_config.load_instances_config()
+base_config = roundup.config.loadBaseConfig()
+instances = base_config.loadInstances()
 
 try:
-    instance_name = instances_config.get_instance_name(INSTANCE_HOME)
-    instance_config = instances_config.load_instance_config(instance_name)
+    instance_name = instances.getNameFromDir(INSTANCE_HOME)
+    instance_config = instances.loadConfig(instance_name)
 
     # The SMTP mail host that roundup will use to send mail
     MAILHOST = instance_config.get('mail', 'host')
@@ -71,7 +71,7 @@
 
     # Where to place the email signature
     EMAIL_SIGNATURE_POSITION = instance_config.get('base', 'email_signature_position')
-except:                                 # probably in init
+except roundup.config.UnknownInstanceLocation: # in 'init'
     DATABASE = None
     TEMPLATES = None
     ADMIN_EMAIL = ''
@@ -100,6 +100,11 @@
 
 #
 # $Log: not supported by cvs2svn $
+# Revision 1.10.2.1  2002/01/03 02:12:05  titus
+#
+#
+# Initial ConfigParser implementation.
+#
 # Revision 1.10  2001/11/26 22:55:56  richard
 # Feature:
 #  . Added INSTANCE_NAME to configuration - used in web and email to identify

Roundup Issue Tracker: http://roundup-tracker.org/