Code

- unify number searching across backends
[roundup.git] / roundup / install_util.py
index 4e07a5b464b801442204ab72bdceb976bef34460..51becb0880fffc929ee93ee67a914d96392ababa 100644 (file)
 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 # 
-# $Id: install_util.py,v 1.9 2003-11-11 22:37:25 richard Exp $
+# $Id: install_util.py,v 1.11 2006-01-25 03:11:43 richard Exp $
 
-__doc__ = """
-Support module to generate and check fingerprints of installed files.
+"""Support module to generate and check fingerprints of installed files.
 """
+__docformat__ = 'restructuredtext'
 
-import os, sha, shutil
+import os, shutil
+from roundup.anypy.hashlib_ import sha1
 
-# ".filter", ".index", ".item", ".newitem" are roundup-specific
-sgml_file_types = [".xml", ".ent", ".html", ".filter", ".index", ".item", ".newitem"]
-hash_file_types = [".py", ".sh", ".conf", ".cgi", '']
+sgml_file_types = [".xml", ".ent", ".html"]
+hash_file_types = [".py", ".sh", ".conf", ".cgi"]
 slast_file_types = [".css"]
 
 digested_file_types = sgml_file_types + hash_file_types + slast_file_types
@@ -60,7 +60,7 @@ def checkDigest(filename):
     del lines[-1]
 
     # calculate current digest
-    digest = sha.new()
+    digest = sha1()
     for line in lines:
         digest.update(line)
 
@@ -75,7 +75,7 @@ class DigestFile:
 
     def __init__(self, filename):
         self.filename = filename
-        self.digest = sha.new()
+        self.digest = sha1()
         self.file = open(self.filename, "w")
 
     def write(self, data):