本文整理汇总了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)