mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-20 13:23:59 +00:00
Use pre-downloaded wiki descriptions.
Signed-off-by: Viktor Govako <viktor.govako@gmail.com>
This commit is contained in:
@@ -143,6 +143,7 @@ class StageFeatures(Stage):
|
|||||||
@helper_stage_for("StageDescriptions")
|
@helper_stage_for("StageDescriptions")
|
||||||
class StageDownloadDescriptions(Stage):
|
class StageDownloadDescriptions(Stage):
|
||||||
def apply(self, env: Env):
|
def apply(self, env: Env):
|
||||||
|
"""
|
||||||
run_gen_tool(
|
run_gen_tool(
|
||||||
env.gen_tool,
|
env.gen_tool,
|
||||||
out=env.get_subprocess_out(),
|
out=env.get_subprocess_out(),
|
||||||
@@ -165,6 +166,20 @@ class StageDownloadDescriptions(Stage):
|
|||||||
download_from_wikidata_tags(
|
download_from_wikidata_tags(
|
||||||
env.paths.id_to_wikidata_path, env.paths.descriptions_path, langs, checker
|
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
|
@outer_stage
|
||||||
|
|||||||
Reference in New Issue
Block a user