mirror of
https://github.com/dw-0/kiauh.git
synced 2025-12-24 08:13:36 +05:00
Compare commits
3 Commits
02bb1b34fd
...
ff777ce7e9
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ff777ce7e9 | ||
|
|
5ce925c734 | ||
|
|
5dd276f56b |
@@ -22,7 +22,7 @@ from utils.logger import Logger
|
||||
class Moonraker(BaseInstance):
|
||||
@classmethod
|
||||
def blacklist(cls) -> List[str]:
|
||||
return ["None", "mcu"]
|
||||
return ["None", "mcu", "obico"]
|
||||
|
||||
def __init__(self, suffix: str = ""):
|
||||
super().__init__(instance_type=self, suffix=suffix)
|
||||
|
||||
@@ -172,14 +172,18 @@ class InstanceManager:
|
||||
]
|
||||
|
||||
instance_list = [
|
||||
self.instance_type(suffix=self._get_instance_suffix(service))
|
||||
self.instance_type(suffix=self._get_instance_suffix(name, service))
|
||||
for service in service_list
|
||||
]
|
||||
|
||||
return sorted(instance_list, key=lambda x: self._sort_instance_list(x.suffix))
|
||||
|
||||
def _get_instance_suffix(self, file_path: Path) -> str:
|
||||
return file_path.stem.split("-")[-1] if "-" in file_path.stem else ""
|
||||
def _get_instance_suffix(self, name: str, file_path: Path) -> str:
|
||||
# to get the suffix of the instance, we remove the name of the instance from
|
||||
# the file name, if the remaining part an empty string we return it
|
||||
# otherwise there is and hyphen left, and we return the part after the hyphen
|
||||
suffix = file_path.stem[len(name) :]
|
||||
return suffix[1:] if suffix else ""
|
||||
|
||||
def _sort_instance_list(self, s: Union[int, str, None]):
|
||||
if s is None:
|
||||
|
||||
@@ -312,9 +312,10 @@ class ObicoExtension(BaseExtension):
|
||||
end="",
|
||||
)
|
||||
if not get_confirm("Do you want to link the printers now?"):
|
||||
self._link_obico_instances(unlinked_instances)
|
||||
else:
|
||||
Logger.print_info("Linking to server skipped ...")
|
||||
Logger.print_info("Linking to Obico server skipped ...")
|
||||
return
|
||||
|
||||
self._link_obico_instances(unlinked_instances)
|
||||
|
||||
def _remove_obico_instances(
|
||||
self,
|
||||
|
||||
Reference in New Issue
Block a user