games_nebula.py 文件源码

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

项目:games_nebula 作者: yancharkin 项目源码 文件源码
def goglib_download_game(self, game_name):

        if self.goglib_offline_mode:
            self.goglib_unpack_game(goglib_installation_queue[0])

        else:

            if not self.queue_tab_exists():
                self.append_queue_tab()

            self.progressbar_goglib.set_text(_("Downloading..."))

            if not os.path.exists(self.goglib_download_dir + '/' +  game_name):
                    os.makedirs(self.goglib_download_dir + '/' +  game_name)

            self.preferred_language = self.lang_index[self.goglib_lang.lower()]

            if self.goglib_download_extras == False:
                command = ['lgogdownloader', '--download', '--ignore-dlc-count', '--platform', '4,1', \
                            '--language', self.preferred_language + ',1,', '--game', game_name + '$', \
                            '--directory=' + self.goglib_download_dir + '/', '--exclude', '2,4,16']
            elif self.goglib_download_extras == True:
                command = ['lgogdownloader', '--download', '--ignore-dlc-count', '--platform', '4,1', \
                            '--language', self.preferred_language + ',1,', '--game', game_name + '$', \
                            '--directory=' + self.goglib_download_dir + '/', '--exclude', '4,16']

            goglib_name_to_pid_download_dict[game_name], 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,
                                    'goglib_download_game',
                                    priority=GLib.PRIORITY_HIGH)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号