ruff: apply automatic unsafe fixes
This commit is contained in:
@@ -352,7 +352,7 @@ Learn how to use `clanServices` in practice in the [Using clanServices guide](..
|
|||||||
|
|
||||||
output += f"The {module_name} module has the following roles:\n\n"
|
output += f"The {module_name} module has the following roles:\n\n"
|
||||||
|
|
||||||
for role_name, _ in module_info["roles"].items():
|
for role_name in module_info["roles"]:
|
||||||
output += f"- {role_name}\n"
|
output += f"- {role_name}\n"
|
||||||
|
|
||||||
for role_name, role_filename in module_info["roles"].items():
|
for role_name, role_filename in module_info["roles"].items():
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ def _get_lib_names() -> list[str]:
|
|||||||
machine = platform.machine().lower()
|
machine = platform.machine().lower()
|
||||||
|
|
||||||
if system == "windows":
|
if system == "windows":
|
||||||
if machine == "amd64" or machine == "x86_64":
|
if machine in {"amd64", "x86_64"}:
|
||||||
return ["webview.dll", "WebView2Loader.dll"]
|
return ["webview.dll", "WebView2Loader.dll"]
|
||||||
if machine == "arm64":
|
if machine == "arm64":
|
||||||
msg = "arm64 is not supported on Windows"
|
msg = "arm64 is not supported on Windows"
|
||||||
|
|||||||
@@ -2,12 +2,15 @@ from __future__ import annotations
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
import subprocess
|
import subprocess
|
||||||
from pathlib import Path
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
from clan_lib.custom_logger import setup_logging
|
from clan_lib.custom_logger import setup_logging
|
||||||
from clan_lib.nix import nix_shell
|
from clan_lib.nix import nix_shell
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
pytest_plugins = [
|
pytest_plugins = [
|
||||||
"temporary_dir",
|
"temporary_dir",
|
||||||
"root",
|
"root",
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ def register_common_flags(parser: argparse.ArgumentParser) -> None:
|
|||||||
has_subparsers = False
|
has_subparsers = False
|
||||||
for action in parser._actions: # noqa: SLF001
|
for action in parser._actions: # noqa: SLF001
|
||||||
if isinstance(action, argparse._SubParsersAction): # noqa: SLF001
|
if isinstance(action, argparse._SubParsersAction): # noqa: SLF001
|
||||||
for _choice, child_parser in action.choices.items():
|
for child_parser in action.choices.values():
|
||||||
has_subparsers = True
|
has_subparsers = True
|
||||||
register_common_flags(child_parser)
|
register_common_flags(child_parser)
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from abc import ABC, abstractmethod
|
from abc import ABC, abstractmethod
|
||||||
from pathlib import Path
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from clan_lib.machines import machines
|
if TYPE_CHECKING:
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
from clan_lib.machines import machines
|
||||||
|
|
||||||
|
|
||||||
class FactStoreBase(ABC):
|
class FactStoreBase(ABC):
|
||||||
|
|||||||
@@ -1,10 +1,13 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from abc import ABC, abstractmethod
|
from abc import ABC, abstractmethod
|
||||||
from pathlib import Path
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from clan_lib.machines import machines
|
if TYPE_CHECKING:
|
||||||
from clan_lib.ssh.host import Host
|
from pathlib import Path
|
||||||
|
|
||||||
|
from clan_lib.machines import machines
|
||||||
|
from clan_lib.ssh.host import Host
|
||||||
|
|
||||||
|
|
||||||
class SecretStoreBase(ABC):
|
class SecretStoreBase(ABC):
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ def install_command(args: argparse.Namespace) -> None:
|
|||||||
)
|
)
|
||||||
if ask == "y":
|
if ask == "y":
|
||||||
break
|
break
|
||||||
if ask == "n" or ask == "":
|
if ask in {"n", ""}:
|
||||||
return None
|
return None
|
||||||
print(
|
print(
|
||||||
f"Invalid input '{ask}'. Please enter 'y' for yes or 'n' for no.",
|
f"Invalid input '{ask}'. Please enter 'y' for yes or 'n' for no.",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import argparse
|
import argparse
|
||||||
import logging
|
import logging
|
||||||
import sys
|
import sys
|
||||||
from typing import get_args
|
from typing import TYPE_CHECKING, get_args
|
||||||
|
|
||||||
from clan_lib.async_run import AsyncContext, AsyncOpts, AsyncRuntime
|
from clan_lib.async_run import AsyncContext, AsyncOpts, AsyncRuntime
|
||||||
from clan_lib.errors import ClanError
|
from clan_lib.errors import ClanError
|
||||||
@@ -14,7 +14,6 @@ from clan_lib.machines.suggestions import validate_machine_names
|
|||||||
from clan_lib.machines.update import run_machine_update
|
from clan_lib.machines.update import run_machine_update
|
||||||
from clan_lib.network.network import get_best_remote
|
from clan_lib.network.network import get_best_remote
|
||||||
from clan_lib.nix import nix_config
|
from clan_lib.nix import nix_config
|
||||||
from clan_lib.ssh.host import Host
|
|
||||||
from clan_lib.ssh.host_key import HostKeyCheck
|
from clan_lib.ssh.host_key import HostKeyCheck
|
||||||
from clan_lib.ssh.localhost import LocalHost
|
from clan_lib.ssh.localhost import LocalHost
|
||||||
from clan_lib.ssh.remote import Remote
|
from clan_lib.ssh.remote import Remote
|
||||||
@@ -25,6 +24,9 @@ from clan_cli.completions import (
|
|||||||
complete_tags,
|
complete_tags,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from clan_lib.ssh.host import Host
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -16,10 +16,10 @@ def list_command(args: argparse.Namespace) -> None:
|
|||||||
return
|
return
|
||||||
|
|
||||||
# Calculate column widths
|
# Calculate column widths
|
||||||
col_network = max(12, max(len(name) for name in networks))
|
col_network = max(12, *(len(name) for name in networks))
|
||||||
col_priority = 8
|
col_priority = 8
|
||||||
col_module = max(
|
col_module = max(
|
||||||
10, max(len(net.module_name.split(".")[-1]) for net in networks.values()),
|
10, *(len(net.module_name.split(".")[-1]) for net in networks.values())
|
||||||
)
|
)
|
||||||
col_running = 8
|
col_running = 8
|
||||||
|
|
||||||
|
|||||||
@@ -262,7 +262,7 @@ def add_secret(
|
|||||||
|
|
||||||
def get_groups(flake_dir: Path, what: str, name: str) -> list[str]:
|
def get_groups(flake_dir: Path, what: str, name: str) -> list[str]:
|
||||||
"""Returns the list of group names the given user or machine is part of."""
|
"""Returns the list of group names the given user or machine is part of."""
|
||||||
assert what == "users" or what == "machines"
|
assert what in {"users", "machines"}
|
||||||
|
|
||||||
groups_dir = sops_groups_folder(flake_dir)
|
groups_dir = sops_groups_folder(flake_dir)
|
||||||
if not groups_dir.exists():
|
if not groups_dir.exists():
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
import argparse
|
import argparse
|
||||||
import json
|
import json
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from clan_lib.flake import Flake
|
if TYPE_CHECKING:
|
||||||
|
from clan_lib.flake import Flake
|
||||||
|
|
||||||
|
|
||||||
def select_command(args: argparse.Namespace) -> None:
|
def select_command(args: argparse.Namespace) -> None:
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
import argparse
|
import argparse
|
||||||
import logging
|
import logging
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from clan_lib.nix_models.clan import TemplateClanType
|
|
||||||
from clan_lib.templates import list_templates
|
from clan_lib.templates import list_templates
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from clan_lib.nix_models.clan import TemplateClanType
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import argparse
|
import argparse
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from clan_cli.completions import (
|
from clan_cli.completions import (
|
||||||
add_dynamic_completer,
|
add_dynamic_completer,
|
||||||
@@ -7,10 +8,12 @@ from clan_cli.completions import (
|
|||||||
)
|
)
|
||||||
from clan_lib.flake import require_flake
|
from clan_lib.flake import require_flake
|
||||||
from clan_lib.machines.list import list_full_machines
|
from clan_lib.machines.list import list_full_machines
|
||||||
from clan_lib.machines.machines import Machine
|
|
||||||
from clan_lib.nix import nix_config
|
from clan_lib.nix import nix_config
|
||||||
from clan_lib.vars.generate import run_generators
|
from clan_lib.vars.generate import run_generators
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from clan_lib.machines.machines import Machine
|
||||||
|
|
||||||
|
|
||||||
def generate_command(args: argparse.Namespace) -> None:
|
def generate_command(args: argparse.Namespace) -> None:
|
||||||
flake = require_flake(args.flake)
|
flake = require_flake(args.flake)
|
||||||
|
|||||||
@@ -4,14 +4,16 @@ from functools import cached_property
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from clan_lib.flake import Flake
|
|
||||||
from clan_lib.machines.machines import Machine
|
|
||||||
from clan_lib.nix import nix_test_store
|
from clan_lib.nix import nix_test_store
|
||||||
|
|
||||||
from .check import check_vars
|
from .check import check_vars
|
||||||
from .prompt import Prompt
|
from .prompt import Prompt
|
||||||
from .var import Var
|
from .var import Var
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from clan_lib.flake import Flake
|
||||||
|
from clan_lib.machines.machines import Machine
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from ._types import StoreBase
|
from ._types import StoreBase
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from collections.abc import Iterable
|
|
||||||
from graphlib import TopologicalSorter
|
from graphlib import TopologicalSorter
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from clan_lib.errors import ClanError
|
from clan_lib.errors import ClanError
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
|
from collections.abc import Iterable
|
||||||
|
|
||||||
from .generator import Generator, GeneratorKey
|
from .generator import Generator, GeneratorKey
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ def get_multiline_hidden_input() -> str:
|
|||||||
raise KeyboardInterrupt
|
raise KeyboardInterrupt
|
||||||
|
|
||||||
# Handle Enter key
|
# Handle Enter key
|
||||||
if char == "\r" or char == "\n":
|
if char in {"\r", "\n"}:
|
||||||
lines.append("".join(current_line))
|
lines.append("".join(current_line))
|
||||||
current_line = []
|
current_line = []
|
||||||
# Print newline for visual feedback
|
# Print newline for visual feedback
|
||||||
|
|||||||
@@ -145,9 +145,9 @@ def color(
|
|||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
print("====ANSI Colors====")
|
print("====ANSI Colors====")
|
||||||
for _, value in AnsiColor.__members__.items():
|
for value in AnsiColor.__members__.values():
|
||||||
print(color_by_tuple(f"{value}", fg=value.value))
|
print(color_by_tuple(f"{value}", fg=value.value))
|
||||||
|
|
||||||
print("====CSS Colors====")
|
print("====CSS Colors====")
|
||||||
for _, cs_value in RgbColor.__members__.items():
|
for cs_value in RgbColor.__members__.values():
|
||||||
print(color_by_tuple(f"{cs_value}", fg=cs_value.value))
|
print(color_by_tuple(f"{cs_value}", fg=cs_value.value))
|
||||||
|
|||||||
@@ -4,10 +4,12 @@ import sys
|
|||||||
import urllib.parse
|
import urllib.parse
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Protocol
|
from typing import TYPE_CHECKING, Protocol
|
||||||
|
|
||||||
from clan_lib.errors import ClanError
|
from clan_lib.errors import ClanError
|
||||||
from clan_lib.flake import Flake
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from clan_lib.flake import Flake
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|||||||
@@ -318,7 +318,7 @@ def parse_selector(selector: str) -> list[Selector]:
|
|||||||
stack.pop()
|
stack.pop()
|
||||||
acc_str += c
|
acc_str += c
|
||||||
|
|
||||||
elif mode == "str" or mode == "maybe":
|
elif mode in {"str", "maybe"}:
|
||||||
if c == ".":
|
if c == ".":
|
||||||
stack.pop()
|
stack.pop()
|
||||||
if mode == "maybe":
|
if mode == "maybe":
|
||||||
@@ -517,9 +517,9 @@ class FlakeCacheEntry:
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
# string and maybe work the same for cache checking
|
# string and maybe work the same for cache checking
|
||||||
if (
|
if (selector.type in (SelectorType.STR, SelectorType.MAYBE)) and isinstance(
|
||||||
selector.type == SelectorType.STR or selector.type == SelectorType.MAYBE
|
self.value, dict
|
||||||
) and isinstance(self.value, dict):
|
):
|
||||||
assert isinstance(selector.value, str)
|
assert isinstance(selector.value, str)
|
||||||
val = selector.value
|
val = selector.value
|
||||||
if val not in self.value:
|
if val not in self.value:
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import logging
|
import logging
|
||||||
import shutil
|
import shutil
|
||||||
from pathlib import Path
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from clan_cli.secrets.folders import sops_secrets_folder
|
from clan_cli.secrets.folders import sops_secrets_folder
|
||||||
from clan_cli.secrets.machines import has_machine as secrets_has_machine
|
from clan_cli.secrets.machines import has_machine as secrets_has_machine
|
||||||
@@ -14,6 +14,9 @@ from clan_lib.dirs import specific_machine_dir
|
|||||||
from clan_lib.machines.machines import Machine
|
from clan_lib.machines.machines import Machine
|
||||||
from clan_lib.persist.inventory_store import InventoryStore
|
from clan_lib.persist.inventory_store import InventoryStore
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -5,16 +5,18 @@ from collections.abc import Iterator
|
|||||||
from contextlib import contextmanager
|
from contextlib import contextmanager
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from functools import cached_property
|
from functools import cached_property
|
||||||
from typing import Any
|
from typing import TYPE_CHECKING, Any
|
||||||
|
|
||||||
from clan_cli.vars.get import get_machine_var
|
from clan_cli.vars.get import get_machine_var
|
||||||
|
|
||||||
from clan_lib.errors import ClanError
|
from clan_lib.errors import ClanError
|
||||||
from clan_lib.flake import Flake
|
from clan_lib.flake import Flake
|
||||||
from clan_lib.import_utils import ClassSource, import_with_source
|
from clan_lib.import_utils import ClassSource, import_with_source
|
||||||
from clan_lib.machines.machines import Machine
|
|
||||||
from clan_lib.ssh.remote import Remote
|
from clan_lib.ssh.remote import Remote
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from clan_lib.machines.machines import Machine
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -10,10 +10,6 @@ from clan_lib.network.tor.lib import is_tor_running, spawn_tor
|
|||||||
from clan_lib.ssh.remote import Remote
|
from clan_lib.ssh.remote import Remote
|
||||||
from clan_lib.ssh.socks_wrapper import tor_wrapper
|
from clan_lib.ssh.socks_wrapper import tor_wrapper
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
|
||||||
from clan_lib.ssh.remote import Remote
|
|
||||||
|
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ def path_match(path: list[str], whitelist_paths: list[list[str]]) -> bool:
|
|||||||
continue
|
continue
|
||||||
match = True
|
match = True
|
||||||
for p, w in zip(path, wp, strict=False):
|
for p, w in zip(path, wp, strict=False):
|
||||||
if w != "*" and p != w:
|
if w not in ("*", p):
|
||||||
match = False
|
match = False
|
||||||
break
|
break
|
||||||
if match:
|
if match:
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ def list_service_instances(flake: Flake) -> InventoryInstancesType:
|
|||||||
|
|
||||||
def collect_tags(machines: InventoryMachinesType) -> set[str]:
|
def collect_tags(machines: InventoryMachinesType) -> set[str]:
|
||||||
res = set()
|
res = set()
|
||||||
for _, machine in machines.items():
|
for machine in machines.values():
|
||||||
res |= set(machine.get("tags", []))
|
res |= set(machine.get("tags", []))
|
||||||
|
|
||||||
return res
|
return res
|
||||||
|
|||||||
@@ -267,7 +267,7 @@ def create_service_instance(
|
|||||||
|
|
||||||
# TODO: Check the roles against the schema
|
# TODO: Check the roles against the schema
|
||||||
schema = get_service_module_schema(flake, module_ref)
|
schema = get_service_module_schema(flake, module_ref)
|
||||||
for role_name, _role in roles.items():
|
for role_name in roles:
|
||||||
if role_name not in schema:
|
if role_name not in schema:
|
||||||
msg = f"Role '{role_name}' is not defined in the module schema"
|
msg = f"Role '{role_name}' is not defined in the module schema"
|
||||||
raise ClanError(msg)
|
raise ClanError(msg)
|
||||||
|
|||||||
@@ -83,11 +83,7 @@ def transform_url(template_type: str, identifier: str, flake: Flake) -> tuple[st
|
|||||||
if "#" not in identifier:
|
if "#" not in identifier:
|
||||||
# Local path references are not transformed
|
# Local path references are not transformed
|
||||||
# return flake_ref=identifier, template='default'
|
# return flake_ref=identifier, template='default'
|
||||||
if (
|
if identifier.startswith(("/", "~/", "./", "../")) or identifier in {".", ".."}:
|
||||||
identifier.startswith(("/", "~/", "./", "../"))
|
|
||||||
or identifier == "."
|
|
||||||
or identifier == ".."
|
|
||||||
):
|
|
||||||
return (identifier, f"clan.templates.{template_type}.default")
|
return (identifier, f"clan.templates.{template_type}.default")
|
||||||
|
|
||||||
# No fragment, so we assume its a builtin template
|
# No fragment, so we assume its a builtin template
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import logging
|
import logging
|
||||||
from collections.abc import Callable
|
from collections.abc import Callable
|
||||||
from typing import Any
|
from typing import TYPE_CHECKING, Any
|
||||||
|
|
||||||
import gi
|
import gi
|
||||||
|
|
||||||
@@ -10,7 +10,9 @@ gi.require_version("Adw", "1")
|
|||||||
from gi.repository import Adw
|
from gi.repository import Adw
|
||||||
|
|
||||||
from clan_vm_manager.singletons.use_views import ViewStack
|
from clan_vm_manager.singletons.use_views import ViewStack
|
||||||
from clan_vm_manager.views.logs import Logs
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from clan_vm_manager.views.logs import Logs
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import logging
|
import logging
|
||||||
from collections.abc import Callable
|
from collections.abc import Callable
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Any, ClassVar
|
from typing import TYPE_CHECKING, Any, ClassVar
|
||||||
|
|
||||||
import gi
|
import gi
|
||||||
from clan_lib.flake import Flake
|
from clan_lib.flake import Flake
|
||||||
@@ -13,12 +13,14 @@ from clan_vm_manager.components.gkvstore import GKVStore
|
|||||||
from clan_vm_manager.components.vmobj import VMObject
|
from clan_vm_manager.components.vmobj import VMObject
|
||||||
from clan_vm_manager.history import HistoryEntry
|
from clan_vm_manager.history import HistoryEntry
|
||||||
from clan_vm_manager.singletons.use_views import ViewStack
|
from clan_vm_manager.singletons.use_views import ViewStack
|
||||||
from clan_vm_manager.views.logs import Logs
|
|
||||||
|
|
||||||
gi.require_version("GObject", "2.0")
|
gi.require_version("GObject", "2.0")
|
||||||
gi.require_version("Gtk", "4.0")
|
gi.require_version("Gtk", "4.0")
|
||||||
from gi.repository import Gio, GLib, GObject
|
from gi.repository import Gio, GLib, GObject
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from clan_vm_manager.views.logs import Logs
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import base64
|
|||||||
import logging
|
import logging
|
||||||
from collections.abc import Callable
|
from collections.abc import Callable
|
||||||
from functools import partial
|
from functools import partial
|
||||||
from typing import Any, TypeVar
|
from typing import TYPE_CHECKING, Any, TypeVar
|
||||||
|
|
||||||
import gi
|
import gi
|
||||||
from clan_lib.errors import ClanError
|
from clan_lib.errors import ClanError
|
||||||
@@ -21,11 +21,13 @@ from clan_vm_manager.singletons.toast import (
|
|||||||
from clan_vm_manager.singletons.use_join import JoinList, JoinValue
|
from clan_vm_manager.singletons.use_join import JoinList, JoinValue
|
||||||
from clan_vm_manager.singletons.use_views import ViewStack
|
from clan_vm_manager.singletons.use_views import ViewStack
|
||||||
from clan_vm_manager.singletons.use_vms import ClanStore, VMStore
|
from clan_vm_manager.singletons.use_vms import ClanStore, VMStore
|
||||||
from clan_vm_manager.views.logs import Logs
|
|
||||||
|
|
||||||
gi.require_version("Adw", "1")
|
gi.require_version("Adw", "1")
|
||||||
from gi.repository import Adw, Gdk, Gio, GLib, GObject, Gtk
|
from gi.repository import Adw, Gdk, Gio, GLib, GObject, Gtk
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from clan_vm_manager.views.logs import Logs
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
ListItem = TypeVar("ListItem", bound=GObject.Object)
|
ListItem = TypeVar("ListItem", bound=GObject.Object)
|
||||||
|
|||||||
Reference in New Issue
Block a user