logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

CVS: tmda-cgi ChangeLog, 1.79, 1.80 EditFilter.py, 1.4, 1.5 EditList.py, 1.: msg#00034

Subject: CVS: tmda-cgi ChangeLog, 1.79, 1.80 EditFilter.py, 1.4, 1.5 EditList.py, 1.13, 1.14 GenAddr.py, 1.5, 1.6 GlobalConfig.py, 1.2, 1.3 Info.py, 1.4, 1.5 Install.py, 1.31, 1.32 LocalConfig.py, 1.9, 1.10 PendList.py, 1.36, 1.37 Session.py, 1.40, 1.41 Template.py, 1.10, 1.11 Templates.py, 1.5, 1.6 TestAddr.py, 1.2, 1.3 Theme.py, 1.7, 1.8 View.py, 1.23, 1.24 defaults.ini, 1.26, 1.27
Update of /cvsroot/tmda/tmda-cgi
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26497

Modified Files:
        ChangeLog EditFilter.py EditList.py GenAddr.py GlobalConfig.py 
        Info.py Install.py LocalConfig.py PendList.py Session.py 
        Template.py Templates.py TestAddr.py Theme.py View.py 
        defaults.ini 
Log Message:
Made the text size in the TMDA-X theme user-configurable.

As a side effect, themability overall improves:
- Theme designers can set any value in the "Theme" section of theme.ini
- This value can be altered by the "theme.html" page
- This value is also available in any HTML Template.

For an example, see how I use "SidebarSize" in the TMDA-X theme.


Index: ChangeLog
===================================================================
RCS file: /cvsroot/tmda/tmda-cgi/ChangeLog,v
retrieving revision 1.79
retrieving revision 1.80
diff -u -r1.79 -r1.80
--- ChangeLog   11 Mar 2004 16:38:30 -0000      1.79
+++ ChangeLog   18 Mar 2004 17:54:17 -0000      1.80
@@ -1,3 +1,10 @@
+2004-03-18  Jim Ramsay      <i.am@xxxxxxxxxxxxx>
+
+       * Made text-size in TMDA-X theme user-configurable
+
+       * Now theme designers can define, user-configure, and access theme
+         variables.  (Previously could just define and configure)
+
 2004-03-11  Jim Ramsay     <i.am@xxxxxxxxxxxxx>
 
        * Fixes for Solaris

Index: EditFilter.py
===================================================================
RCS file: /cvsroot/tmda/tmda-cgi/EditFilter.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- EditFilter.py       23 Aug 2003 18:55:52 -0000      1.4
+++ EditFilter.py       18 Mar 2004 17:54:17 -0000      1.5
@@ -34,10 +34,10 @@
 
   # Load the display template
   if Form["cmd"].value == "incoming":
-    T = Template.Template("incoming.html")
+    T = Template.Template("incoming.html", PVars = PVars)
     T["FilePath"] = Filename = CgiUtil.ExpandUser(Defaults.FILTER_INCOMING)
   else:
-    T = Template.Template("outgoing.html")
+    T = Template.Template("outgoing.html", PVars = PVars)
     T["FilePath"] = Filename = CgiUtil.ExpandUser(Defaults.FILTER_OUTGOING)
 
   # Get file

Index: EditList.py
===================================================================
RCS file: /cvsroot/tmda/tmda-cgi/EditList.py,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- EditList.py 17 Mar 2004 18:23:57 -0000      1.13
+++ EditList.py 18 Mar 2004 17:54:17 -0000      1.14
@@ -43,7 +43,7 @@
   "Edit any plaintext list file."
 
   # Load the display template
-  T = Template.Template("editlist.html")
+  T = Template.Template("editlist.html", PVars = PVars)
   NoneList = T["NoneList"]
   List = ""
 

Index: GenAddr.py
===================================================================
RCS file: /cvsroot/tmda/tmda-cgi/GenAddr.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- GenAddr.py  6 Aug 2003 02:14:02 -0000       1.5
+++ GenAddr.py  18 Mar 2004 17:54:17 -0000      1.6
@@ -31,7 +31,7 @@
   "Generate dynamic addresses."
 
   # Load the display template
-  T = Template.Template("gen_addr.html")
+  T = Template.Template("gen_addr.html", PVars = PVars)
 
   # Not sure yet which form we'll use, so put something in each field.
   T["Keyword"]     = PVars[("GenAddr", "Keyword")]

Index: GlobalConfig.py
===================================================================
RCS file: /cvsroot/tmda/tmda-cgi/GlobalConfig.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- GlobalConfig.py     20 Apr 2003 15:27:38 -0000      1.2
+++ GlobalConfig.py     18 Mar 2004 17:54:17 -0000      1.3
@@ -29,7 +29,7 @@
   "Show global config file."
 
   # Load the display template
