modernisation for python 3.11

This commit is contained in:
Jörg Thalheim
2023-11-29 12:40:48 +01:00
committed by Mic92
parent 26e3e3872c
commit f1b223d0a1
38 changed files with 160 additions and 163 deletions

View File

@@ -1,14 +1,13 @@
# !/usr/bin/env python3
import argparse
from pathlib import Path
from typing import Dict
from clan_cli.dirs import user_history_file
from ..async_cmd import CmdOut, runforcli
async def add_flake(path: Path) -> Dict[str, CmdOut]:
async def add_flake(path: Path) -> dict[str, CmdOut]:
user_history_file().parent.mkdir(parents=True, exist_ok=True)
# append line to history file
# TODO: Make this atomic

View File

@@ -1,7 +1,6 @@
# !/usr/bin/env python3
import argparse
from pathlib import Path
from typing import Dict
from ..async_cmd import CmdOut, run, runforcli
from ..errors import ClanError
@@ -10,7 +9,7 @@ from ..nix import nix_command, nix_shell
DEFAULT_URL: str = "git+https://git.clan.lol/clan/clan-core?new-clan"
async def create_flake(directory: Path, url: str) -> Dict[str, CmdOut]:
async def create_flake(directory: Path, url: str) -> dict[str, CmdOut]:
if not directory.exists():
directory.mkdir()
else: