coderev-0.1/codediff.py | coderev-0.2/codediff.py | ||||
---|---|---|---|---|---|
3 | # Homepage: http://code.google.com/p/coderev | 3 | # Homepage: http://code.google.com/p/coderev | ||
4 | # License: GPLv2, see "COPYING" | 4 | # License: GPLv2, see "COPYING" | ||
5 | # | 5 | # | ||
n | 6 | # $Id: codediff.py 3 2008-08-19 04:06:17Z mattwyl $ | n | 6 | # $Id: codediff.py 9 2008-08-21 14:08:53Z mattwyl $ |
7 | 7 | ||||
8 | '''Diff two files/directories and produce HTML pages.''' | 8 | '''Diff two files/directories and produce HTML pages.''' | ||
9 | 9 | ||||
10 | import sys, os, stat, errno, time, re, difflib, filecmp | 10 | import sys, os, stat, errno, time, re, difflib, filecmp | ||
11 | 11 | ||||
12 | _myname = os.path.basename(sys.argv[0]) | 12 | _myname = os.path.basename(sys.argv[0]) | ||
n | 13 | _revision = '$Revision: 3 $'.split()[1] | n | 13 | _revision = '$Revision: 9 $'.split()[1] |
14 | 14 | ||||
15 | 15 | ||||
16 | ########## globals & templates begin ########## | 16 | ########## globals & templates begin ########## | ||
148 | Generated by %(myname)s r%(revision)s at %(time)s | 148 | Generated by %(myname)s r%(revision)s at %(time)s | ||
149 | </i>""" | 149 | </i>""" | ||
150 | 150 | ||||
n | 151 | _global_dir_ignore_list = [ | n | 151 | _global_dir_ignore_list = ( |
152 | '\bCVS$', | 152 | r'^CVS$', | ||
153 | '\bSCCS$', | 153 | r'^SCCS$', | ||
154 | '\b\\.svn$', | 154 | r'^\.svn$', | ||
155 | ] | 155 | ) | ||
156 | 156 | ||||
n | 157 | _global_file_ignore_list = [ | n | 157 | _global_file_ignore_list = ( |
158 | '.*\\.o$', | 158 | r'.*\.o$', | ||
159 | '.*\\.swp$', | 159 | r'.*\.swp$', | ||
160 | '.*\\.bak$', | 160 | r'.*\.bak$', | ||
161 | '.*\\.old$', | 161 | r'.*\.old$', | ||
162 | '.*\\~$', | 162 | r'.*~$', | ||
163 | '\\.cvsignore$', | 163 | r'^\.cvsignore$', | ||
164 | ] | 164 | ) | ||
165 | ########## globals & templates end ########## | 165 | ########## globals & templates end ########## | ||
166 | 166 | ||||
167 | 167 | ||||
285 | plen = len(prefix) | 285 | plen = len(prefix) | ||
286 | 286 | ||||
287 | for root, dirs, files in os.walk(dir): | 287 | for root, dirs, files in os.walk(dir): | ||
t | 288 | for d in dirs: | t | 288 | for d in [k for k in dirs]: |
289 | if inIgnoreList(d, _global_dir_ignore_list): | 289 | if inIgnoreList(d, _global_dir_ignore_list): | ||
290 | dirs.remove(d) | 290 | dirs.remove(d) | ||
291 | for f in files: | 291 | for f in files: |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|