Use pre-downloaded wiki descriptions.

Signed-off-by: Viktor Govako <viktor.govako@gmail.com>
This commit is contained in:
Viktor Govako
2022-04-06 16:15:29 +03:00
committed by zyphlar
parent 2bfcf0089b
commit 81c06f1ae7

View File

@@ -143,6 +143,7 @@ class StageFeatures(Stage):
@helper_stage_for("StageDescriptions")
class StageDownloadDescriptions(Stage):
def apply(self, env: Env):
"""
run_gen_tool(
env.gen_tool,
out=env.get_subprocess_out(),
@@ -165,6 +166,20 @@ class StageDownloadDescriptions(Stage):
download_from_wikidata_tags(
env.paths.id_to_wikidata_path, env.paths.descriptions_path, langs, checker
)
"""
src = "/home/planet/descriptions"
dest = env.paths.descriptions_path
# Empty folder "descriptions" can be already created.
try:
if os.path.isdir(dest):
shutil.rmtree(dest)
else:
os.remove(dest)
except OSError as e:
print("rmtree error: %s - %s" % (e.filename, e.strerror))
os.symlink(src, dest)
@outer_stage