本文整理匯總了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"))