pia-manager.py 文件源码

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

项目:pia-manager 作者: linuxmint 项目源码 文件源码
def on_menuitem_help_about_activated(self, menuitem):
        dlg = Gtk.AboutDialog()
        dlg.set_program_name(_("PIA Manager"))
        dlg.set_icon_name("pia-manager")
        dlg.set_transient_for(self.window)
        dlg.set_logo_icon_name("pia-manager")
        dlg.set_website("http://www.github.com/linuxmint/pia-manager")
        try:
            for path in ["/usr/share/common-licenses/GPL-3"]:
                if os.path.exists(path):
                    h = open(path, 'r')
                    s = h.readlines()
                    gpl = ""
                    for line in s:
                        gpl += line
                    h.close()
                    dlg.set_license(gpl)
        except Exception as e:
            print (e)
            print(sys.exc_info()[0])

        if os.path.exists("/usr/lib/linuxmint/common/version.py"):
            version = subprocess.getoutput("/usr/lib/linuxmint/common/version.py pia-manager")
            dlg.set_version(version)

        def close(w, res):
            if res == Gtk.ResponseType.CANCEL or res == Gtk.ResponseType.DELETE_EVENT:
                w.hide()
        dlg.connect("response", close)
        dlg.show()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号