Skip to content

Commit 55675fc

Browse files
committed
Used project-markers pkg
1 parent f2e21c7 commit 55675fc

4 files changed

Lines changed: 6 additions & 4 deletions

File tree

remove-json-keys/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ license-files = [
2020
dependencies = [
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
]
2526
requires-python = ">=3.8,<4.0"

remove-json-keys/src/remove_json_keys/lib/init.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ def cli() -> sn:
1313
return cli
1414

1515
def 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

translate-messages/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ license-files = [
2020
dependencies = [
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
]

translate-messages/src/translate_messages/lib/init.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ def cli() -> sn:
1414
return cli
1515

1616
def 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

0 commit comments

Comments
 (0)