summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dunai <andunai@gmail.com>2018-01-03 11:33:32 +0200
committerAndrew Dunai <andunai@gmail.com>2018-01-03 11:33:32 +0200
commitc4292f0688ef28795d942d11d9d8d99b5a39eaa8 (patch)
tree5eb4dc4f38ee56b4d02cf6416cdce2be55f003df
parentf50b182ef3d4586422ea31e5c89a931e6456b8fb (diff)
downloadurwid-c4292f0688ef28795d942d11d9d8d99b5a39eaa8.tar.gz
Fixed examples.
-rw-r--r--examples/twisted_serve_ssh.py6
-rwxr-xr-xurwid/curses_display.py4
2 files changed, 6 insertions, 4 deletions
diff --git a/examples/twisted_serve_ssh.py b/examples/twisted_serve_ssh.py
index 5335646..c1a0004 100644
--- a/examples/twisted_serve_ssh.py
+++ b/examples/twisted_serve_ssh.py
@@ -200,7 +200,7 @@ class TwistedScreen(Screen):
"""
return self.terminalProtocol.width, self.terminalProtocol.height
- def draw_screen(self, (maxcol, maxrow), r ):
+ def draw_screen(self, maxres, r ):
"""Render a canvas to the terminal.
The canvas contains all the information required to render the Urwid
@@ -208,6 +208,7 @@ class TwistedScreen(Screen):
tuples. This very simple implementation iterates each row and simply
writes it out.
"""
+ (maxcol, maxrow) = maxres
#self.terminal.eraseDisplay()
lasta = None
for i, row in enumerate(r.content()):
@@ -411,9 +412,10 @@ class UrwidTerminalSession(TerminalSession):
IConchUser(self.original),
self.height, self.width)
- def windowChanged(self, (h, w, x, y)):
+ def windowChanged(self, dimensions):
"""Called when the window size has changed.
"""
+ (h, w, x, y) = dimensions
self.chained_protocol.terminalProtocol.terminalSize(h, w)
diff --git a/urwid/curses_display.py b/urwid/curses_display.py
index ce3c7f1..cca6090 100755
--- a/urwid/curses_display.py
+++ b/urwid/curses_display.py
@@ -485,10 +485,10 @@ class Screen(BaseScreen, RealTerminal):
"""Paint screen with rendered canvas."""
assert self._started
- assert r.rows() == rows, "canvas size and passed size don't match"
-
cols, rows = size
+ assert r.rows() == rows, "canvas size and passed size don't match"
+
y = -1
for row in r.content():
y += 1