| from config import MATERIALS_JSON, CODES_JSON |
| import json |
|
|
| def get_all_contributors(): |
| contributors = set() |
| try: |
| with open(MATERIALS_JSON, 'r', encoding='utf-8') as f: |
| data = json.load(f) |
| for item in data: |
| if "contributor" in item and item["contributor"].strip(): |
| contributors.add(item["contributor"].strip()) |
| except Exception: |
| pass |
| try: |
| with open(CODES_JSON, 'r', encoding='utf-8') as f: |
| data = json.load(f) |
| for item in data: |
| if "contributor" in item and item["contributor"].strip(): |
| contributors.add(item["contributor"].strip()) |
| except Exception: |
| pass |
| return ",".join(sorted(contributors)) if contributors else "暂无贡献人" |
|
|