Files
server-manager/core/connection_factory.py
chrome-storm-c442 6179ded862 Initial commit: ServerManager GUI application
CustomTkinter desktop app for managing remote servers.
Features: SSH terminal, SFTP file transfer, key management,
background status monitoring, server CRUD with dark theme.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 07:49:13 -05:00

26 lines
904 B
Python

"""
Connection factory — stubs for non-SSH connection types.
SSH is fully implemented via SSHClientWrapper.
Other types are placeholders for future implementation.
"""
from core.ssh_client import SSHClientWrapper
def create_connection(server: dict, key_path: str = ""):
"""Create a connection wrapper based on server type."""
server_type = server.get("type", "ssh")
if server_type == "ssh":
return SSHClientWrapper(server, key_path)
# Stubs for future types
if server_type == "rdp":
raise NotImplementedError("RDP connections — use mstsc.exe or rdesktop")
if server_type == "telnet":
raise NotImplementedError("Telnet connections — planned")
if server_type in ("mariadb", "mssql", "postgresql"):
raise NotImplementedError(f"{server_type.upper()} connections — planned")
raise ValueError(f"Unknown server type: {server_type}")