-  T = Template.Template("globalconfig.html")
+  T = Template.Template("globalconfig.html", PVars = PVars)
 
   # Get file
   T["FilePath"] = Defaults.GLOBAL_TMDARC

Index: Info.py
===================================================================
RCS file: /cvsroot/tmda/tmda-cgi/Info.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- Info.py     9 May 2003 05:04:59 -0000       1.4
+++ Info.py     18 Mar 2004 17:54:17 -0000      1.5
@@ -109,7 +109,7 @@
   global T, AckRow, ContRow, ToDoRow, BugCell, BugRow, BugCols, IncludeRow
 
   # Load the display template
-  T = Template.Template("info.html")
+  T = Template.Template("info.html", PVars = PVars)
 
   # Fill in variables
   T["CgiVersion"]  = All

Index: Install.py
===================================================================
RCS file: /cvsroot/tmda/tmda-cgi/Install.py,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- Install.py  17 Mar 2004 15:32:31 -0000      1.31
+++ Install.py  18 Mar 2004 17:54:17 -0000      1.32
@@ -398,7 +398,7 @@
   Defaults = ReimportDefaults(FilesToInstall, Backup)
 
   # Prepare template
-  T = Template.Template("installed.html")
+  T = Template.Template("installed.html", PVars = PVars)
   T["EMail"] = "%s@%s" % (Defaults["USERNAME"], Defaults["HOSTNAME"])
   Row = T["Row"]
   if len(FilesClobbered):
@@ -500,7 +500,7 @@
 
   # Prepare template
   from TMDA import Defaults
-  T = Template.Template("uninstalled.html")
+  T = Template.Template("uninstalled.html", PVars = PVars)
   T["EMail"] = "%s@%s" % (Defaults.USERNAME, Defaults.HOSTNAME)
   T["Archive"] = PVars[("NoOverride", "UninstallBackupTGZ")]
   Row    = T["Row"]
@@ -610,7 +610,7 @@
   Defaults = ReimportDefaults(FilesToInstall, Backup)
 
   # Prepare template
-  T = Template.Template("installed.html")
+  T = Template.Template("installed.html", PVars = PVars)
   T["EMail"] = "%s@%s" % (Defaults["USERNAME"], Defaults["HOSTNAME"])
   Row = T["Row"]
   if len(FilesClobbered):
@@ -701,7 +701,7 @@
       TemplateFN = "welcome.html"
 
   # Load template
-  T = Template.Template(TemplateFN)
+  T = Template.Template(TemplateFN, PVars = PVars)
 
   # Javascript confirmation?
   if PVars.has_key(["General", "UseJSConfirm"]) and \

Index: LocalConfig.py
===================================================================
RCS file: /cvsroot/tmda/tmda-cgi/LocalConfig.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- LocalConfig.py      16 Mar 2004 17:49:07 -0000      1.9
+++ LocalConfig.py      18 Mar 2004 17:54:17 -0000      1.10
@@ -117,7 +117,7 @@
   global AssignVar, Assignments, Config, LineNum, LastLine
 
   # Load the display template
-  T = Template.Template("localconfig.html")
+  T = Template.Template("localconfig.html", PVars = PVars)
   T["ErrMsg"] = "Displaying requested view. Click on filename to toggle."
   ErrStr = None
 

Index: PendList.py
===================================================================
RCS file: /cvsroot/tmda/tmda-cgi/PendList.py,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- PendList.py 18 Feb 2004 16:49:53 -0000      1.36
+++ PendList.py 18 Mar 2004 17:54:17 -0000      1.37
@@ -246,7 +246,7 @@
       del PVars["InProcess"][PMsg]
 
   # Load the display template
-  T = Template.Template("pending.html")
+  T = Template.Template("pending.html", PVars = PVars)
   T["CharSet"] = "utf-8"
   T["MsgID"]   = ""
 

Index: Session.py
===================================================================
RCS file: /cvsroot/tmda/tmda-cgi/Session.py,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -r1.40 -r1.41
--- Session.py  11 Mar 2004 15:21:39 -0000      1.40
+++ Session.py  18 Mar 2004 17:54:17 -0000      1.41
@@ -202,6 +202,8 @@
     # Get system defaults
     self.PVars = {}
     self.ThemeVars = ConfigParser.ConfigParser()
+    # Make this case-sensitive
+    self.ThemeVars.optionxform = str
     Filename  = os.path.join(os.getcwd(), "defaults.ini")
     self.ThemeVars.read(Filename)
     if len(self.ThemeVars.sections()) < 2:
