1 Star 0 Fork 0

nuohy/deep-visualization-toolbox

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
app_base.py 1.37 KB
一键复制 编辑 原始数据 按行查看 历史
Jason Yosinski 提交于 10年前 . Basic working version
#! /usr/bin/env python
class BaseApp(object):
'''Base App class.'''
def __init__(self, settings, key_bindings):
self.debug_level = 0
def handle_input(self, input_image, panes):
pass
def handle_key(self, key, panes):
'''Handle key and return either key (to let someone downstream handle it) or None (if this app handled it)'''
pass
def redraw_needed(self, key, panes):
'''App should return whether or not its internal state has
been updated (perhaps in response to handle_key, handle_input,
or some internal processing finishing).
'''
return False
def draw(self, panes):
'''Tells the app to draw in the given panes. Returns True if panes were changed and require a redraw, False if nothing was changed.'''
return False
def draw_help(self, panes):
'''Tells the app to draw its help screen in the given pane. No return necessary.'''
pass
def start(self):
'''Notify app to start, possibly creating any necessary threads'''
pass
def get_heartbeats(self):
'''Returns a list of heartbeat functions, if any, that should be called regularly.'''
return []
def set_debug(self, level):
self.debug_level = level
def quit(self):
'''Notify app to quit, possibly joining any threads'''
pass
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/nuohy/deep-visualization-toolbox.git
git@gitee.com:nuohy/deep-visualization-toolbox.git
nuohy
deep-visualization-toolbox
deep-visualization-toolbox
master

搜索帮助