提交 4bc7b0a8 编写于 作者: A Alessio Sergi

Make GlancesTextbox a new-style class

super() needs to inherit from the 'object' class.
上级 e8625ad4
...@@ -1245,15 +1245,14 @@ class GlancesCursesBrowser(_GlancesCurses): ...@@ -1245,15 +1245,14 @@ class GlancesCursesBrowser(_GlancesCurses):
return True return True
if not is_windows: if not is_windows:
class GlancesTextbox(Textbox, object):
class GlancesTextbox(Textbox): def __init__(self, *args, **kwargs):
super(GlancesTextbox, self).__init__(*args, **kwargs)
def __init__(*args, **kwargs):
Textbox.__init__(*args, **kwargs)
def do_command(self, ch): def do_command(self, ch):
if ch == 10: # Enter if ch == 10: # Enter
return 0 return 0
if ch == 127: # Back if ch == 127: # Back
return 8 return 8
return Textbox.do_command(self, ch) return super(GlancesTextbox, self).do_command(ch)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册