53
|
1 # Stubs for twisted.protocols.basic (Python 3)
|
|
2 #
|
|
3 # NOTE: This dynamically typed stub was automatically generated by stubgen.
|
|
4
|
|
5 from twisted.internet import protocol
|
|
6 from typing import Any, Optional
|
|
7
|
|
8 DEBUG: int
|
|
9
|
|
10 class NetstringParseError(ValueError): ...
|
|
11 class IncompleteNetstring(Exception): ...
|
|
12
|
|
13 class NetstringReceiver(protocol.Protocol):
|
|
14 MAX_LENGTH: int = ...
|
|
15 brokenPeer: int = ...
|
|
16 def makeConnection(self, transport: Any) -> None: ...
|
|
17 def sendString(self, string: Any) -> None: ...
|
|
18 def dataReceived(self, data: Any) -> None: ...
|
|
19 def stringReceived(self, string: Any) -> None: ...
|
|
20
|
|
21 class LineOnlyReceiver(protocol.Protocol):
|
|
22 delimiter: bytes = ...
|
|
23 MAX_LENGTH: int = ...
|
|
24 def dataReceived(self, data: Any): ...
|
|
25 def lineReceived(self, line: Any) -> None: ...
|
|
26 def sendLine(self, line: Any): ...
|
|
27 def lineLengthExceeded(self, line: Any): ...
|
|
28
|
|
29 class _PauseableMixin:
|
|
30 paused: bool = ...
|
|
31 def pauseProducing(self) -> None: ...
|
|
32 def resumeProducing(self) -> None: ...
|
|
33 def stopProducing(self) -> None: ...
|
|
34
|
|
35 class LineReceiver(protocol.Protocol, _PauseableMixin):
|
|
36 line_mode: int = ...
|
|
37 delimiter: bytes = ...
|
|
38 MAX_LENGTH: int = ...
|
|
39 def clearLineBuffer(self): ...
|
|
40 def dataReceived(self, data: Any): ...
|
|
41 def setLineMode(self, extra: bytes = ...): ...
|
|
42 def setRawMode(self) -> None: ...
|
|
43 def rawDataReceived(self, data: Any) -> None: ...
|
|
44 def lineReceived(self, line: Any) -> None: ...
|
|
45 def sendLine(self, line: Any): ...
|
|
46 def lineLengthExceeded(self, line: Any): ...
|
|
47
|
|
48 class StringTooLongError(AssertionError): ...
|
|
49
|
|
50 class _RecvdCompatHack:
|
|
51 def __get__(self, oself: Any, type: Optional[Any] = ...): ...
|
|
52
|
|
53 class IntNStringReceiver(protocol.Protocol, _PauseableMixin):
|
|
54 MAX_LENGTH: int = ...
|
|
55 recvd: Any = ...
|
|
56 def stringReceived(self, string: Any) -> None: ...
|
|
57 def lengthLimitExceeded(self, length: Any) -> None: ...
|
|
58 def dataReceived(self, data: Any) -> None: ...
|
|
59 def sendString(self, string: Any) -> None: ...
|
|
60
|
|
61 class Int32StringReceiver(IntNStringReceiver):
|
|
62 structFormat: str = ...
|
|
63 prefixLength: Any = ...
|
|
64
|
|
65 class Int16StringReceiver(IntNStringReceiver):
|
|
66 structFormat: str = ...
|
|
67 prefixLength: Any = ...
|
|
68
|
|
69 class Int8StringReceiver(IntNStringReceiver):
|
|
70 structFormat: str = ...
|
|
71 prefixLength: Any = ...
|
|
72
|
|
73 class StatefulStringProtocol:
|
|
74 state: str = ...
|
|
75 def stringReceived(self, string: Any) -> None: ...
|
|
76
|
|
77 class FileSender:
|
|
78 CHUNK_SIZE: Any = ...
|
|
79 lastSent: str = ...
|
|
80 deferred: Any = ...
|
|
81 file: Any = ...
|
|
82 consumer: Any = ...
|
|
83 transform: Any = ...
|
|
84 def beginFileTransfer(self, file: Any, consumer: Any, transform: Optional[Any] = ...): ...
|
|
85 def resumeProducing(self) -> None: ...
|
|
86 def pauseProducing(self) -> None: ...
|
|
87 def stopProducing(self) -> None: ...
|