CVS: tmda-cgi Install.py,1.11,1.12 TODO,1.17,1.18

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-serv30663

Modified Files:
	Install.py TODO 
Log Message:
Caught one more class of error in skel files.  Made error messages a tad more
clear.

Added better list editor to TODO list.


Index: Install.py
===================================================================
RCS file: /cvsroot/tmda/tmda-cgi/Install.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- Install.py	21 May 2003 05:09:31 -0000	1.11
+++ Install.py	21 May 2003 17:20:18 -0000	1.12
@@ -160,7 +160,10 @@
   while len(Dirs):
     os.mkdir(Dirs.pop())
 
-def Revert(Files, Backup, ErrStr):
+def Revert \
+(
+  Files, Backup, ErrStr, Recommend = "Check file permissions in home directory."
+):
   "Revert back to system before install."
 
   for File in Files: os.unlink(File)
@@ -170,8 +173,7 @@
     os.unlink(Backup)
   except OSError:
     pass
-  CgiUtil.TermError("Install aborted.", ErrStr, "install TMDA",
-    "", "Check file permissions in home directory.")
+  CgiUtil.TermError("Install aborted.", ErrStr, "install TMDA", "", Recommend)
 
 def ListDiff(a, b, Dict = None):
   "Take all items in b out of a."
@@ -195,36 +197,35 @@
 
   # Keep track of files copied so we can kill them on a failure
   Copied = []
-  Failed = []
 
   # Copy each file
   for File in FilesToCopy:
     # Get file
-    Filename = os.path.join(SrcDir, File)
-    F = open(Filename)
+    SrcFilename = os.path.join(SrcDir, File)
+    F = open(SrcFilename)
     Contents = F.read()
     F.close()
 
     # Put file
-    Filename = os.path.join(os.environ["HOME"], File) % Dict
+    DstFilename = os.path.join(os.environ["HOME"], File) % Dict
     try:
-      CheckDir(Filename)
-      F = open(Filename, "w")
+      CheckDir(DstFilename)
+      F = open(DstFilename, "w")
       F.write(Contents % Dict)
       F.close()
-      Copied.append(Filename)
+      Copied.append(DstFilename)
     except IOError, (ErrStr):
-      # Don't freak out over writes to parent directory
-      if (File[:3] == "../") or (File[:11] == "%(Parent)s/"):
-        Failed.append(File % Dict)
-      else:
-        # Install failed, revert!
-        Revert(Copied, Backup, "Saving file: %s<br>%s" % (Filename, ErrStr))
-    except (ValueError, TypeError), (ErrStr):
       # Install failed, revert!
-      Revert(Copied, Backup, "Expanding %%'s in: %s<br>%s" % (Filename,
-        ErrStr))
-  ListDiff(FilesToCopy, Failed, Dict)
+      Revert(Copied, Backup, "Saving file: %s<br>%s" % (DstFilename, ErrStr))
+    except (ValueError, TypeError, KeyError), (ErrStr):
+      # Install failed, revert!
+      Revert \
+      (
+        Copied, Backup, "Expanding %%'s in: %s<br>%s" % (SrcFilename, ErrStr),
+        """Fix errors in skel file(s).<br>
+Any "%" that should not be expanded during install <b><i>must</i></b> be
+replaced with a "%%"!"""
+      )
 
 def SetPerms(Anomalies, Files, Backup):
   "Set permissions as listed in anomalies"
@@ -369,8 +370,7 @@
       Filename = os.path.join(os.environ["HOME"], File)
       os.unlink(Filename)
     except OSError, (ErrStr):
-      if File[:3] != "../":
-        Revert([], Backup, "Erasing: %s<br>%s" % (Filename, ErrStr))
+      Revert([], Backup, "Erasing: %s<br>%s" % (Filename, ErrStr))
 
   # What files do we need to install?
   UninstallDir = os.path.join(os.getcwd(), "skel", "uninstall")

Index: TODO
===================================================================
RCS file: /cvsroot/tmda/tmda-cgi/TODO,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- TODO	21 May 2003 05:09:31 -0000	1.17
+++ TODO	21 May 2003 17:20:19 -0000	1.18
@@ -3,15 +3,14 @@
 
     * Custom Filter -- action for pending emails (Requested by Lloyd Zusman)
 
-    * Install -- catch failure if bad %(__)s in skel file
-
     * FAQ -- should this be made a CGI?  Add help on adding whitelist &
              blacklist options.
 
     * Filter Viewer -- graphic view of your filters
 
+    * List Editor -- current editor is fine for short lists, but lacking for
+                     long lists
+
     * Search -- for pending list and/or lists and filters
 
     * Tutorial -- finish section on mailing lists
-
-    * URL Confirmation -- virtual user support untested

_______________________________________
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.