File tree Expand file tree Collapse file tree
src/translate_messages/lib Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ license-files = [
2020dependencies = [
2121 " colorama>=0.4.6,<1.0.0 ; platform_system == 'Windows'" ,
2222 " json5>=0.9.0,<1.0.0" ,
23+ " project-markers>=1.0.0,<2.0.0" ,
2324 " ucs-detect>=2.0.2,<3.0.0"
2425]
2526requires-python = " >=3.8,<4.0"
Original file line number Diff line number Diff line change @@ -13,10 +13,10 @@ def cli() -> sn:
1313 return cli
1414
1515def config_file (cli : sn ) -> None : # for --init
16+ import project_markers
1617 target_path = Path .cwd () / f'.{ cli .short_name } .config.json5'
17- project_markers = data .json .read (data_path / 'project_markers.json' )
1818 in_project_root = None
19- if not any ((Path .cwd () / marker ).exists () for marker in project_markers ):
19+ if not any ((Path .cwd () / marker ).exists () for marker in project_markers ): # type: ignore
2020 log .warn (f'{ cli .msgs .warn_NO_PROJECT_ROOT_FOUND_IN } { Path .cwd ()} ' )
2121 user_resp = input (f'{ cli .msgs .prompt_INIT_CONFIG_HERE_ANYWAY } ? (y/N): ' ).strip ().lower ()
2222 if not user_resp .startswith ('y' ) : return
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ license-files = [
2020dependencies = [
2121 " colorama>=0.4.6,<1.0.0 ; platform_system == 'Windows'" ,
2222 " json5>=0.9.0,<1.0.0" ,
23+ " project-markers>=1.0.0,<2.0.0" ,
2324 " translate>=3.8.0,<4.0.0" ,
2425 " ucs-detect>=2.0.2,<3.0.0"
2526]
Original file line number Diff line number Diff line change @@ -14,10 +14,10 @@ def cli() -> sn:
1414 return cli
1515
1616def config_file (cli : sn ) -> None : # for --init
17+ import project_markers
1718 target_path = Path .cwd () / f'.{ cli .short_name } .config.json5'
18- project_markers = data .json .read (data_path / 'project_markers.json' )
1919 in_project_root = None
20- if not any ((Path .cwd () / marker ).exists () for marker in project_markers ):
20+ if not any ((Path .cwd () / marker ).exists () for marker in project_markers ): # type: ignore
2121 log .warn (f'{ cli .msgs .warn_NO_PROJECT_ROOT_FOUND_IN } { Path .cwd ()} ' )
2222 user_resp = input (f'{ cli .msgs .prompt_INIT_CONFIG_HERE_ANYWAY } ? (y/N): ' ).strip ().lower ()
2323 if not user_resp .startswith ('y' ) : return
You can’t perform that action at this time.
0 commit comments