From 119a05d999e662d28e7c5295ecf16cd04e634f6a Mon Sep 17 00:00:00 2001 From: Qubasa Date: Tue, 30 Jan 2024 12:17:24 +0700 Subject: [PATCH] Fixed clan uri. Expand user, then resolve --- pkgs/clan-cli/clan_cli/clan_uri.py | 5 ++--- pkgs/clan-cli/clan_cli/history/add.py | 3 +++ pkgs/clan-vm-manager/clan_vm_manager/views/list.py | 4 +++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/pkgs/clan-cli/clan_cli/clan_uri.py b/pkgs/clan-cli/clan_cli/clan_uri.py index a28c2979..501ee22d 100644 --- a/pkgs/clan-cli/clan_cli/clan_uri.py +++ b/pkgs/clan-cli/clan_cli/clan_uri.py @@ -98,10 +98,9 @@ class ClanURI: self._components.query, self._components.fragment, ) - match comb: - case ("file", "", path, "", "", "") | ("", "", path, "", "", ""): # type: ignore - self.scheme = ClanScheme.LOCAL.value(Path(path).resolve()) # type: ignore + case ("file", "", path, "", "", "") | ("", "", path, "", "", _): # type: ignore + self.scheme = ClanScheme.LOCAL.value(Path(path).expanduser().resolve()) # type: ignore case _: self.scheme = ClanScheme.REMOTE.value(self._components.geturl()) # type: ignore diff --git a/pkgs/clan-cli/clan_cli/history/add.py b/pkgs/clan-cli/clan_cli/history/add.py index fd6d3274..3871f962 100644 --- a/pkgs/clan-cli/clan_cli/history/add.py +++ b/pkgs/clan-cli/clan_cli/history/add.py @@ -3,6 +3,7 @@ import argparse import dataclasses import datetime import json +import logging from typing import Any from clan_cli.flakes.inspect import FlakeConfig, inspect_flake @@ -12,6 +13,8 @@ from ..dirs import user_history_file from ..errors import ClanError from ..locked_open import read_history_file, write_history_file +log = logging.getLogger(__name__) + class EnhancedJSONEncoder(json.JSONEncoder): def default(self, o: Any) -> Any: diff --git a/pkgs/clan-vm-manager/clan_vm_manager/views/list.py b/pkgs/clan-vm-manager/clan_vm_manager/views/list.py index d79796fe..bef832f5 100644 --- a/pkgs/clan-vm-manager/clan_vm_manager/views/list.py +++ b/pkgs/clan-vm-manager/clan_vm_manager/views/list.py @@ -191,4 +191,6 @@ class ClanList(Gtk.Box): switch.set_state(vm.is_running()) if not vm.is_running() and vm.process.proc.exitcode != 0: - self.show_error_dialog(vm.read_log()) + print("VM exited with error. Exitcode:", vm.process.proc.exitcode) + # print(vm.read_log()) + # self.show_error_dialog(vm.read_log())