celery.utils.text¶
Text formatting utilities.
- celery.utils.text.dedent_initial(s: str, n: int = 4) str[源代码]¶
Remove indentation from first line of text.
- celery.utils.text.ensure_sep(sep: str, s: str, n: int = 2) str[源代码]¶
Ensure text s ends in separator sep'.
- celery.utils.text.fill_paragraphs(s: str, width: int, sep: str = '\n') str[源代码]¶
Fill paragraphs with newlines (or custom separator).
- celery.utils.text.pluralize(n: float, text: str, suffix: str = 's') str[源代码]¶
Pluralize term when n is greater than one.
- celery.utils.text.pretty(value: str, width: int = 80, nl_width: int = 80, sep: str = '\n', **kw: Any) str[源代码]¶
Format value for printing to console.