def sync_all(self, seed): synced_elements = self.get_mods(only_selected=True) # Work on the copy if self.launcher: synced_elements.append(self.launcher) # If we are only seeding, ensure we pass only ready-to-seed mods # Note: the libtorrent seed-only flags prevent downloading data, but # still truncate the file anyway - something we want to prevent here if seed: synced_elements = filter(lambda mod: mod.is_complete(), synced_elements) para = protected_para( _sync_all, ( synced_elements, self.settings.get('max_download_speed'), self.settings.get('max_upload_speed'), seed ), 'sync', then=(None, None, self.on_sync_all_progress), use_threads=False ) return para
def query_servers(servers): para = protected_para( third_party.steam_query.query_servers, ( servers ), 'query_servers' ) return para
def sync_launcher(self, seed=False): para = protected_para( _sync_all, ([self.launcher], self.settings.get('max_download_speed'), self.settings.get('max_upload_speed'), seed), 'sync', then=(None, None, self.on_sync_all_progress), use_threads=False) return para
def prepare_and_check(self, data): para = protected_para(_prepare_and_check, (self.settings.get('launcher_moddir'), self.settings.get('launcher_basedir'), data, self.settings.get('selected_optional_mods')), 'checkmods', then=(self.on_prepare_and_check_resolve, None, None)) return para
def make_torrent(self, mods): para = protected_para( torrent_uploader.make_torrent, ( self.settings.get('launcher_basedir'), mods ), 'make_torrent' ) return para
def prepare_all(self): para = protected_para( prepare_all, # Note: the launcher takes the list of all the mod here but then it # drops the ones that are optional and not selected after the # directory normalizing process is done and before starting the # "search on disk for the mod" part. (self.get_mods(), self.get_mods(include_all_servers=True), self.settings.get('launcher_moddir')), 'prepare_all') return para
def download_mod_description(self, dry_run=False): if dry_run: then = None else: then = (self.on_download_mod_description_resolve, self.on_download_mod_description_reject, None) para = protected_para(_get_mod_descriptions, (), 'download_description', then=then) return para
def set_new_path(self, new_path): # Set the loader icon for the time being self.ids.status_image.source = paths.get_resources_path('images/loader.zip') self.ids.status_image.opacity = 1 self.ids.status_image.color = self.icon_color para = protected_para( manager_functions.symlink_mod, (self.mod.get_full_path(), new_path), 'symlink_mod', then=(self.on_resolve, self.on_reject, None) ) # Need to assign to self or it is going to be garbage collected and # callbacks won't fire self.paras.append(para)
def download_mod_description(self, dry_run=False): if dry_run: then = None else: then = (self.on_download_mod_description_resolve, self.on_download_mod_description_reject, None) para = protected_para(_get_mod_descriptions, ( self.settings.get('auth_login'), self.settings.get('auth_password'), ), 'download_description', then=then ) return para