class BaseMenu(object):
def display(self):
header = "FooBar YO"
term = getTerminalSize()
#sys.stdout.write("\x1b[2J\x1b[H")
print header.center(term, '*')
#print sub_menu.center(term, '+')
print "Please choose which option:"
for i in options:
print(
str(options.index(i)+1) + ") "
)
class Servers(BaseMenu):
def __init__(self):
#super(Servers, self).__init__("server")
pass
def list_foo(self):
pass
def list_bar(self):
pass
options = (
list_foo,
list_bar
)
Trying to make a series of text menus starting with Main Menu -> Servers sub menu. When Servers() inherits display() from BaseClass, how can I make the inherited function display() receive options tuple and sub_menu = "Server Menu" string that are contained in Servers() class?