搭建python for Symbian s60开发环境(含模拟器)
2010-08-30 00:05:00 来源:WEB开发网entries = self.current_dir.list_repr()
if not self.current_dir.at_root:
entries.insert(0, (u"..", u""))
self.lb = appuifw.Listbox(entries, self.lbox_observe)
self.lb.bind(EKeyLeftArrow, lambda: self.lbox_observe(0))
old_title = appuifw.app.title
self.refresh()
self.script_lock.wait()
appuifw.app.title = old_title
appuifw.app.body = None
self.lb = None
def refresh(self):
appuifw.app.title = u"File browser"
appuifw.app.menu = []
appuifw.app.exit_key_handler = self.exit_key_handler
appuifw.app.body = self.lb
def do_exit(self):
self.exit_key_handler()
def exit_key_handler(self):
appuifw.app.exit_key_handler = None
self.script_lock.signal()
def lbox_observe(self, ind = None):
if not ind == None:
index = ind
else:
index = self.lb.current()
focused_item = 0
if self.current_dir.at_root:
self.dir_stack.append(index)
self.current_dir.add(index)
elif index == 0: # ".." selected
focused_item = self.dir_stack.pop()
self.current_dir.pop()
elif os.path.isdir(self.current_dir.entry(index-1)):
self.dir_stack.append(index)
self.current_dir.add(index-1)
else:
item = self.current_dir.entry(index-1)
if os.path.splitext(item)[1] == '.py':
i = appuifw.popup_menu([u"execfile()", u"Delete"])
else:
i = appuifw.popup_menu([u"Open", u"Delete"])
if i == 0:
if os.path.splitext(item)[1].lower() == u'.py':
execfile(item, globals())
self.refresh()
#appuifw.Content_handler().open_standalone(item)
else:
try:
appuifw.Content_handler().open(item)
- ››FOREACH 宏之GCC实现
- ››搭建DHCP服务器
- ››python操作sharepoint对象模型
- ››Python 2.6.2的.pyc文件格式
- ››Python 2.6.2的字节码指令集一览
- ››Python 测试框架: 用 Python 测试框架简化测试
- ››Python 测试框架: 寻找要测试的模块
- ››Python的class系统
- ››Python 和 LDAP
- ››python图形处理库PIL(Python Image Library)
- ››Python图形图像处理库的介绍之Image模块
- ››Python和Google AppEngine开发基于Google架构的应...
更多精彩
赞助商链接