comparison roundup/install_util.py @ 385:66e18fd9f5a2

bleah typo
author Richard Jones <richard@users.sourceforge.net>
date Mon, 12 Nov 2001 22:38:48 +0000
parents a72ad731b2cb
children c066d3c91728
comparison
equal deleted inserted replaced
384:a72ad731b2cb 385:66e18fd9f5a2
13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" 14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS"
15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, 15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
17 # 17 #
18 # $Id: install_util.py,v 1.2 2001-11-12 22:37:13 richard Exp $ 18 # $Id: install_util.py,v 1.3 2001-11-12 22:38:48 richard Exp $
19 19
20 import os, sha 20 import os, sha
21 21
22 22
23 def checkDigest(filename): 23 def checkDigest(filename):
35 # handle xml/html files 35 # handle xml/html files
36 fingerprint = lines[-1][10:] 36 fingerprint = lines[-1][10:]
37 fingerprint = fingerprint.replace('-->', '') 37 fingerprint = fingerprint.replace('-->', '')
38 fingerprint = fingerprint.strip() 38 fingerprint = fingerprint.strip()
39 elif lines[-1][:8] == "/* SHA: ": 39 elif lines[-1][:8] == "/* SHA: ":
40 # handle css files
40 fingerprint = lines[-1][8:] 41 fingerprint = lines[-1][8:]
41 fingerprint = fingerprint.replace('*/', '') 42 fingerprint = fingerprint.replace('*/', '')
42 fingerprint = fingerprint.strip() 43 fingerprint = fingerprint.strip()
43 else: 44 else:
44 return 0 45 return 0
74 if ext in [".xml", ".ent", ".html", ".filter", ".index", ".item"]: 75 if ext in [".xml", ".ent", ".html", ".filter", ".index", ".item"]:
75 self.file.write("<!-- SHA: %s -->\n" % (self.digest.hexdigest(),)) 76 self.file.write("<!-- SHA: %s -->\n" % (self.digest.hexdigest(),))
76 elif ext in [".py", ".sh", ".conf", ".cgi", '']: 77 elif ext in [".py", ".sh", ".conf", ".cgi", '']:
77 self.file.write("#SHA: %s\n" % (self.digest.hexdigest(),)) 78 self.file.write("#SHA: %s\n" % (self.digest.hexdigest(),))
78 elif ext in [".css"]: 79 elif ext in [".css"]:
79 self.file.write("/* SHA: %s %/\n" % (self.digest.hexdigest(),)) 80 self.file.write("/* SHA: %s */\n" % (self.digest.hexdigest(),))
80 81
81 self.file.close() 82 self.file.close()
82 83
83 84
84 def test(): 85 def test():
106 if __name__ == '__main__': 107 if __name__ == '__main__':
107 test() 108 test()
108 109
109 # 110 #
110 # $Log: not supported by cvs2svn $ 111 # $Log: not supported by cvs2svn $
112 # Revision 1.2 2001/11/12 22:37:13 richard
113 # Handle all the various file formats in roundup
114 #
111 # Revision 1.1 2001/11/12 22:26:32 jhermann 115 # Revision 1.1 2001/11/12 22:26:32 jhermann
112 # Added install utils (digest calculation) 116 # Added install utils (digest calculation)
113 # 117 #
114 118

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