Compare commits

..

2 Commits

Author SHA1 Message Date
skarasov
04938f2ada Merge 6a766f7882 into b02df9a1e0 2024-11-26 04:55:49 +00:00
skarasov
6a766f7882 Support of no id micro-controllers, see: [https://www.klipper3d.org/FAQ.html#wheres-my-serial-port] 2023-07-07 18:56:29 +03:00
4 changed files with 7 additions and 10 deletions

View File

@@ -79,14 +79,14 @@ class BackupManager:
if source is None or not Path(source).exists():
Logger.print_info("Source directory does not exist! Skipping ...")
return None
return
target = self.backup_root_dir if target is None else target
try:
date = get_current_date().get("date")
time = get_current_date().get("time")
backup_target = target.joinpath(f"{name.lower()}-{date}-{time}")
shutil.copytree(source, backup_target, ignore=self.ignore_folders_func, ignore_dangling_symlinks=True)
shutil.copytree(source, backup_target, ignore=self.ignore_folders_func)
Logger.print_ok("Backup successful!")
return backup_target

View File

@@ -43,8 +43,7 @@ def get_kiauh_version() -> str:
Helper method to get the current KIAUH version by reading the latest tag
:return: string of the latest tag
"""
lastest_tag: str = get_local_tags(Path(__file__).parent.parent)[-1]
return lastest_tag
return get_local_tags(Path(__file__).parent.parent)[-1]
def convert_camelcase_to_kebabcase(name: str) -> str:

View File

@@ -1,7 +1,6 @@
from __future__ import annotations
import json
import re
import shutil
import urllib.request
from http.client import HTTPResponse
@@ -119,7 +118,7 @@ def get_local_tags(repo_path: Path, _filter: str | None = None) -> List[str]:
:return: List of tags
"""
try:
cmd: List[str] = ["git", "tag", "-l"]
cmd = ["git", "tag", "-l"]
if _filter is not None:
cmd.append(f"'${_filter}'")
@@ -130,10 +129,8 @@ def get_local_tags(repo_path: Path, _filter: str | None = None) -> List[str]:
cwd=repo_path.as_posix(),
).decode(encoding="utf-8")
tags: List[str] = result.split("\n")[:-1]
return sorted(tags, key=lambda x: [int(i) if i.isdigit() else i for i in
re.split(r'(\d+)', x)])
tags = result.split("\n")
return tags[:-1]
except CalledProcessError:
return []

View File

@@ -358,6 +358,7 @@ function get_usb_id() {
unset mcu_list
sleep 1
mcus=$(find /dev/serial/by-id/* 2>/dev/null)
mcus+=" $(find /dev/serial/by-path/* 2>/dev/null)"
for mcu in ${mcus}; do
mcu_list+=("${mcu}")