"""List .vbp files in a given analyzer-output dir that are newer than a cutoff date, filtering out Crystal Reports SDK samples and common third-party library bundles. Usage: py find_newer_vbp.py [cutoff_date] cutoff_date format: YYYY/MM/DD HH:MM:SS (default 2020/06/09 16:13:00) """ import csv, os, sys OUT_DIR = sys.argv[1] CUTOFF = sys.argv[2] if len(sys.argv) > 2 else '2020/06/09 16:13:00' NOISE_SUBSTRINGS = ( 'seagat', 'crw\\samples', 'samples\\code\\vb', '\\tools\\', '\\plug-ins\\', '\\plugins\\', '\\program files\\microsoft visual studio\\', '\\program files (x86)\\microsoft visual studio\\', ) newer = [] csv_path = os.path.join(OUT_DIR, 'cat_vb6-project.csv') with open(csv_path, encoding='utf-8') as f: r = csv.reader(f); next(r) for size, sizemb, mod, path in r: if mod <= CUTOFF: continue pl = path.lower() if any(s in pl for s in NOISE_SUBSTRINGS): continue newer.append((mod, int(size), path)) newer.sort(reverse=True) print(f'Found {len(newer)} .vbp files newer than {CUTOFF} (filtered)\n') for mod, size, path in newer[:50]: print(f'{mod} {size:>6}b {path}') if len(newer) > 50: print(f'\n... and {len(newer)-50} more')