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