feat(infra): auto-commit con 12 cambios
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
---
|
||||
name: powertoys_config_path
|
||||
kind: function
|
||||
lang: py
|
||||
domain: infra
|
||||
version: "1.0.0"
|
||||
purity: pure
|
||||
signature: "def powertoys_config_path(user: str | None = None) -> str"
|
||||
description: "Devuelve el path al default.json de PowerToys Keyboard Manager. Soporta WSL, Windows nativo y override via env var POWERTOYS_CONFIG."
|
||||
tags: [powertoys, keyboard, windows, wsl, config, path]
|
||||
uses_functions: []
|
||||
uses_types: []
|
||||
returns: []
|
||||
returns_optional: false
|
||||
error_type: ""
|
||||
imports: [os, platform]
|
||||
params:
|
||||
- name: user
|
||||
desc: "Nombre de usuario Windows. Si es None, lee $USER del entorno. Solo relevante en WSL."
|
||||
output: "Path absoluto al archivo default.json de PowerToys Keyboard Manager (el archivo puede no existir)."
|
||||
tested: false
|
||||
tests: []
|
||||
test_file_path: ""
|
||||
file_path: "python/functions/infra/powertoys_config_path.py"
|
||||
notes: |
|
||||
Clasificada como pure por convencion del registry: sin estado mutable, determinista dado el entorno.
|
||||
Lee env vars ($POWERTOYS_CONFIG, $USER, $LOCALAPPDATA, $WSL_DISTRO_NAME) que se tratan como
|
||||
parametros implicitos del entorno — comportamiento identico al de funciones puras de configuracion.
|
||||
Prioridad de resolucion: (1) $POWERTOYS_CONFIG override, (2) WSL path con /mnt/c, (3) Windows nativo.
|
||||
---
|
||||
|
||||
## Ejemplo
|
||||
|
||||
```python
|
||||
from infra.powertoys_config_path import powertoys_config_path
|
||||
|
||||
# WSL con usuario actual
|
||||
path = powertoys_config_path()
|
||||
# => /mnt/c/Users/lucas/AppData/Local/Microsoft/PowerToys/Keyboard Manager/default.json
|
||||
|
||||
# Override explicito
|
||||
import os
|
||||
os.environ["POWERTOYS_CONFIG"] = "/tmp/test_powertoys.json"
|
||||
path = powertoys_config_path()
|
||||
# => /tmp/test_powertoys.json
|
||||
```
|
||||
|
||||
## Notas
|
||||
|
||||
Detecta WSL verificando `/mnt/c` y las variables `WSL_DISTRO_NAME` / `WSLENV`.
|
||||
En Windows nativo usa `%LOCALAPPDATA%`. El archivo puede no existir si PowerToys no esta instalado.
|
||||
Reference in New Issue
Block a user