Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Changelog

## Version 0.6
## Version 0.6.1
- Fix encoding to use utf-8 in all file operations

## Version 0.6.0
- Added proper console clear, to prevent multiple board versions being in view

## Version 0.5.2
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "kanban-python"
version = "0.6.0"
version = "0.6.1"
description = "Terminal Kanban App written in Python"
readme = "README.md"
authors = [
Expand Down Expand Up @@ -41,8 +41,8 @@ build-backend = "hatchling.build"
addopts = "--cov src/kanban_python --cov-report term-missing --verbose --color=yes"
testpaths = ["tests"]

[tool.uv]
dev-dependencies = [
[dependency-groups]
dev = [
"freezegun>=1.5.1",
"pre-commit>=4.0.1",
"pytest>=8.3.3",
Expand Down
4 changes: 2 additions & 2 deletions src/kanban_python/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def __repr__(self) -> str:
return output

def save(self):
with open(self.configpath, "w") as configfile:
with open(self.configpath, "w", encoding="utf-8") as configfile:
self.config.write(configfile)

@property
Expand Down Expand Up @@ -153,7 +153,7 @@ def create_init_config(conf_path=CONFIG_PATH, data_path=DATA_PATH):
data_path.mkdir(exist_ok=True)
(data_path / KANBAN_BOARDS_FOLDER_NAME).mkdir(exist_ok=True)

with open(conf_path / CONFIG_FILE_NAME, "w") as configfile:
with open(conf_path / CONFIG_FILE_NAME, "w", encoding="utf-8") as configfile:
config.write(configfile)
console.print(
f"Welcome, I Created a new [orange3]{CONFIG_FILE_NAME}[/] file "
Expand Down
4 changes: 2 additions & 2 deletions src/kanban_python/controls.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def add_tasks_to_db(tasks: dict | list[dict]) -> None:
save_db(data=db_data)


def read_db(path: str = None) -> dict:
def read_db(path: str | None = None) -> dict:
if not path:
path = cfg.active_board_path

Expand All @@ -147,7 +147,7 @@ def read_db(path: str = None) -> dict:


def read_single_board(path):
with open(path, "r") as file:
with open(path, "r", encoding="utf-8") as file:
data = load(file)
return data

Expand Down
4 changes: 2 additions & 2 deletions src/kanban_python/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def scan_for_todos(

for file_path in file_paths:
prog.update(task_id=task, advance=1)
with open(file_path, "r") as file:
with open(file_path, "r", encoding="utf-8") as file:
try:
todos += [
(line.strip(), str(Path(file_path).relative_to(rel_path)))
Expand Down Expand Up @@ -222,7 +222,7 @@ def create_report_document(path: Path, boards_dict: dict):
).date()
date_dict[completion_date].append(f"- {task['Tag']} {task['Title']}\n")

with open(path / REPORT_FILE_NAME, "w") as report_file:
with open(path / REPORT_FILE_NAME, "w", encoding="utf-8") as report_file:
last_year = ""
last_month = ""
last_day = ""
Expand Down
2 changes: 1 addition & 1 deletion tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def test_scan_todos(test_config, tmp_path):
cfg = test_config
file_path = tmp_path / "file.py"
file_path.touch()
with open(file_path, "w") as file:
with open(file_path, "w", encoding="utf-8") as file:
file.write("# TODO: Pytest is cool")

list_input = [file_path]
Expand Down
816 changes: 594 additions & 222 deletions uv.lock

Large diffs are not rendered by default.

Loading