Python 3 compatible
This commit is contained in:
parent
7425a888de
commit
4b8d0af03e
@ -41,7 +41,7 @@ enter selects default button or displays error if not one
|
|||||||
self.draw()
|
self.draw()
|
||||||
|
|
||||||
def initialDraw(self):
|
def initialDraw(self):
|
||||||
for i in xrange(0, len(self._controls)):
|
for i in range(0, len(self._controls)):
|
||||||
co = self._controls[i]
|
co = self._controls[i]
|
||||||
c = co[0](screen=self.screen, base=self.base, y=i, can_go_back=self.can_go_back, **co[1])
|
c = co[0](screen=self.screen, base=self.base, y=i, can_go_back=self.can_go_back, **co[1])
|
||||||
self.controls.append(c)
|
self.controls.append(c)
|
||||||
@ -275,7 +275,7 @@ The following synonyms are supported where possible:
|
|||||||
y, x = self.win.getyx()
|
y, x = self.win.getyx()
|
||||||
l = len(self.text)
|
l = len(self.text)
|
||||||
if l < self.maxy:
|
if l < self.maxy:
|
||||||
for i in xrange(l):
|
for i in range(l):
|
||||||
self.win.move(i, 0)
|
self.win.move(i, 0)
|
||||||
self.win.clrtoeol()
|
self.win.clrtoeol()
|
||||||
self.win.addstr(i, 0, ''.join(self.text[i]))
|
self.win.addstr(i, 0, ''.join(self.text[i]))
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
import curses
|
import curses
|
||||||
import widgets
|
from . import widgets
|
||||||
|
|
||||||
class Window(object):
|
class Window(object):
|
||||||
|
|
||||||
@ -11,8 +11,8 @@ class Window(object):
|
|||||||
self.screen.keypad(0)
|
self.screen.keypad(0)
|
||||||
self.screen.nodelay(0)
|
self.screen.nodelay(0)
|
||||||
curses.nocbreak()
|
curses.nocbreak()
|
||||||
except Exception,e:
|
except Exception as e:
|
||||||
print "error"
|
print("error")
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
quit=exit
|
quit=exit
|
||||||
@ -111,4 +111,4 @@ class Window(object):
|
|||||||
controls.append((widgets.Button, dict(prompt=i[1], action=i[0])))
|
controls.append((widgets.Button, dict(prompt=i[1], action=i[0])))
|
||||||
if is_submenu:
|
if is_submenu:
|
||||||
controls.append((widgets.Button, "Back"))
|
controls.append((widgets.Button, "Back"))
|
||||||
return controls
|
return controls
|
||||||
|
Loading…
Reference in New Issue
Block a user