MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / load_default_journals

Function load_default_journals

deployments/feishu/daily-push-agent/main.py:393–415  ·  view source on GitHub ↗

Load enabled journal sources from config, plus built-in supported journals not listed there.

()

Source from the content-addressed store, hash-verified

391 unsupported = []
392 raw_config = load_yaml_config("journals.yaml").get("journals", {})
393
394 for group_items in raw_config.values():
395 for item in group_items or []:
396 if not item.get("enabled", True):
397 continue
398 normalized = journal_fetcher.normalize_journal_name(item.get("name", ""))
399 if normalized:
400 configured.append(normalized)
401 else:
402 unsupported.append(item.get("name", ""))
403
404 if unsupported:
405 print(f"Skipping unsupported journal sources for now: {', '.join(unsupported)}")
406
407 configured = dedupe_preserve_order(configured)
408 supported = journal_fetcher.get_supported_journals()
409 extras = [name for name in supported if name not in configured]
410 return configured + extras
411
412
413def load_scoring_weights() -> Dict:
414 """加载排序权重配置"""
415 import yaml
416 config_file = os.path.join(CONFIG_PATH, "scoring_weights.yaml")
417 if os.path.exists(config_file):
418 with open(config_file, 'r', encoding='utf-8') as f:

Callers 1

fetch_and_process_papersFunction · 0.85

Calls 3

load_yaml_configFunction · 0.85
dedupe_preserve_orderFunction · 0.85
getMethod · 0.80

Tested by

no test coverage detected