OLD | NEW |
1 # -*- coding: utf-8 -*- | 1 # -*- coding: utf-8 -*- |
2 | 2 |
3 import codecs | 3 import codecs |
4 import difflib | 4 import difflib |
5 import errno | 5 import errno |
6 import functools | 6 import functools |
7 import glob | 7 import glob |
8 import html | 8 import html |
9 import math | 9 import math |
10 import optparse | 10 import optparse |
(...skipping 1249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1260 | 1260 |
1261 | 1261 |
1262 def compare_tree_pairs (tree_pairs, dest_dir, threshold): | 1262 def compare_tree_pairs (tree_pairs, dest_dir, threshold): |
1263 """Compare a list of directories.""" | 1263 """Compare a list of directories.""" |
1264 data = ComparisonData () | 1264 data = ComparisonData () |
1265 for dir1, dir2 in tree_pairs: | 1265 for dir1, dir2 in tree_pairs: |
1266 data.compare_trees (dir1, dir2) | 1266 data.compare_trees (dir1, dir2) |
1267 | 1267 |
1268 data.read_sources () | 1268 data.read_sources () |
1269 | 1269 |
1270 data.print_results (threshold) | |
1271 | |
1272 if os.path.isdir (dest_dir): | 1270 if os.path.isdir (dest_dir): |
1273 system ('rm -rf %s '% dest_dir) | 1271 system ('rm -rf %s '% dest_dir) |
1274 | 1272 |
1275 data.write_changed (dest_dir, threshold) | 1273 data.write_changed (dest_dir, threshold) |
1276 data.create_html_result_page (dest_dir, threshold) | 1274 data.create_html_result_page (dest_dir, threshold) |
1277 data.create_text_result_page (dest_dir, threshold) | 1275 data.create_text_result_page (dest_dir, threshold) |
| 1276 data.print_results (threshold) |
| 1277 |
1278 | 1278 |
1279 | 1279 |
1280 ################################################################ | 1280 ################################################################ |
1281 # TESTING | 1281 # TESTING |
1282 | 1282 |
1283 def mkdir (x): | 1283 def mkdir (x): |
1284 if not os.path.isdir (x): | 1284 if not os.path.isdir (x): |
1285 log_verbose ('mkdir %s' % x) | 1285 log_verbose ('mkdir %s' % x) |
1286 os.makedirs (x) | 1286 os.makedirs (x) |
1287 | 1287 |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1549 | 1549 |
1550 out = options.output_dir | 1550 out = options.output_dir |
1551 if not out: | 1551 if not out: |
1552 out = args[0].replace ('/', '') | 1552 out = args[0].replace ('/', '') |
1553 out = os.path.join (args[1], 'compare-' + shorten_string (out)) | 1553 out = os.path.join (args[1], 'compare-' + shorten_string (out)) |
1554 | 1554 |
1555 compare_tree_pairs (list(zip(args[0::2], args[1::2])), out, options.threshol
d) | 1555 compare_tree_pairs (list(zip(args[0::2], args[1::2])), out, options.threshol
d) |
1556 | 1556 |
1557 if __name__ == '__main__': | 1557 if __name__ == '__main__': |
1558 main () | 1558 main () |
OLD | NEW |