File tree Expand file tree Collapse file tree 3 files changed +17
-10
lines changed Expand file tree Collapse file tree 3 files changed +17
-10
lines changed Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ def get_platforms_details(self) -> list[TranslatorPlatform]:
77
77
alt_platform = platform .details .alt_platform ,
78
78
first_choice = platform .details .first_choice ,
79
79
)
80
- for platform in self .main_platforms .values ()
80
+ for platform in self .platforms .values ()
81
81
]
82
82
return sorted (platforms , key = lambda platform : platform .group_name )
83
83
Original file line number Diff line number Diff line change 1
1
import importlib .util
2
2
import os
3
3
4
- from const import ROOT_PROJECT_PATH
5
-
6
- platforms_path = ROOT_PROJECT_PATH + "/app/translator/platforms"
7
- for platform in [f for f in os .listdir (platforms_path ) if os .path .isdir (os .path .join (platforms_path , f ))]:
8
- if "__" not in platform :
9
- init_path = f"{ platforms_path } /{ platform } /__init__.py"
10
- spec = importlib .util .spec_from_file_location ("__init__" , init_path )
11
- foo = importlib .util .module_from_spec (spec )
12
- spec .loader .exec_module (foo )
4
+ from const import PLATFORMS_PATH
5
+
6
+
7
+ def init_platforms ():
8
+ for platform in [f for f in os .listdir (PLATFORMS_PATH ) if os .path .isdir (os .path .join (PLATFORMS_PATH , f ))]:
9
+ if not platform .startswith ("__" ) and not platform .endswith ("__" ):
10
+ # Platforms __init__.py execution
11
+ init_path = f"{ PLATFORMS_PATH } /{ platform } /__init__.py"
12
+ spec = importlib .util .spec_from_file_location ("__init__" , init_path )
13
+ init_module = importlib .util .module_from_spec (spec )
14
+ spec .loader .exec_module (init_module )
15
+
16
+
17
+ init_platforms ()
Original file line number Diff line number Diff line change 1
1
import os
2
2
3
3
ROOT_PROJECT_PATH = os .path .abspath (os .path .dirname (__file__ ))
4
+
5
+ PLATFORMS_PATH = ROOT_PROJECT_PATH + "/app/translator/platforms"
You can’t perform that action at this time.
0 commit comments