Skip to content

Commit 63c972f

Browse files
committed
Improve loading mappings
1 parent 4b54f66 commit 63c972f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

uncoder-core/app/translator/mappings/utils/load_from_files.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from app.translator.const import APP_PATH
77

88
COMMON_FIELD_MAPPING_FILE_NAME = "common.yml"
9+
DEFAULT_FIELD_MAPPING_FILE_NAME = "default.yml"
910

1011

1112
class LoaderFileMappings:
@@ -23,8 +24,9 @@ def load_mapping(mapping_file_path: str) -> dict:
2324
def load_platform_mappings(self, platform_dir: str) -> Generator[dict, None, None]:
2425
platform_path = os.path.join(self.base_mapping_filepath, platform_dir)
2526
for mapping_file in os.listdir(platform_path):
26-
if mapping_file != COMMON_FIELD_MAPPING_FILE_NAME:
27+
if mapping_file not in (COMMON_FIELD_MAPPING_FILE_NAME, DEFAULT_FIELD_MAPPING_FILE_NAME):
2728
yield self.load_mapping(mapping_file_path=os.path.join(platform_path, mapping_file))
29+
yield self.load_mapping(mapping_file_path=os.path.join(platform_path, DEFAULT_FIELD_MAPPING_FILE_NAME))
2830

2931
def load_common_mapping(self, platform_dir: str) -> dict:
3032
platform_path = os.path.join(self.base_mapping_filepath, platform_dir)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy