当前位置: 首页>>代码示例>>Python>>正文


Python npyscreen.FixedText方法代码示例

本文整理汇总了Python中npyscreen.FixedText方法的典型用法代码示例。如果您正苦于以下问题:Python npyscreen.FixedText方法的具体用法?Python npyscreen.FixedText怎么用?Python npyscreen.FixedText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在npyscreen的用法示例。


在下文中一共展示了npyscreen.FixedText方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: create

# 需要导入模块: import npyscreen [as 别名]
# 或者: from npyscreen import FixedText [as 别名]
def create(self):
        self.editw = 2
        self.add(npyscreen.FixedText, value=make_title(msg.ask_wrends_install), editable=False)

        self.ask_wrends = self.add(npyscreen.SelectOne, max_height=3, 
                values = msg.wrends_install_options, scroll_exit=True)
        self.ask_wrends.value_changed_callback = self.wrends_option_changed
        self.wrends_password = self.add(npyscreen.TitleText, name=msg.password_label)
        self.wrends_hosts = self.add(npyscreen.TitleText, name=msg.hosts_label)
        self.wrends_option_changed(self.ask_wrends)

        self.add(npyscreen.FixedText, value=make_title(msg.ask_cb_install), rely=10, editable=False)

        self.ask_cb = self.add(npyscreen.SelectOne, max_height=3,
                values = msg.cb_install_options, scroll_exit=True)
        self.ask_cb.value_changed_callback = self.cb_option_changed
        self.cb_admin = self.add(npyscreen.TitleText, name=msg.username_label)
        self.cb_password = self.add(npyscreen.TitleText, name=msg.password_label)
        self.cb_hosts = self.add(npyscreen.TitleText, name=msg.hosts_label)
        self.cb_option_changed(self.ask_cb) 
开发者ID:GluuFederation,项目名称:community-edition-setup,代码行数:22,代码来源:tui.py

示例2: create

# 需要导入模块: import npyscreen [as 别名]
# 或者: from npyscreen import FixedText [as 别名]
def create(self):
        if self.class_num > 1:
            self.add(npyscreen.FixedText, editable=False,
                     value="Current Classes: {}".format(
                         self.parentApp.character.name))
        if self.class_num == 1:
            t = 'Primary Class:'
        else:
            t = 'Class #{:d}:'.format(self.class_num)
        for c in self.parentApp.character.class_list:
            self.class_options.remove(c.name)
        if self.class_num == 1:
            self.multiclass = self.add(npyscreen.Checkbox, name="Add Multiclass?".format(self.class_num + 1), value=False)
        else:
            self.multiclass = self.add(npyscreen.Checkbox, name="Add Class #{:d}?".format(self.class_num + 1), value=False)
        self.level = self.add(
            npyscreen.TitleText, name='Level:', value="1", use_two_lines=False)
        self.character_class = self.add(
            npyscreen.TitleSelectOne, name=t, values=tuple(self.class_options)) 
开发者ID:canismarko,项目名称:dungeon-sheets,代码行数:21,代码来源:create_character.py

示例3: create

# 需要导入模块: import npyscreen [as 别名]
# 或者: from npyscreen import FixedText [as 别名]
def create(self):
        self.name = 'Dictionary Browser \xe2\x94\x80\xe2\x94\x80 (Press F1 for help)'
        self.add_handlers({curses.KEY_F1: self.usage,
         ord('/'): self.search,
         ord('f'): self.filter,
         ord('r'): self.reset,
         ord('q'): self.quit})
        self.items = self.add(npyscreen.TitleText, name='Items total', value='0', editable=False)
        self.add(npyscreen.TitleText, name='PS version', value='3010', editable=False)
        self.search_btn = self.add(SearchButton, relx=33, rely=2, name='Search')
        self.search_text = self.add(npyscreen.FixedText, relx=53, rely=2, editable=False)
        self.filter_btn = self.add(FilterButton, relx=33, rely=3, name='Filter')
        self.filter_text = self.add(npyscreen.FixedText, relx=53, rely=3, editable=False)
        self.dict = self.add(Dict, name='Dictionary', scroll_exit=True, max_width=43, relx=2, rely=5, max_height=-2)
        self.perms = self.add(Perms, name='Permissions', scroll_exit=True, rely=5, relx=46, max_height=6)
        self.value = self.add(Value, name='Edit Value', scroll_exit=True, rely=11, relx=46, max_height=-2)
        self.status = self.add(npyscreen.TitleText, name='Status', editable=False, value='Connected to laserjet.lan', rely=-3)
        self.save = self.add(npyscreen.ButtonPress, name='Save Changes', rely=-3, relx=-27)
        self.exit = self.add(npyscreen.ButtonPress, name='Exit', rely=-3, relx=-12)
        self.save.whenPressed = self.commit
        self.exit.whenPressed = self.quit
        self.update_dict() 
