From b6736936a741278773baf397eaac5e3b594118ac Mon Sep 17 00:00:00 2001 From: Tyler Date: Fri, 16 Aug 2024 14:24:08 -0700 Subject: [PATCH] downgrade for python3.8 --- pyproject.toml | 2 +- src/z/create.py | 4 ++-- src/z/template.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index f90493f..23e5345 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ authors = [ ] description = "Personal note taking framework." readme = "README.md" -requires-python = ">=3.10" +requires-python = ">=3.8" classifiers = [ "Programming Language :: Python :: 3", "License :: OSI Approved :: GNU General Public License (GPL)", diff --git a/src/z/create.py b/src/z/create.py index 1e5beec..dff0c51 100644 --- a/src/z/create.py +++ b/src/z/create.py @@ -1,12 +1,12 @@ from argparse import ArgumentTypeError from z.template import apply_template from pathlib import Path -from typing import List +from typing import List, Union import datetime import re # Format: --__<tag1>_<tag2>.<ext> -def normalize_name(name: str, tags: str, time: datetime.date | None = None, ext: str ="md"): +def normalize_name(name: str, tags: str, time: Union[datetime.date, None] = None, ext: str ="md"): if "-" in name or "_" in name: raise ArgumentTypeError("Title cannot have '-' or '_'") if "-" in name or "_" in tags: diff --git a/src/z/template.py b/src/z/template.py index b529805..9129714 100644 --- a/src/z/template.py +++ b/src/z/template.py @@ -1,6 +1,6 @@ from z import template_funcs from pathlib import Path -from typing import List +from typing import List, Tuple import re def read_file(p: Path, n: str): @@ -9,7 +9,7 @@ def read_file(p: Path, n: str): return f.read() return -1 -def split_template(s: str) -> (List[str], str): +def split_template(s: str) -> Tuple[List[str], str]: return re.findall(r"{([^}]+)}", s), re.sub(r"{([^}]+)}", "{}", s) def apply_template(path: Path, name: str):