本文整理匯總了Python中ubuntui.utils.Padding.center_60方法的典型用法代碼示例。如果您正苦於以下問題:Python Padding.center_60方法的具體用法?Python Padding.center_60怎麽用?Python Padding.center_60使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ubuntui.utils.Padding
的用法示例。
在下文中一共展示了Padding.center_60方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: __init__
# 需要導入模塊: from ubuntui.utils import Padding [as 別名]
# 或者: from ubuntui.utils.Padding import center_60 [as 別名]
def __init__(self, app, cloud, schema, cb):
self.app = app
self.cloud = cloud
self.input_items = schema
self.cb = cb
_pile = [
Padding.center_60(Instruction(
"Enter your {} credentials:".format(self.cloud.upper()))),
Padding.center_60(HR()),
Padding.center_60(self.build_inputs()),
Padding.line_break(""),
Padding.center_20(self.buttons())
]
super().__init__(Filler(Pile(_pile), valign="top"))
示例2: _build_widget
# 需要導入模塊: from ubuntui.utils import Padding [as 別名]
# 或者: from ubuntui.utils.Padding import center_60 [as 別名]
def _build_widget(self):
total_items = [
Padding.center_60(Text(self.title, align="center")),
Padding.center_60(
Divider("\N{BOX DRAWINGS LIGHT HORIZONTAL}", 1, 1))
]
for item in self.radio_items.keys():
opt = self.radio_items[item]
col = Columns([opt])
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: __init__
# 需要導入模塊: from ubuntui.utils import Padding [as 別名]
# 或者: from ubuntui.utils.Padding import center_60 [as 別名]
def __init__(self, app, cb):
self.app = app
self.input_items = NETWORK
self.cb = cb
_pile = [
# Padding.center_60(Instruction(
# "Enter LXD information:")),
Padding.center_60(Instruction(
"Please configure networking for LXD"
)),
Padding.center_60(HR()),
Padding.center_60(self.build_info()),
Padding.line_break(""),
Padding.center_20(self.buttons())
]
super().__init__(Filler(Pile(_pile), valign="middle"))
示例4: _build_widget
# 需要導入模塊: from ubuntui.utils import Padding [as 別名]
# 或者: from ubuntui.utils.Padding import center_60 [as 別名]
def _build_widget(self):
total_items = [HR()]
total_items += [spell for spell in self.spells]
total_items += [HR()]
self.pile = Pile(total_items)
return Padding.center_60(Filler(self.pile, valign="top"))
示例5: _build_widget
# 需要導入模塊: from ubuntui.utils import Padding [as 別名]
# 或者: from ubuntui.utils.Padding import center_60 [as 別名]
def _build_widget(self):
total_items = [
Padding.center_60(HR())
]
for spell in self.spells:
total_items.append(Padding.center_60(
Color.body(
menu_btn(label=spell,
on_press=self.submit),
focus_map='menu_button focus'
)
))
total_items.append(
Padding.center_60(HR()))
total_items.append(Padding.center_20(self._build_buttons()))
return Filler(Pile(total_items), valign='top')
示例6: _build_widget
# 需要導入模塊: from ubuntui.utils import Padding [as 別名]
# 或者: from ubuntui.utils.Padding import center_60 [as 別名]
def _build_widget(self):
total_items = [
Padding.center_60(Instruction("Choose a Cloud")),
Padding.center_60(HR())
]
for item in self.clouds:
total_items.append(Padding.center_60(
Color.body(
menu_btn(label=item,
on_press=self.submit),
focus_map='menu_button focus'
)
))
total_items.append(
Padding.center_60(HR()))
total_items.append(Padding.center_20(self._build_buttons()))
return Filler(Pile(total_items), valign='top')
示例7: _build_footer
# 需要導入模塊: from ubuntui.utils import Padding [as 別名]
# 或者: from ubuntui.utils.Padding import center_60 [as 別名]
def _build_footer(self):
self.spell_description = Text("")
footer_pile = Pile(
[
Padding.center_60(self.spell_description),
Padding.line_break(""),
Color.frame_footer(Columns([("fixed", 2, Text("")), ("fixed", 13, self._build_buttons())])),
]
)
return footer_pile
示例8: validate
# 需要導入模塊: from ubuntui.utils import Padding [as 別名]
# 或者: from ubuntui.utils.Padding import center_60 [as 別名]
def validate(self):
""" Will provide an error text if any fields are blank
"""
values = [i.value for i in self.input_items.values()
if isinstance(i, StringEditor)]
if None in values:
self.pile.contents[-1] = (
Padding.center_60(
Color.error_major(
Text("Please fill all required fields."))),
self.pile.options())
return False
return True
示例9: __init__
# 需要導入模塊: from ubuntui.utils import Padding [as 別名]
# 或者: from ubuntui.utils.Padding import center_60 [as 別名]
def __init__(self, error):
body = [
Padding.center_60(
Text("Oops, there was a problem with your install:",
align="center")),
Padding.center_95(
Divider("\N{BOX DRAWINGS LIGHT HORIZONTAL}", 1, 1)),
Padding.center_85(Text("Reason:")),
Padding.center_80(Color.error_major(Text(error))),
Padding.line_break(""),
Padding.line_break(""),
Padding.center_95(
Divider("\N{BOX DRAWINGS LIGHT HORIZONTAL}", 1, 1)),
Padding.center_20(self._build_buttons())
]
super().__init__(Filler(Pile(body), valign="middle"))
示例10: _build_widget
# 需要導入模塊: from ubuntui.utils import Padding [as 別名]
# 或者: from ubuntui.utils.Padding import center_60 [as 別名]
def _build_widget(self):
total_items = [Text(
"Enter your {} credentials:".format(self.cloud.upper()))]
total_items += [HR()]
for k in self.input_items.keys():
display = k
if k.startswith('_'):
# Don't treat 'private' keys as input
continue
if k.startswith('@'):
# Strip public, not storable attribute
display = k[1:]
col = Columns(
[
('weight', 0.5, Text(display, align='right')),
Color.string_input(self.input_items[k],
focus_map='string_input focus')
], dividechars=1
)
total_items.append(col)
total_items.append(Padding.line_break(""))
total_items.append(Text(""))
self.pile = Pile(total_items)
return Padding.center_60(Filler(self.pile, valign="top"))