本文整理汇总了Python中cloudinstall.ui.utils.Color.string_input方法的典型用法代码示例。如果您正苦于以下问题:Python Color.string_input方法的具体用法?Python Color.string_input怎么用?Python Color.string_input使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cloudinstall.ui.utils.Color
的用法示例。
在下文中一共展示了Color.string_input方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _build_widget
# 需要导入模块: from cloudinstall.ui.utils import Color [as 别名]
# 或者: from cloudinstall.ui.utils.Color import string_input [as 别名]
def _build_widget(self, **kwargs):
total_items = []
for _item in self.radio_items.keys():
desc = Color.string_input(
Text(" {}".format(
self.radio_items[_item][1])),
focus_map='string_input focus')
total_items.append(
Color.string_input(self.radio_items[_item][0],
focus_map='string_input focus'))
total_items.append(AttrWrap(desc, 'input'))
total_items.append(Divider('-'))
self.input_lbox = ListBox(SimpleListWalker(total_items[:-1]))
self.add_buttons()
self.container_box_adapter = BoxAdapter(self.input_lbox,
len(total_items))
self.container_lbox = ListBox(
[self.container_box_adapter,
Divider(),
self.btn_pile])
return LineBox(
BoxAdapter(self.container_lbox,
height=len(total_items) + 3),
title=self.title)
示例2: _build_widget
# 需要导入模块: from cloudinstall.ui.utils import Color [as 别名]
# 或者: from cloudinstall.ui.utils.Color import string_input [as 别名]
def _build_widget(self, **kwargs):
total_items = [
Padding.center_60(Text(self.title, align="center")),
Padding.center_60(
Divider("\N{BOX DRAWINGS LIGHT HORIZONTAL}", 1, 1))
]
if self.input_items:
for item in self.input_items:
key = item[0]
caption = item[1]
try:
mask = item[2]
except:
mask = None
self.input_selection[key] = EditInput(caption="",
mask=mask)
col = Columns(
[
("weight", 0.4, Text(caption, align="right")),
Color.string_input(self.input_selection[key],
focus_map="string_input focus")
]
)
total_items.append(Padding.center_60(col))
total_items.append(
Padding.center_60(
Divider("\N{BOX DRAWINGS LIGHT HORIZONTAL}", 1, 1)))
total_items.append(Padding.center_20(self._build_buttons()))
return Filler(Pile(total_items), valign='middle')
示例3: _build_widget
# 需要导入模块: from cloudinstall.ui.utils import Color [as 别名]
# 或者: from cloudinstall.ui.utils.Color import string_input [as 别名]
def _build_widget(self, **kwargs):
total_items = []
for _item in self.input_items.keys():
total_items.append(Color.string_input(
self.input_items[_item], focus_map='string_input focus'))
self.input_lbox = ListBox(SimpleListWalker(total_items))
# Add buttons
self.add_buttons()
self.container_box_adapter = BoxAdapter(self.input_lbox,
len(total_items))
self.container_lbox = ListBox(
[self.container_box_adapter,
Divider(),
self.btn_pile])
return LineBox(
BoxAdapter(self.container_lbox,
height=len(total_items) + 1 +
len(self.btn_pile.contents)),
title=self.title)
示例4: __init__
# 需要导入模块: from cloudinstall.ui.utils import Color [as 别名]
# 或者: from cloudinstall.ui.utils.Color import string_input [as 别名]
def __init__(self, caption, **kwargs):
self._edit = Edit(caption=caption, **kwargs)
super().__init__(Color.string_input(self._edit,
focus_map="string_input focus"))