INNER CODE UNIT · Python
state_file_path
cvet/fonline · BuildTools/android_device.py:94
def state_file_path(workspace_root: Path) -> Path:
return workspace_root / 'android-debug' / 'device-endpoint.txt'
def read_saved_endpoint(workspace_root: Path) -> str:
state_file = state_file_path(workspace_root)
if not state_file.is_file():
return ''
return state_file.read_text(encoding='utf-8').strip()
def write_saved_endpoint(workspace_root: Path, endpoint: str) -> None:
state_file = state_file_path(workspace_root)
state_file.parent.mkdir(parents=True, exist_ok=True)
state_file.write_text(endpoint + '\n', encoding='utf-8')
def normalize_endpoint(value: str) -> str: