diff options
| author | Petr Svenda | 2020-02-27 10:42:24 +0100 |
|---|---|---|
| committer | Petr Svenda | 2020-02-27 10:42:24 +0100 |
| commit | 4c99e3f7a4ee4b2c87fd5544775b6943238a768d (patch) | |
| tree | f2e70f5ec47af6f4bd77cfad7e946fbf2e0a31b9 /src | |
| parent | 825c8adb78441a4a9a817b3708415deeaba3e9c3 (diff) | |
| download | sec-certs-4c99e3f7a4ee4b2c87fd5544775b6943238a768d.tar.gz sec-certs-4c99e3f7a4ee4b2c87fd5544775b6943238a768d.tar.zst sec-certs-4c99e3f7a4ee4b2c87fd5544775b6943238a768d.zip | |
conditional printing of keyword matches
Diffstat (limited to 'src')
| -rw-r--r-- | src/extract_certificates.py | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/extract_certificates.py b/src/extract_certificates.py index 7780f725..753a7a50 100644 --- a/src/extract_certificates.py +++ b/src/extract_certificates.py @@ -964,18 +964,20 @@ def extract_certificates_keywords(walk_dir, fragments_dir, file_prefix, write_ou for file_name in all_items_found: total_items_found += count_num_items_found(all_items_found[file_name]) - all_matches = [] - for file_name in all_items_found: - for rule_group in all_items_found[file_name].keys(): - items_found = all_items_found[file_name][rule_group] - for rule in items_found.keys(): - for match in items_found[rule]: - if match not in all_matches: - all_matches.append(match) + PRINT_MATCHES = False + if PRINT_MATCHES: + all_matches = [] + for file_name in all_items_found: + for rule_group in all_items_found[file_name].keys(): + items_found = all_items_found[file_name][rule_group] + for rule in items_found.keys(): + for match in items_found[rule]: + if match not in all_matches: + all_matches.append(match) - sorted_all_matches = sorted(all_matches) - for match in sorted_all_matches: - print(match) + sorted_all_matches = sorted(all_matches) + for match in sorted_all_matches: + print(match) # verify total matches found print('\nTotal matches found: {}'.format(total_items_found)) |
