本文整理匯總了Python中urwid.Frame.__init__方法的典型用法代碼示例。如果您正苦於以下問題:Python Frame.__init__方法的具體用法?Python Frame.__init__怎麽用?Python Frame.__init__使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類urwid.Frame
的用法示例。
在下文中一共展示了Frame.__init__方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: __init__
# 需要導入模塊: from urwid import Frame [as 別名]
# 或者: from urwid.Frame import __init__ [as 別名]
def __init__(self, loop):
header = [AttrWrap(Text(TITLE_TEXT), "border"),
AttrWrap(Text('(Q) Quit'), "border"),
AttrWrap(Text('(F5) Refresh'), "border"),
AttrWrap(Text('(F6) Add units'), "border"),
AttrWrap(Text('(F8) Console'), "border")]
header = Columns(header)
self.timer = Text("", align="left")
self.status_info = Text("", align="left")
self.horizon_url = Text("", align="right")
self.jujugui_url = Text("", align="right")
footer = Columns([('weight', 0.2, self.status_info),
('weight', 0.1, self.timer),
('weight', 0.2, self.horizon_url),
('weight', 0.2, self.jujugui_url)])
footer = AttrWrap(footer, "border")
self.poll_interval = 10
self.ticks_left = 0
self.juju_state = None
self.maas_state = None
self.nodes = ListWithHeader(NODE_HEADER)
self.loop = loop
self.cr = CommandRunner()
Frame.__init__(self, header=header, body=self.nodes,
footer=footer)
self.controller_overlay = ControllerOverlay(self, self.cr)
self._target = self.controller_overlay
示例2: __init__
# 需要導入模塊: from urwid import Frame [as 別名]
# 或者: from urwid.Frame import __init__ [as 別名]
def __init__(self,
configuration):
Frame.__init__(self,
WelcomeBuffer(),
header=TabsWidget(),
footer=StatusBar(''))
self._configuration = configuration
self._editor_mode = False
示例3: __init__
# 需要導入模塊: from urwid import Frame [as 別名]
# 或者: from urwid.Frame import __init__ [as 別名]
def __init__(self,
configuration):
self._configuration = configuration
self._editor = None
# header
header = TabsWidget()
# body
body = Banner(configuration)
# footer
self._status_bar = configuration.styles.get('status_bar', False)
if self._status_bar:
footer = StatusBar('')
else:
footer = None
Frame.__init__(self,
body,
header=header,
footer=footer)