diff roundup/install_util.py @ 384:a72ad731b2cb

Handle all the various file formats in roundup
author Richard Jones <richard@users.sourceforge.net>
date Mon, 12 Nov 2001 22:37:13 +0000
parents a213e2a90364
children 66e18fd9f5a2
line wrap: on
line diff
--- a/roundup/install_util.py	Mon Nov 12 22:26:32 2001 +0000
+++ b/roundup/install_util.py	Mon Nov 12 22:37:13 2001 +0000
@@ -15,7 +15,7 @@
 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 # 
-# $Id: install_util.py,v 1.1 2001-11-12 22:26:32 jhermann Exp $
+# $Id: install_util.py,v 1.2 2001-11-12 22:37:13 richard Exp $
 
 import os, sha
 
@@ -32,10 +32,14 @@
         # handle .py/.sh comment
         fingerprint = lines[-1][6:].strip()
     elif lines[-1][:10] == "<!-- SHA: ":
-        # handle xml files
+        # handle xml/html files
         fingerprint = lines[-1][10:]
         fingerprint = fingerprint.replace('-->', '')
         fingerprint = fingerprint.strip()
+    elif lines[-1][:8] == "/* SHA: ":
+        fingerprint = lines[-1][8:]
+        fingerprint = fingerprint.replace('*/', '')
+        fingerprint = fingerprint.strip()
     else:
         return 0
     del lines[-1]
@@ -66,10 +70,13 @@
     def close(self):
         file, ext = os.path.splitext(self.filename)
 
-        if ext in [".xml", ".ent"]:
+        # ".filter", ".index", ".item" are roundup-specific
+        if ext in [".xml", ".ent", ".html", ".filter", ".index", ".item"]:
             self.file.write("<!-- SHA: %s -->\n" % (self.digest.hexdigest(),))
-        elif ext in [".py", ".sh", ".conf", '']:
+        elif ext in [".py", ".sh", ".conf", ".cgi", '']:
             self.file.write("#SHA: %s\n" % (self.digest.hexdigest(),))
+        elif ext in [".css"]:
+            self.file.write("/* SHA: %s %/\n" % (self.digest.hexdigest(),))
 
         self.file.close()
 
@@ -101,4 +108,7 @@
 
 #
 # $Log: not supported by cvs2svn $
+# Revision 1.1  2001/11/12 22:26:32  jhermann
+# Added install utils (digest calculation)
+#
 

Roundup Issue Tracker: http://roundup-tracker.org/