File: utils.py

package info (click to toggle)
python-babel 2.17.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,892 kB
  • sloc: python: 14,521; makefile: 177; javascript: 77; sh: 8
file content (7 lines) | stat: -rw-r--r-- 332 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
CUSTOM_EXTRACTOR_COOKIE = "custom extractor was here"


def custom_extractor(fileobj, keywords, comment_tags, options):
    if "treat" not in options:
        raise RuntimeError(f"The custom extractor refuses to run without a delicious treat; got {options!r}")
    return [(1, next(iter(keywords)), (CUSTOM_EXTRACTOR_COOKIE,), [])]