virtualsnack.py 891 Bytes
Newer Older
1 2
#!/usr/bin/env python
import npyscreen
Mark Tearle's avatar
Mark Tearle committed
3
from datetime import datetime
4

Mark Tearle's avatar
Mark Tearle committed
5
class VirtualSnack(npyscreen.Form):
6

Mark Tearle's avatar
Mark Tearle committed
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
    def while_waiting(self):
        self.date_widget.value = datetime.now()
        self.display()

    def create(self, *args, **keywords):
        super(VirtualSnack, self).create(*args, **keywords)

        self.wStatus1 = self.add(npyscreen.FixedText, value="Last Command", editable=False)


        self.wStatus2 = self.add(npyscreen.FixedText, value="", editable=False)

        self.wStatus1.important = True
	
	self.date_widget = self.add(npyscreen.FixedText, value=datetime.now(), editable=False)
        self.date_widget.value = "Hello"


class VirtualSnackApp(npyscreen.NPSAppManaged):
    keypress_timeout_default = 2

    def onStart(self):
	self.addForm("MAIN", VirtualSnack, name="Virtual Snack")
30 31 32 33 34


if __name__ == "__main__":
    App = VirtualSnackApp()
    App.run()