File size: 1,134 Bytes
afd56bc
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import sys
import os
import json
from datetime import datetime, timezone

# Add backend to path so imports work
sys.path.append(os.path.dirname(os.path.abspath(__file__)))

results = {}
for filename in os.listdir('core/search/sources'):
    if filename.endswith('_source.py') and filename != 'base_source.py':
        module_name = f'core.search.sources.{filename[:-3]}'
        try:
            import importlib
            mod = importlib.import_module(module_name)
            for attr_name in dir(mod):
                attr = getattr(mod, attr_name)
                if isinstance(attr, type) and hasattr(attr, '_get_verified_fallback'):
                    inst = attr()
                    # Patch logging inside __init__ if needed or just call fallback directly
                    try:
                        fallback = attr._get_verified_fallback(inst)
                    except TypeError:
                        fallback = attr()._get_verified_fallback()
                    results[filename] = fallback
        except Exception as e:
            results[filename] = f'Error: {e}'

print(json.dumps(results, default=str))