Python 3 compatible

This commit is contained in:
Manuel Cortez 2016-12-18 01:41:44 +00:00
parent 7425a888de
commit 4b8d0af03e
2 changed files with 6 additions and 6 deletions

View File

@ -41,7 +41,7 @@ enter selects default button or displays error if not one
self.draw()
def initialDraw(self):
for i in xrange(0, len(self._controls)):
for i in range(0, len(self._controls)):
co = self._controls[i]
c = co[0](screen=self.screen, base=self.base, y=i, can_go_back=self.can_go_back, **co[1])
self.controls.append(c)
@ -275,7 +275,7 @@ The following synonyms are supported where possible:
y, x = self.win.getyx()
l = len(self.text)
if l < self.maxy:
for i in xrange(l):
for i in range(l):
self.win.move(i, 0)
self.win.clrtoeol()
self.win.addstr(i, 0, ''.join(self.text[i]))

View File

@ -1,7 +1,7 @@
import sys
import time
import curses
import widgets
from . import widgets
class Window(object):
@ -11,8 +11,8 @@ class Window(object):
self.screen.keypad(0)
self.screen.nodelay(0)
curses.nocbreak()
except Exception,e:
print "error"
except Exception as e:
print("error")
sys.exit()
quit=exit
@ -111,4 +111,4 @@ class Window(object):
controls.append((widgets.Button, dict(prompt=i[1], action=i[0])))
if is_submenu:
controls.append((widgets.Button, "Back"))
return controls
return controls