CVS: tmda-cgi Templates.py,1.1,1.2

Gre7g Luterman <[email protected]>
Newsgroups gmane.mail.spam.tmda.cvs
Message-ID <[email protected]>
Update of /cvsroot/tmda/tmda-cgi
In directory sc8-pr-cvs1:/tmp/cvs-serv6918

Modified Files:
	Templates.py 
Log Message:
Search off of TMDA's root for template files if Defaults.TEMPLATE_DIR is not 
set.

Instead of just removing the save button when the user is not allowed to save
templates, replace it with some descriptive text.

Put template information into config file instead of .qmail files.


Index: Templates.py
===================================================================
RCS file: /cvsroot/tmda/tmda-cgi/Templates.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Templates.py	3 May 2003 16:54:51 -0000	1.1
+++ Templates.py	4 May 2003 14:30:36 -0000	1.2
@@ -41,9 +41,15 @@
   # Hide save button?
   if PVars[("NoOverride", "MayEditTemplates")][0].lower() == "n":
     T["SaveButton"]
+  else:
+    T["NoSave"]
 
   for BaseName in ("bounce", "confirm_accept", "confirm_request"):
-    Filename = os.path.join(Defaults.TEMPLATE_DIR, BaseName + ".txt")
+    if Defaults.TEMPLATE_DIR:
+      Filename = os.path.join(Defaults.TEMPLATE_DIR, BaseName + ".txt")
+    else:
+      Filename = os.path.join(os.environ["TMDA_BASE_DIR"], "templates",
+        BaseName + ".txt")
     T["Var"] = BaseName
 
     # Get file

_______________________________________
tmda-cvs mailing list
http://tmda.net/lists/listinfo/tmda-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.