applications.py 文件源码

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

项目:mate-menu 作者: ubuntu-mate 项目源码 文件源码
def favoritesSave( self ):
        try:
            self.checkMateMenuFolder()
            appListFile = open(self.favoritesPath, "w")

            for favorite in self.favorites:
                if favorite.type == "location":
                    appListFile.write( "location:" + favorite.desktopFile + "\n" )
                else:
                    appListFile.write( favorite.type + "\n" )

            appListFile.close( )
        except Exception, e:
            msgDlg = Gtk.MessageDialog( None, Gtk.DialogFlags.MODAL, Gtk.MessageType.ERROR, Gtk.ButtonsType.OK, _("Couldn't save favorites. Check if you have write access to ~/.config/mate-menu")+"\n(" + e.__str__() + ")" )
            msgDlg.run();
            msgDlg.destroy();
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号