Compare commits

..

1 Commits

Author SHA1 Message Date
dw-0
eabdca0e3d Merge 1620efe56c into b6c6edb622 2024-03-02 17:24:05 +01:00
3 changed files with 4 additions and 8 deletions

View File

@@ -53,16 +53,12 @@ def remove_client_config_dir(client_config: ClientConfigData) -> None:
def remove_client_config_symlink(client_config: ClientConfigData) -> None: def remove_client_config_symlink(client_config: ClientConfigData) -> None:
Logger.print_status(f"Removing {client_config.get('cfg_filename')} symlinks ...")
im = InstanceManager(Klipper) im = InstanceManager(Klipper)
instances: List[Klipper] = im.instances instances: List[Klipper] = im.instances
for instance in instances: for instance in instances:
Logger.print_status(f"Removing symlink from '{instance.cfg_file}' ...") Logger.print_status(f"Removing symlink from '{instance.cfg_file}' ...")
symlink = instance.cfg_dir.joinpath(client_config.get("cfg_filename"))
if not symlink.exists():
Logger.print_info(f"'{symlink}' does not exist. Skipping ...")
continue
try: try:
remove_file(symlink) remove_file(instance.cfg_dir.joinpath(client_config.get("cfg_filename")))
except subprocess.CalledProcessError: except subprocess.CalledProcessError:
Logger.print_error("Failed to remove symlink!") Logger.print_error("Failed to remove symlink!")

View File

@@ -71,6 +71,7 @@ def print_client_port_select_dialog(name: str, port: str, ports_in_use: List[str
| {line2:<54}| | {line2:<54}|
| port, you can set it now. Make sure the port is not | | port, you can set it now. Make sure the port is not |
| used by any other application on your system! | | used by any other application on your system! |
\\=======================================================/
""" """
)[1:] )[1:]

View File

@@ -107,8 +107,7 @@ def install_client(client_name: ClientName) -> None:
install_client_cfg = get_confirm(question, allow_go_back=False) install_client_cfg = get_confirm(question, allow_go_back=False)
cm = ConfigManager(cfg_file=KIAUH_CFG) cm = ConfigManager(cfg_file=KIAUH_CFG)
default_port = cm.get_value(client.get("name"), "port") client_port = cm.get_value(client.get("name"), "port")
client_port = default_port if default_port and default_port.isdigit() else "80"
ports_in_use = read_ports_from_nginx_configs() ports_in_use = read_ports_from_nginx_configs()
# check if configured port is a valid number and not in use already # check if configured port is a valid number and not in use already