@@ -526,3 +528,9 @@
     else:
       return self.PVars.has_key(":".join(a)) or \
         self.ThemeVars.has_option(a[0], a[1])
+
+  def keys( self ):
+    return self.PVars.keys()
+
+  def vars( self, section ):
+    return self.ThemeVars.options( section )

Index: Template.py
===================================================================
RCS file: /cvsroot/tmda/tmda-cgi/Template.py,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- Template.py 23 Jul 2003 17:46:21 -0000      1.10
+++ Template.py 18 Mar 2004 17:54:17 -0000      1.11
@@ -138,7 +138,8 @@
 
   def __init__ \
   (
-    self, Filename = None, BoilerPlate = None, SubTemplate = None, Name = None
+    self, Filename = None, BoilerPlate = None, SubTemplate = None, Name = None,
+    PVars = None
   ):
     "Constructor."
     self.BoilerPlate = BoilerPlate
@@ -151,8 +152,17 @@
       F = open("%s/%s" % (self.BaseDir, Filename))
       self.HTML = [self.LonePctSearch.sub(self.LonePctRepl, F.read())]
       F.close()
+    # Import the "Theme" section from PVars,
+    # to allow Themes to use custom settings
+    if PVars:
+      for var in PVars.vars( "Theme" ):
+       self.Dict[ var ] = PVars[ "Theme", var ]
     self.Items = {}
 
+  def refreshPVars( self, PVars ):
+    for var in PVars.vars( "Theme" ):
+      self.Dict[ var ] = PVars[ "Theme", var ]
+
   def __setitem__(self, Index, Value):
     "Assign a substitution variable."
     if self.Items.has_key(Index):

Index: Templates.py
===================================================================
RCS file: /cvsroot/tmda/tmda-cgi/Templates.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- Templates.py        18 Feb 2004 17:16:08 -0000      1.5
+++ Templates.py        18 Mar 2004 17:54:17 -0000      1.6
@@ -35,7 +35,7 @@
   global AssignVar, Assignments, Config, LineNum, LastLine
 
   # Load the display template
-  T = Template.Template("templates.html")
+  T = Template.Template("templates.html", PVars = PVars)
   Row = T["Row"]
 
   # Hide save button?

Index: TestAddr.py
===================================================================
RCS file: /cvsroot/tmda/tmda-cgi/TestAddr.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- TestAddr.py 15 Nov 2003 17:03:54 -0000      1.2
+++ TestAddr.py 18 Mar 2004 17:54:17 -0000      1.3
@@ -34,7 +34,7 @@
   "Test dynamic addresses."
 
   # Load the display template
-  T = Template.Template("test_addr.html")
+  T = Template.Template("test_addr.html", PVars = PVars)
   Sender  = T["Sender"]
   Results = T["ShowResults"]
 

Index: Theme.py
===================================================================
RCS file: /cvsroot/tmda/tmda-cgi/Theme.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- Theme.py    15 Dec 2003 16:33:52 -0000      1.7
+++ Theme.py    18 Mar 2004 17:54:17 -0000      1.8
@@ -42,7 +42,7 @@
     PVars.GetTheme()
 
   # Load the display template
-  T = Template.Template("theme.html")
+  T = Template.Template("theme.html", PVars = PVars)
 
   # Find the available themes
   Themes = os.listdir(ThemesDir)
@@ -94,6 +94,7 @@
       else:
         PVars[Parts[0:2]] = ""
     PVars.Save()
+    T.refreshPVars( PVars )
 
   # Find any theme vars they let us configure
   for Var in FormVars:

Index: View.py
===================================================================
RCS file: /cvsroot/tmda/tmda-cgi/View.py,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- View.py     18 Feb 2004 17:09:50 -0000      1.23
+++ View.py     18 Mar 2004 17:54:17 -0000      1.24
@@ -90,7 +90,7 @@
   Queue._loadCache()
 
   # Get e-mail template
-  T = Template.Template("view.html")
+  T = Template.Template("view.html", PVars = PVars)
   T["EmailClass"] = PVars[("ViewPending", "EmailClass")]
 
   # Locate messages in pending dir

Index: defaults.ini
===================================================================
RCS file: /cvsroot/tmda/tmda-cgi/defaults.ini,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- defaults.ini        11 Mar 2004 16:38:30 -0000      1.26
+++ defaults.ini        18 Mar 2004 17:54:17 -0000      1.27
@@ -103,4 +103,4 @@
 # file permissions.
 [AccessPaths]
 A           = ^%(Home)s/
-B           = ^/etc/tmdarc$
+b           = ^/etc/tmdarc$



<Prev in Thread] Current Thread [Next in Thread>