开发者ID:RUB-NDS,项目名称:PRET,代码行数:24,代码来源:console.py

示例4: prep

# 需要导入模块: import npyscreen [as 别名]
# 或者: from npyscreen import FixedText [as 别名]
def prep(self):
        attrs = ('strength', 'dexterity', 'constitution',
                 'intelligence', 'wisdom', 'charisma')
        self.class_text = self.add(npyscreen.FixedText, editable=False,
                                  value="Key stats for your primary class {:s} are listed with **".format(self.parentApp.character.primary_class.name))
        self.race_text = self.add(npyscreen.FixedText, editable=False,
                                  value="Do not add racial bonuses, they will be added for you as listed.")
        for attr in attrs:
            if attr in self.parentApp.character.primary_class.primary_abilities:
                name = '**' + attr
            else:
                name = '' + attr
            race_bonus = getattr(self.parentApp.character.race,
                                 f'{attr}_bonus')
            if race_bonus != 0:
                name += '({:+d})'.format(race_bonus)
            name += ':'
            new_fld = self.add(npyscreen.TitleText,
                               name=name,
                               begin_entry_at=24, value='10')
            setattr(self, attr, new_fld)
        self.hp_roll_text = self.add(npyscreen.FixedText, editable=False,
                                     value="")
        self.hp_reroll_buttom = self.add(npyscreen.MiniButtonPress,
                                         name="Reroll Max HP",
                                         when_pressed_function=self.reroll_hp)
        self.hp_max = self.add(npyscreen.TitleText, name="Max HP:")
        self.parentApp.update_max_hp_roll()
        self.parentApp.set_default_hp_max() 
开发者ID:canismarko,项目名称:dungeon-sheets,代码行数:31,代码来源:create_character.py

示例5: create

# 需要导入模块: import npyscreen [as 别名]
# 或者: from npyscreen import FixedText [as 别名]
def create(self):
        self.m1 = self.add_menu(name="Read Email")
        self.m1.addItemsFromList([
            ('View Short Headers',              self.viewShortHeaders),
            ('View Full Headers',               self.viewAllHeaders),
            ('View Message Tree',              self.viewMessageTree),
            ('Save this Message Part',          self.saveMessagePart),
            ('View Message Source',             self.viewMessageSource),
        ])
        self.nextrely = 1
        self.wSubject = self.add(npyscreen.TitleText, begin_entry_at=10, editable=False, 
                                        use_two_lines=False, name = "Subject:")
        self.wFrom    = self.add(npyscreen.TitleText, begin_entry_at=10, 
                                        editable=False, name = "From:", ) #max_width=-8)
        self.wDate    = self.add(npyscreen.TitleText, begin_entry_at=10, 
                                        editable=False, name = "Date:")
        
        self.draw_line_at   = self.nextrely
        self.nextrely      += 1
        _body_rely          = self.nextrely        
        self.wEmailBody     = self.add(EmailPager, max_height=-1, scroll_exit=True, hidden=True)
        self.nextrely       = _body_rely
        self.wMessageTree   = self.add(EmailTree, max_height=-1, scroll_exit=True, hidden=False)
        self.nextrely      += 1
        self.wStatusLine    = self.add(npyscreen.FixedText, 
            editable=False, 
            use_max_space=True, 
            color='STANDOUT', 
            value="Status Line-Status Line-Status Line-Status Line-Status Line-Status Line-Status Line-") 
开发者ID:sealingtech,项目名称:EDCOP,代码行数:31,代码来源:stdfmemail.py


注:本文中的npyscreen.FixedText方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。