comicbox.config.online.build ¶
Online (tagging) settings assembly.
Precedence for the online block is CLI > the confuse view, which already carries env-over-file layering. Only the CLI layer is hand-rolled here instead of going through confuse because:
- Parse failures must raise typed
ValueErrors with flag-specific messages (--match: unknown name ...); confuse templates would surface generic validation errors instead. - The
--id/--series-idmaps and the per-source auth and tuning shapes are keyed by dynamic source names, which confuse’s fixedMappingTemplates can’t express.
build_online_settings(online_block, runtime, *, cns=None) ¶
Build the nested OnlineSettings from the confuse view + CLI overrides.
Source code in comicbox/config/online/build.py
375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 | |
cns_for_overrides(args) ¶
Locate the inner args.comicbox Namespace for CLI overrides, when present.
Source code in comicbox/config/online/build.py
493 494 495 496 497 498 | |
parse_ttl(raw, *, default=_DEFAULT_CACHE_TTL, label='cache.ttl') ¶
Parse a duration like ‘7d’, ‘24h’, ‘60m’ or ‘0’, or a number of seconds.
A number is accepted as YAML writes it, so ttl: 0 works as the warning below suggests. A missing or unparsable value falls back to default; the warning names the setting by label, so each caller’s lifetime stays its own.
Source code in comicbox/config/online/build.py
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 | |
runtime_online_inputs(args) ¶
Extract online-related runtime values from CLI args (Namespace only).
Source code in comicbox/config/online/build.py
451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 | |