本文整理汇总了Python中ubuntui.utils.Padding.right_20方法的典型用法代码示例。如果您正苦于以下问题:Python Padding.right_20方法的具体用法?Python Padding.right_20怎么用?Python Padding.right_20使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ubuntui.utils.Padding
的用法示例。
在下文中一共展示了Padding.right_20方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from ubuntui.utils import Padding [as 别名]
# 或者: from ubuntui.utils.Padding import right_20 [as 别名]
def __init__(self, app, steps, cb=None):
""" init
Arguments:
cb: process step callback
"""
self.app = app
self.table = Table()
self.cb = cb
self.steps_queue = steps
for step_model in self.steps_queue:
step_widget = self.add_step_widget(step_model)
self.table.addColumns(
step_model.path,
[
('fixed', 3, step_widget['icon']),
step_widget['description'],
]
)
# Need to still prompt for the user to submit
# even though no questions are asked
if len(step_widget['additional_input']) == 0:
self.table.addRow(
Padding.right_20(
Color.button_primary(
submit_btn(on_press=self.submit,
user_data=(step_model, step_widget)),
focus_map='button_primary focus')), False)
for i in step_widget['additional_input']:
self.table.addRow(Padding.line_break(""), False)
self.table.addColumns(
step_model.path,
[
('weight', 0.5, Padding.left(i['label'], left=5)),
('weight', 1, Color.string_input(
i['input'],
focus_map='string_input focus')),
], force=True
)
self.table.addRow(
Padding.right_20(
Color.button_primary(
submit_btn(
on_press=self.submit,
user_data=(step_model, step_widget)),
focus_map='button_primary focus')), False)
self.table.addRow(Padding.line_break(""), False)
self.table.addRow(Padding.center_20(
Color.button_primary(
done_btn(on_press=self.done, label="View Summary"),
focus_map='button_primary focus')))
super().__init__(Padding.center_80(self.table.render()))
示例2: generate_additional_input
# 需要导入模块: from ubuntui.utils import Padding [as 别名]
# 或者: from ubuntui.utils.Padding import right_20 [as 别名]
def generate_additional_input(self):
""" Generates additional input fields, useful for doing it after
a previous step is run
"""
self.set_description(self.model.description, 'body')
self.icon.set_text((
'pending_icon',
self.icon.get_text()[0]
))
for i in self.additional_input:
self.app.log.debug(i)
self.step_pile.contents.append((Padding.line_break(""),
self.step_pile.options()))
column_input = [
('weight', 0.5, Padding.left(i['label'], left=5))
]
if i['input']:
column_input.append(
('weight', 1, Color.string_input(
i['input'],
focus_map='string_input focus')))
self.step_pile.contents.append(
(Columns(column_input, dividechars=3),
self.step_pile.options()))
self.button = submit_btn(label="Run", on_press=self.submit)
self.step_pile.contents.append(
(Padding.right_20(
Color.button_primary(self.button,
focus_map='button_primary focus')),
self.step_pile.options()))
self.step_pile.contents.append((HR(), self.step_pile.options()))
self.step_pile.focus_position = self.current_button_index