summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorAndrew Dunai <andunai@gmail.com>2018-01-04 13:56:40 +0200
committerGitHub <noreply@github.com>2018-01-04 13:56:40 +0200
commitcf0307c500e1d575fec5fc5a37e4ff4e69972b92 (patch)
treecbc82f80d72cb15589f50c77847dc4c0ddabd072 /examples
parent2496a176c00eab88492f1566f2a89c58be4e15d9 (diff)
downloadurwid-cf0307c500e1d575fec5fc5a37e4ff4e69972b92.tar.gz
Python dual support (#266)
* WIP * Metaclasses * String literal fixes * Remove 2to3 and make tests compatible with both Python 2 & 3 * Removed debug code. * Added tests for ProgressBar * Fixed examples. * future division & font literals fix * Cleaner fonts initialization.
Diffstat (limited to 'examples')
-rw-r--r--examples/twisted_serve_ssh.py6
1 files changed, 4 insertions, 2 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)