File: textwrap.pyi

package info (click to toggle)
mypy 0.470-complete-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 5,864 kB
  • ctags: 3,264
  • sloc: python: 21,838; makefile: 18
file content (122 lines) | stat: -rw-r--r-- 3,392 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
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
115
116
117
118
119
120
121
122
# Better textwrap stubs hand-written by o11c.
# https://docs.python.org/3/library/textwrap.html
from typing import (
    Callable,
    List,
)

class TextWrapper:
    def __init__(
        self,
        width: int = ...,
        *,
        initial_indent: str = ...,
        subsequent_indent: str = ...,
        expand_tabs: bool = ...,
        tabsize: int = ...,
        replace_whitespace: bool = ...,
        fix_sentence_endings: bool = ...,
        break_long_words: bool = ...,
        break_on_hyphens: bool = ...,
        drop_whitespace: bool = ...,
        max_lines: int = ...,
        placeholder: str = ...
    ) -> None:
        self.width = width
        self.initial_indent = initial_indent
        self.subsequent_indent = subsequent_indent
        self.expand_tabs = expand_tabs
        self.tabsize = tabsize
        self.replace_whitespace = replace_whitespace
        self.fix_sentence_endings = fix_sentence_endings
        self.break_long_words = break_long_words
        self.break_on_hyphens = break_on_hyphens
        self.drop_whitespace = drop_whitespace
        self.max_lines = max_lines
        self.placeholder = placeholder

    # Private methods *are* part of the documented API for subclasses.
    def _munge_whitespace(self, text: str) -> str:
        ...

    def _split(self, text: str) -> List[str]:
        ...

    def _fix_sentence_endings(self, chunks: List[str]) -> None:
        ...

    def _handle_long_word(self, reversed_chunks: List[str], cur_line: List[str], cur_len: int, width: int) -> None:
        ...

    def _wrap_chunks(self, chunks: List[str]) -> List[str]:
        ...

    def _split_chunks(self, text: str) -> List[str]:
        ...

    def wrap(self, text: str) -> List[str]:
        ...

    def fill(self, text: str) -> str:
        ...


def wrap(
        text: str = ...,
        width: int = ...,
        *,
        initial_indent: str = ...,
        subsequent_indent: str = ...,
        expand_tabs: bool = ...,
        tabsize: int = ...,
        replace_whitespace: bool = ...,
        fix_sentence_endings: bool = ...,
        break_long_words: bool = ...,
        break_on_hyphens: bool = ...,
        drop_whitespace: bool = ...,
        max_lines: int = ...,
        placeholder: str = ...
) -> List[str]:
    ...

def fill(
        text: str,
        width: int = ...,
        *,
        initial_indent: str = ...,
        subsequent_indent: str = ...,
        expand_tabs: bool = ...,
        tabsize: int = ...,
        replace_whitespace: bool = ...,
        fix_sentence_endings: bool = ...,
        break_long_words: bool = ...,
        break_on_hyphens: bool = ...,
        drop_whitespace: bool = ...,
        max_lines: int = ...,
        placeholder: str = ...
):
    ...

def shorten(
        text: str,
        width: int,
        *,
        initial_indent: str = ...,
        subsequent_indent: str = ...,
        expand_tabs: bool = ...,
        tabsize: int = ...,
        replace_whitespace: bool = ...,
        fix_sentence_endings: bool = ...,
        break_long_words: bool = ...,
        break_on_hyphens: bool = ...,
        drop_whitespace: bool = ...,
        # Omit `max_lines: int = None`, it is forced to 1 here.
        placeholder: str = ...
):
    ...

def dedent(text: str) -> str:
    ...

def indent(text: str, prefix: str, predicate: Callable[[str], bool] = ...) -> str:
    ...