this is the bit that creates the menu
Code:
list = []
list.append(("netstat", "com_one"))
list.append(("drive space", "com_two"))
list.append(("mount", "com_three"))
list.append(("free memory", "com_four"))
list.append((_("Exit"), "exit"))
with corresponding actions for the list entries:-
Code:
if returnValue is not None:
if returnValue is "com_one":
self.prompt("/bin/netstat -lant")
elif returnValue is "com_two":
self.prompt("/bin/df -h")
elif returnValue is "com_three":
self.prompt("/bin/mount")
elif returnValue is "com_four":
self.prompt("/usr/bin/free")
so if you select the second entry, 'value' is com_two
so now the returnValue is com_two and that piece of code is executed; and so on ...
Bookmarks