settings.py 文件源码

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

项目:games_nebula_goglib_scripts 作者: yancharkin 项目源码 文件源码
def cb_button_patch(self, button):

        if os.path.exists(game_dir + '/' + 'br2fsaaConfig.exe'):
            self.launch_fsaa_settings()
        else:

            patch_path = download_dir + '/_distr/bloodrayne_2/BR2_FSAA_Patch_1.666.rar'

            if not os.path.exists(patch_path):

                message_dialog = Gtk.MessageDialog(
                    self.main_window,
                    0,
                    Gtk.MessageType.ERROR,
                    Gtk.ButtonsType.OK,
                    _("Patch not found in download directory.")
                    )
                content_area = message_dialog.get_content_area()
                content_area.set_property('margin-left', 10)
                content_area.set_property('margin-right', 10)
                content_area.set_property('margin-top', 10)
                content_area.set_property('margin-bottom', 10)

                self.main_window.hide()
                message_dialog.run()
                message_dialog.destroy()
                self.main_window.show()

            else:

                self.button_patch.set_sensitive(False)

                while Gtk.events_pending():
                    Gtk.main_iteration_do(False)

                command = ['7z', 'e', '-aoa', '-o' + game_dir, patch_path]

                self.pid, stdin, stdout, stderr = GLib.spawn_async(command,
                                            flags=GLib.SpawnFlags.SEARCH_PATH|GLib.SpawnFlags.DO_NOT_REAP_CHILD,
                                            standard_output=True,
                                            standard_error=True)

                io = GLib.IOChannel(stdout)

                self.source_id_out = io.add_watch(GLib.IO_IN|GLib.IO_HUP,
                                     self.watch_process,
                                     'extracting',
                                     priority=GLib.PRIORITY_HIGH)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号