add stub test, add pyproject.toml, add basic structure

This commit is contained in:
2026-05-11 23:57:27 +03:00
parent eae3533d55
commit d631b0ef68
9 changed files with 87 additions and 0 deletions
View File
View File
+25
View File
@@ -0,0 +1,25 @@
import shlex
import subprocess
from typing import Dict, Optional
def run(command: str, stdin: Optional[str] = None) -> Dict[str, str]:
process = _execute(command, stdin)
return {
"stdout": process.stdout,
"stderr": process.stderr,
}
def _parse_command(command: str) -> list[str]:
# return command.split()
return shlex.split(command)
def _execute(command: str, stdin: Optional[str] = None) -> subprocess.CompletedProcess:
parsed_command = _parse_command(command)
result = subprocess.run(
parsed_command, input=stdin, text=True, capture_output=True, shell=True
)
return result
View File
View File
+6
View File
@@ -0,0 +1,6 @@
def main() -> None:
print("nexus-sync server")
if __name__ == "__main__":
main()