本文整理汇总了Python中ubuntui.utils.Padding.right_50方法的典型用法代码示例。如果您正苦于以下问题:Python Padding.right_50方法的具体用法?Python Padding.right_50怎么用?Python Padding.right_50使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ubuntui.utils.Padding
的用法示例。
在下文中一共展示了Padding.right_50方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: build_widgets
# 需要导入模块: from ubuntui.utils import Padding [as 别名]
# 或者: from ubuntui.utils.Padding import right_50 [as 别名]
def build_widgets(self):
self.description_w = Text("Description Loading…")
self.readme_w = Text("README Loading…")
self.scale_edit = IntegerEditor(default=self.service.num_units)
connect_signal(self.scale_edit._edit, 'change',
self.handle_scale_changed)
self.skip_rest_button = PlainButton(
"Deploy all {} Remaining Applications with Bundle Defaults".format(
self.n_remaining),
self.do_skip_rest
)
col = Columns(
[
(6, Text('Units:', align='right')),
(15,
Color.string_input(self.scale_edit,
focus_map='string_input focus'))
], dividechars=1
)
if self.n_remaining == 0:
buttons = [Padding.right_50(Color.button_primary(
PlainButton("Deploy and Continue",
self.do_deploy),
focus_map='button_primary focus'))]
else:
buttons = [
Padding.right_50(Color.button_primary(
PlainButton(
"Deploy and Configure Next Application",
self.do_deploy),
focus_map='button_primary focus')),
Padding.right_50(
Color.button_secondary(
self.skip_rest_button,
focus_map='button_secondary focus'))]
ws = [Text("{} of {}: {}".format(self.idx+1, self.n_total,
self.service.service_name.upper())),
Padding.center(HR()),
Padding.center(self.description_w, left=2),
Padding.line_break(""),
Padding.center(self.readme_w, left=2),
Padding.center(HR())]
if not self.service.subordinate:
ws.append(Padding.left(col, left=1))
ws.append(Padding.line_break(""))
ws += buttons
self.pile = Pile(ws)
return Padding.center_90(Filler(self.pile, valign="top"))
示例2: build_widgets
# 需要导入模块: from ubuntui.utils import Padding [as 别名]
# 或者: from ubuntui.utils.Padding import right_50 [as 别名]
def build_widgets(self):
readme_files = glob(os.path.join(app.config['spell-dir'], 'README.*'))
if len(readme_files) == 0:
self.readme_w = Text("No README found for bundle.")
else:
readme_file = readme_files[0]
if len(readme_files) != 1:
utils.warning("Unexpected: {} files matching README.*"
"- using {}".format(len(readme_files),
readme_file))
with open(readme_file) as rf:
rlines = [Text(l) for l in rf.readlines()]
self.readme_w = BoxAdapter(ListBox(rlines),
self.initial_height)
ws = [Text("About {}:".format(app.config['spell'])),
Padding.right_50(Color.button_primary(
PlainButton("Continue",
self.do_continue),
focus_map='button_primary focus')),
Padding.center(HR()),
Padding.center(self.readme_w, left=2),
Padding.center(HR()),
Padding.center(Text("Use arrow keys to scroll text "
"and TAB to select the button."))]
self.pile = Pile(ws)
return Padding.center_90(Filler(self.pile, valign="top"))