diff --git a/pyproject.toml b/pyproject.toml index 39c537f..f001bf9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ name = "streamer" version = "0.1.0" description = "Searching for tags in streams" readme = "README.md" -requires-python = ">=3.12.11" +requires-python = ">=3.12" dependencies = [ "click>=8.2.1", "mistletoe>=1.4.0", diff --git a/src/streamer/__init__.py b/src/streamer/__init__.py index 0d2a52e..c39eede 100644 --- a/src/streamer/__init__.py +++ b/src/streamer/__init__.py @@ -50,7 +50,7 @@ def new() -> None: content = "# " with open(prelimary_path, "w") as file: - file.write(content) + _ = file.write(content) click.edit(None, filename=prelimary_path) @@ -59,11 +59,11 @@ def new() -> None: parsed_content = parse_markdown_file(prelimary_path, content) final_file_name = f"{timestamp}.md" - if len(markers := parsed_content.shard.markers): + if parsed_content.shard is not None and len(markers := parsed_content.shard.markers): final_file_name = f"{timestamp} {' '.join(markers)}.md" final_path = os.path.join(streamer_directory, final_file_name) - move(prelimary_path, final_path) + _ = move(prelimary_path, final_path) print(f"Saved as [yellow]{final_file_name}") diff --git a/src/streamer/localize/__init__.py b/src/streamer/localize/__init__.py index 3b3380e..31f4f71 100644 --- a/src/streamer/localize/__init__.py +++ b/src/streamer/localize/__init__.py @@ -3,8 +3,6 @@ from .repostory_configuration import RepositoryConfiguration from .localized_shard import LocalizedShard __all__ = [ - "Dimension", - "Marker", "RepositoryConfiguration", "localize_stream_file", "LocalizedShard", diff --git a/src/streamer/localize/extract_datetime.py b/src/streamer/localize/extract_datetime.py index 28012d7..ed82955 100644 --- a/src/streamer/localize/extract_datetime.py +++ b/src/streamer/localize/extract_datetime.py @@ -1,10 +1,9 @@ from datetime import datetime import re import os -from typing import Optional -def extract_date_from_file_name(file_name: str) -> Optional[datetime]: +def extract_date_from_file_name(file_name: str) -> datetime | None: FILE_NAME_REGEX = r"^(?P\d{8})(?:-(?P