Index: pykota/trunk/conf/pykota.conf.sample
===================================================================
--- pykota/trunk/conf/pykota.conf.sample (revision 852)
+++ pykota/trunk/conf/pykota.conf.sample (revision 853)
@@ -32,7 +32,9 @@
 # Where to log ?
 # supported values : stderr, system (system means syslog, but don't use 'syslog' here)
+# if the value is not set then the default SYSTEM applies.
 logger: system
 
 # Mail server to use to warn users
+# If the value is not set then localhost is used.
 smtpserver: localhost
 
@@ -44,4 +46,6 @@
 # These values can be set either globally or per printer or both.
 # If both are defined, the printer option has priority.
+# If these values are not set, the default admin root 
+# and the default adminmail root@localhost are used.
 admin: Jerome Alet
 adminmail: alet@librelogiciel.com
@@ -55,4 +59,5 @@
 # This value can be set either globally or per printer or both.
 # If both are defined, the printer option has priority.
+# If the value is not set, then the default BOTH applies.
 mailto: both
 
@@ -61,7 +66,9 @@
 # This value can be set either globally or per printer or both.
 # If both are defined, the printer option has priority.
+# If the value is not set then the default seven (7) days applies.
 gracedelay: 7
 
-# one section per printer, or no other section at all if all options are defined globally
+# one section per printer, or no other section at all if all options 
+# are defined globally
 [lp]
 
@@ -85,4 +92,5 @@
 # This value can be set either globally or per printer or both.
 # If both are defined, the printer option has priority.
+# If the value is not set then the default policy ALLOW applies.
 policy: allow
 
Index: pykota/trunk/pykota/config.py
===================================================================
--- pykota/trunk/pykota/config.py (revision 852)
+++ pykota/trunk/pykota/config.py (revision 853)
@@ -15,4 +15,8 @@
 #
 # $Log$
+# Revision 1.18  2003/03/16 08:00:50  jalet
+# Default hard coded options are now used if they are not set in the
+# configuration file.
+#
 # Revision 1.17  2003/03/15 23:01:28  jalet
 # New mailto option in configuration file added.
@@ -152,5 +156,8 @@
         """Returns the logging backend information."""
         validloggers = [ "stderr", "system" ] 
-        logger = self.getGlobalOption("logger").lower()
+        try :
+            logger = self.getGlobalOption("logger").lower()
+        except PyKotaConfigError :    
+            logger = "system"
         if logger not in validloggers :             
             raise PyKotaConfigError, _("Option logger only supports values in %s") % str(validloggers)
@@ -176,5 +183,8 @@
         """Returns the default policy for the current printer."""
         validpolicies = [ "ALLOW", "DENY" ]     
-        policy = self.getPrinterOption(printer, "policy").upper()
+        try :
+            policy = self.getPrinterOption(printer, "policy").upper()
+        except PyKotaConfigError :    
+            policy = "ALLOW"
         if policy not in validpolicies :
             raise PyKotaConfigError, _("Option policy in section %s only supports values in %s") % (printer, str(validpolicies))
@@ -183,18 +193,30 @@
     def getSMTPServer(self) :    
         """Returns the SMTP server to use to send messages to users."""
-        return self.getGlobalOption("smtpserver")
+        try :
+            return self.getGlobalOption("smtpserver")
+        except PyKotaConfigError :    
+            return "localhost"
         
     def getAdminMail(self, printer) :    
         """Returns the Email address of the Print Quota Administrator."""
-        return self.getPrinterOption(printer, "adminmail")
+        try :
+            return self.getPrinterOption(printer, "adminmail")
+        except PyKotaConfigError :    
+            return "root@localhost"
         
     def getAdmin(self, printer) :    
         """Returns the full name of the Print Quota Administrator."""
-        return self.getPrinterOption(printer, "admin")
+        try :
+            return self.getPrinterOption(printer, "admin")
+        except PyKotaConfigError :    
+            return "root"
         
     def getMailTo(self, printer) :    
         """Returns the recipient of email messages."""
         validmailtos = [ "DEVNULL", "BOTH", "USER", "ADMIN" ]
-        mailto = self.getPrinterOption(printer, "mailto").upper()
+        try :
+            mailto = self.getPrinterOption(printer, "mailto").upper()
+        except PyKotaConfigError :    
+            mailto = "BOTH"
         if mailto not in validmailtos :
             raise PyKotaConfigError, _("Option mailto in section %s only supports values in %s") % (printer, str(validmailtos))
@@ -203,5 +225,8 @@
     def getGraceDelay(self, printer) :    
         """Returns the grace delay in days."""
-        gd = self.getPrinterOption(printer, "gracedelay")
+        try :
+            gd = self.getPrinterOption(printer, "gracedelay")
+        except PyKotaConfigError :    
+            gd = 7
         try :
             return int(gd)
Index: pykota/trunk/NEWS
===================================================================
--- pykota/trunk/NEWS (revision 852)
+++ pykota/trunk/NEWS (revision 853)
@@ -26,4 +26,8 @@
             - Both means the User and the Admin will receive them.
             
+        - The configuration file now uses hard-coded default values
+          when an option is not set. See sample configuration file
+          for details.
+          
         - Manual pages are included since 1.00, but I forgot to    
           add this information to this file.
