Skip to content

Commit

Permalink
Removed mentions of Stream.attach
Browse files Browse the repository at this point in the history
  • Loading branch information
superbobry committed Jun 30, 2016
1 parent c596d13 commit 09f3ace
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 12 deletions.
3 changes: 1 addition & 2 deletions docs/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ can do something like the following:
>>> from __future__ import unicode_literals
>>> import pyte
>>> screen = pyte.Screen(80, 24)
>>> stream = pyte.Stream()
>>> stream.attach(screen)
>>> stream = pyte.Stream(screen)
>>> stream.feed("Hello World!")
>>> screen.display
['Hello World! ',
Expand Down
3 changes: 1 addition & 2 deletions examples/debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@


if __name__ == "__main__":
stream = pyte.DebugStream()
screen = pyte.Screen(80, 24)
stream.attach(screen)
stream = pyte.DebugStream(screen)
stream.feed(blob)
3 changes: 1 addition & 2 deletions examples/helloworld.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@


if __name__ == "__main__":
stream = pyte.Stream()
screen = pyte.Screen(80, 24)
stream.attach(screen)
stream = pyte.Stream(screen)
stream.feed("Hello World!")

for idx, line in enumerate(screen.display, 1):
Expand Down
3 changes: 1 addition & 2 deletions examples/history.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,10 @@ def random_string(n, alphabet=string.ascii_letters + " "):


if __name__ == "__main__":
stream = pyte.Stream()
# ``ratio=1`` means scroll the whole screen.
screen = pyte.HistoryScreen(80, 12, ratio=1)
screen.set_mode(mo.LNM)
stream.attach(screen)
stream = pyte.Stream(screen)

pages = 3
stream.feed(os.linesep.join(random_string(screen.columns)
Expand Down
5 changes: 1 addition & 4 deletions pyte/streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
... self.y += count or 1
...
>>> dummy = Dummy()
>>> stream = pyte.Stream(strict=False)
>>> stream.attach(dummy)
>>> stream = pyte.Stream(dummy, strict=False)
>>> stream.feed(u"\u001B[5A") # Move the cursor up 5 rows.
>>> dummy.y
5
Expand Down Expand Up @@ -218,8 +217,6 @@ def _parser_fsm(self):
ctrl.VT, ctrl.FF, ctrl.CR])

def create_dispatcher(mapping):
# In order to avoid getting KeyError exceptions below, we
# make sure that these dictionaries resolve to ``"debug"``.
return defaultdict(lambda: debug, dict(
(event, getattr(listener, attr))
for event, attr in mapping.items()))
Expand Down

0 comments on commit 09f3ace

Please sign in to comment.