diff --git a/kalite/updates/management/commands/languagepackdownload.py b/kalite/updates/management/commands/languagepackdownload.py index 4bc43a7c92..776129ef8f 100644 --- a/kalite/updates/management/commands/languagepackdownload.py +++ b/kalite/updates/management/commands/languagepackdownload.py @@ -103,7 +103,7 @@ def handle(self, *args, **options): raise def cb(self, percent): - self.update_stage(stage_percent=percent/100.) + self.update_stage(stage_percent=percent / 100.) def get_language_pack(lang_code, software_version, callback): """Download language pack for specified language""" @@ -122,7 +122,7 @@ def unpack_language(lang_code, zip_filepath=None, zip_fp=None, zip_data=None): logging.info("Unpacking new translations") ensure_dir(get_po_filepath(lang_code=lang_code)) - ## Unpack into temp dir + # # Unpack into temp dir z = zipfile.ZipFile(zip_fp or (zip_data and StringIO(zip_data)) or open(zip_filepath, "rb")) z.extractall(os.path.join(settings.USER_WRITABLE_LOCALE_DIR, lang_code)) @@ -144,17 +144,11 @@ def move_dubbed_video_map(lang_code): logging.error("Error removing dubbed video directory (%s): %s" % (dubbed_video_dir, e)) def move_video_sizes_file(lang_code): - lang_pack_location = os.path.join(settings.USER_WRITABLE_LOCALE_DIR, lang_code) - filename = os.path.basename(REMOTE_VIDEO_SIZE_FILEPATH) - src_path = os.path.join(lang_pack_location, filename) - dest_path = REMOTE_VIDEO_SIZE_FILEPATH - - # replace the old remote_video_size json - if not os.path.exists(src_path): - logging.error("Could not find videos sizes file (%s)" % src_path) - else: - logging.debug('Moving %s to %s' % (src_path, dest_path)) - shutil.move(src_path, dest_path) + """ + This is no longer needed. See: + https://github.com/learningequality/ka-lite/issues/4538#issuecomment-144560505 + """ + return def move_exercises(lang_code): lang_pack_location = os.path.join(settings.USER_WRITABLE_LOCALE_DIR, lang_code) diff --git a/kalite/updates/videos.py b/kalite/updates/videos.py index b336b4543b..b9240d9691 100644 --- a/kalite/updates/videos.py +++ b/kalite/updates/videos.py @@ -6,6 +6,9 @@ from fle_utils import videos # keep access to all functions from fle_utils.general import softload_json + +# I will have nightmares from this :) +# Fixing all this in 0.16 from fle_utils.videos import * # get all into the current namespace, override some. from kalite.topic_tools import settings as topic_tools_settings