當前位置: 首頁>>代碼示例>>Python>>正文


Python npyscreen.BoxTitle方法代碼示例

本文整理匯總了Python中npyscreen.BoxTitle方法的典型用法代碼示例。如果您正苦於以下問題:Python npyscreen.BoxTitle方法的具體用法?Python npyscreen.BoxTitle怎麽用?Python npyscreen.BoxTitle使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在npyscreen的用法示例。


在下文中一共展示了npyscreen.BoxTitle方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: main

# 需要導入模塊: import npyscreen [as 別名]
# 或者: from npyscreen import BoxTitle [as 別名]
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() 
開發者ID:pravj,項目名稱:Doga,代碼行數:35,代碼來源:gui.py

示例2: create

# 需要導入模塊: import npyscreen [as 別名]
# 或者: from npyscreen import BoxTitle [as 別名]
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 
開發者ID:ArthurMoore85,項目名稱:pi_romulus,代碼行數:7,代碼來源:results.py


注:本文中的npyscreen.BoxTitle方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。