Python npyscreen.BoxTitle() Examples

The following are 2 code examples of npyscreen.BoxTitle(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module npyscreen , or try the search function .
Example #1
Source File: gui.py    From Doga with MIT License 5 votes vote down vote up
def main(self):
        """ 'main' function of npyscreen.NPSApp application object
        this function help in initial widget setup and rendering
        """

        # time(ms) to wait for user interactions
        self.keypress_timeout_default = 10

        # Form widget instance
        self.window = WindowForm(parentApp=self, name="Doga : HTTP Log Monitor",)
        
        # setup a section for Alert status
        self.alert_status = self.window.add(npyscreen.TitleText, name="Alert Status", max_height=3)
        self.alert_status.value = ""
        self.alert_status.editable = False

        # setup a section for Doga status
        self.doga_status = self.window.add(npyscreen.TitleText, name="Doga Status", max_height=3, rely=4)
        self.doga_status.value = ""
        self.doga_status.editable = False

        # setup a section for Doga logs
        self.doga_logs = self.window.add(npyscreen.BoxTitle, name="Doga Logs", max_width=50, relx=2, rely=7)
        self.doga_logs.entry_widget.scroll_exit = True
        self.doga_logs.values = []

        # setup a section for Alert history
        self.alert_history = self.window.add(npyscreen.BoxTitle, name="Alert History", max_width=75, relx=52, rely=7)
        self.alert_history.entry_widget.scroll_exit = True
        self.alert_history.values = []

        # update parent widget by embedding sub-widgets
        self.window.edit() 
Example #2
Source File: results.py    From pi_romulus with GNU General Public License v2.0 5 votes vote down vote up
def create(self):
        self.results = self.parentApp.RESULTS
        self.results_box = self.add(npyscreen.BoxTitle, name='Results')
        if self.parentApp.CLEAN_RESULTS:
            self.results_box.values = self.parentApp.CLEAN_RESULTS