Python npyscreen.FixedText() Examples
The following are 11
code examples of npyscreen.FixedText().
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: tui.py From community-edition-setup with MIT License | 6 votes |
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)
Example #2
Source File: create_character.py From dungeon-sheets with GNU General Public License v3.0 | 6 votes |
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))
Example #3
Source File: console.py From PRET with GNU General Public License v2.0 | 6 votes |
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()
Example #4
Source File: tui.py From community-edition-setup with MIT License | 5 votes |
def create(self): self.add(npyscreen.FixedText, value=make_title(msg.cert_info_label), editable=False) self.ip = self.add(npyscreen.TitleText, name=msg.ip_label, begin_entry_at=25) self.hostname = self.add(npyscreen.TitleText, name=msg.hostname_label, begin_entry_at=25) self.orgName = self.add(npyscreen.TitleText, name=msg.orgName_label, begin_entry_at=25) self.admin_email = self.add(npyscreen.TitleText, name=msg.admin_email_label, begin_entry_at=25) self.city = self.add(npyscreen.TitleText, name=msg.city_label, begin_entry_at=25) self.state = self.add(npyscreen.TitleText, name=msg.state_label, begin_entry_at=25) self.countryCode = self.add(npyscreen.TitleText, name=msg.countryCode_label, begin_entry_at=25) self.add(npyscreen.FixedText, value=make_title(msg.sys_info_label), rely=12, editable=False) self.application_max_ram = self.add(npyscreen.TitleText, name=msg.application_max_ram_label, begin_entry_at=25) self.oxtrust_admin_password = self.add(npyscreen.TitleText, name=msg.oxtrust_admin_password_label, begin_entry_at=25)
Example #5
Source File: tui.py From community-edition-setup with MIT License | 5 votes |
def create(self): self.wrends_storage = self.add(npyscreen.TitleMultiSelect, begin_entry_at=30, max_height=len(msg.storages), values=msg.storages, name=msg.DBBackendForm_label, scroll_exit=True) self.add(npyscreen.FixedText, value=msg.unselected_storages, rely=len(msg.storages)+4, editable=False, color='STANDOUT')
Example #6
Source File: create_character.py From dungeon-sheets with GNU General Public License v3.0 | 5 votes |
def create(self): self.roll_text = self.add(npyscreen.FixedText, editable=False, value="Take the six rolls below and assign each one to an ability.") self.score_options = self.add( npyscreen.TitleFixedText, name="Rolls:", editable=False, value=str(self.default_array())[1:-1]) self.default_button = self.add(npyscreen.MiniButtonPress, name="Use Default Rolls", when_pressed_function=self.set_default) self.reroll_button = self.add(npyscreen.MiniButtonPress, name="Reroll", when_pressed_function=self.reroll)
Example #7
Source File: create_character.py From dungeon-sheets with GNU General Public License v3.0 | 5 votes |
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()
Example #8
Source File: create_character.py From dungeon-sheets with GNU General Public License v3.0 | 5 votes |
def create(self): self.instructions = self.add( npyscreen.FixedText, editable=False, value=("Please select your weapons.")) self.remaining = self.add( npyscreen.TitleText, name="Remaining:", value=3, editable=False) self.weapons = self.add( npyscreen.TitleMultiSelect, name="Weapons:", values=tuple([wpn.name for wpn in all_weapons]), value_changed_callback=self.update_remaining)
Example #9
Source File: create_character.py From dungeon-sheets with GNU General Public License v3.0 | 5 votes |
def create(self): self.instructions = self.add( npyscreen.FixedText, editable=False, value=("Please select your armor.")) self.shield = self.add(npyscreen.Checkbox, name="Shield? ", value=False) self.armor = self.add( npyscreen.TitleSelectOne, name="Armor:", values=tuple([a.name for a in ([armor.NoArmor] + armor.all_armors)]))
Example #10
Source File: create_character.py From dungeon-sheets with GNU General Public License v3.0 | 5 votes |
def create(self): self.instructions = self.add( npyscreen.FixedText, editable=False, value=("Your character will be saved in the file given below. " "After saving, edit this file to finish your personality, " "weapons, etc.")) self.filename = self.add( npyscreen.TitleText, name='Filename:') self.make_pdf = self.add(npyscreen.Checkbox, name="Create PDF:", value=True)
Example #11
Source File: stdfmemail.py From EDCOP with Apache License 2.0 | 5 votes |
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-")