[python][generator] Fixed stage_external_resources.

This commit is contained in:
Maksim Andrianov 2019-06-20 02:47:43 +03:00 committed by gmoryes
parent af0c5a68db
commit 1f4312f4c4

View file

@ -253,9 +253,10 @@ def stage_countries_txt(env):
@stage
def stage_external_resources(env):
black_list = {"00_roboto_regular.ttf"}
resources = [os.path.join(env.user_resource_path, file)
for file in os.listdir(env.user_resource_path)
if file.endswith(".ttf")]
if file.endswith(".ttf") and file not in black_list]
for ttf_file in resources:
shutil.copy2(ttf_file, env.intermediate_path)
@ -271,7 +272,7 @@ def stage_external_resources(env):
with open(env.external_resources_path, "w") as f:
for resource in resources:
fd = os.open(resource, os.O_RDONLY)
f.write(f"{os.path.basename(resource)} {os.fstat(fd).st_size}")
f.write(f"{os.path.basename(resource)} {os.fstat(fd).st_size}\n")
@stage