Files
flaskpaste/fpaste
Username 1f09f2686a fpaste: consolidate code and add type hints
- Add type hints throughout (NoReturn, Path | None, etc.)
- Extract helper functions to eliminate duplication:
  - read_config_file() / write_config_file()
  - parse_error() for JSON error parsing
  - format_paste_row() / print_paste_list()
  - prepare_content(), extract_paste_id()
  - auth_headers(), require_auth()
- Add constants (CONFIG_DIR, CONFIG_KEYS, MIME_EXTENSIONS)
- Replace if/elif chains with command dispatch tables
- Extract build_parser() from main()
- Use walrus operators and frozenset where appropriate

Net reduction: 170 lines (-793 +623)
2025-12-21 12:43:34 +01:00

47 KiB
Executable File