SF.net SVN: tmda: [2184] branches/tmda-cgi-0.16

[email protected] Mon, 16 Apr 2007 09:29:08 -0700
Newsgroups gmane.mail.spam.tmda.cvs
Message-ID <[email protected]>
Revision: 2184
          http://svn.sourceforge.net/tmda/?rev=2184&view=rev
Author:   lack
Date:     2007-04-16 09:29:01 -0700 (Mon, 16 Apr 2007)

Log Message:
-----------
Fixed ugly error messages when the Theme vars haven't yet been initalized (for
example, when releasing a message that doesn't exist).

Modified Paths:
--------------
    branches/tmda-cgi-0.16/Session.py
    branches/tmda-cgi-0.16/Template.py

Modified: branches/tmda-cgi-0.16/Session.py
===================================================================
--- branches/tmda-cgi-0.16/Session.py	2007-03-29 18:51:13 UTC (rev 2183)
+++ branches/tmda-cgi-0.16/Session.py	2007-04-16 16:29:01 UTC (rev 2184)
@@ -228,6 +228,8 @@
       os.environ["USER"] = self.Vars["User"]
       os.environ["LOGNAME"] = self.Vars["User"]
 
+    self.hasVars = True 
+
     # Clean up
     self.CleanUp()
 
@@ -308,6 +310,7 @@
   def __init__(self, Form):
     "Reload an existing SID or create a new one."
 
+    self.hasVars = False
     global Defaults
 
     # Existing, valid looking session?

Modified: branches/tmda-cgi-0.16/Template.py
===================================================================
--- branches/tmda-cgi-0.16/Template.py	2007-03-29 18:51:13 UTC (rev 2183)
+++ branches/tmda-cgi-0.16/Template.py	2007-04-16 16:29:01 UTC (rev 2184)
@@ -154,7 +154,7 @@
       F.close()
     # Import the "Theme" section from PVars,
     # to allow Themes to use custom settings
-    if PVars:
+    if PVars and PVars.hasVars:
       for var in PVars.vars( "Theme" ):
         self.Dict[ var ] = PVars[ "Theme", var ]
     self.Items = {}


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.