Peek a channel and return part of the input, empty string otherwise.
(self, channel, timeout=0)
| 80 | self._returncode = None |
| 81 | |
| 82 | def peek_channel(self, channel, timeout=0): |
| 83 | """Peek a channel and return part of the input, |
| 84 | empty string otherwise.""" |
| 85 | if channel in self._closed_channels and channel not in self._channels: |
| 86 | return b"" if self.binary else "" |
| 87 | self.update(timeout=timeout) |
| 88 | if channel in self._channels: |
| 89 | return self._channels[channel] |
| 90 | return b"" if self.binary else "" |
| 91 | |
| 92 | def read_channel(self, channel, timeout=0): |
| 93 | """Read data from a channel.""" |