bookmarks-indicator.py 文件源码

python
阅读 15 收藏 0 点赞 0 评论 0

项目:bookmarks-indicator 作者: antoniocoratelli 项目源码 文件源码
def onhover(self, widget, path, submenu):
        '''
        When the user hovers a folder item replace the dummy separator with the
        actual content of the folder.
        '''
        submenu = gtk.Menu()
        widget.set_submenu(submenu)
        self.append_item(submenu, os.path.join(path, "."))
        list_dirs  = get_subdirs(path)
        list_files = get_subfiles(path)
        if len(list_dirs) or len(list_files):
            self.append_separator(submenu)
        for d in sorted(list_dirs):
            self.append_item(submenu, os.path.join(path, d))
        if len(list_dirs) and len(list_files):
            self.append_separator(submenu)
        for f in sorted(list_files):
            self.append_item(submenu, os.path.join(path, f))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号