當前位置: 首頁>>代碼示例>>Python>>正文


Python Padding.center_60方法代碼示例

本文整理匯總了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"))
開發者ID:benluteijn,項目名稱:conjure-up,代碼行數:16,代碼來源:newcloud.py

示例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')
開發者ID:Ubuntu-Solutions-Engineering,項目名稱:openstack-installer,代碼行數:17,代碼來源:selectordialog.py

示例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"))
開發者ID:benluteijn,項目名稱:conjure-up,代碼行數:18,代碼來源:lxdsetup.py

示例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"))
開發者ID:conjure-up,項目名稱:conjure-up,代碼行數:9,代碼來源:spellpicker.py

示例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')
開發者ID:tych0,項目名稱:conjure-up,代碼行數:19,代碼來源:spellpicker.py

示例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')
開發者ID:benluteijn,項目名稱:conjure-up,代碼行數:20,代碼來源:cloud.py

示例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
開發者ID:conjure-up,項目名稱:conjure-up,代碼行數:12,代碼來源:spellpicker.py

示例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
開發者ID:battlemidget,項目名稱:conjure-up,代碼行數:16,代碼來源:newcloud.py

示例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"))
開發者ID:Ubuntu-Solutions-Engineering,項目名稱:urwid-ubuntu,代碼行數:18,代碼來源:error.py

示例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"))
開發者ID:battlemidget,項目名稱:conjure-up,代碼行數:26,代碼來源:newcloud.py


注:本文中的ubuntui.utils.Padding.center_60方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。