本文整理汇总了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"))