From 8546cc9d1cabadabb36ac55467a2564fee9036d3 Mon Sep 17 00:00:00 2001 From: Micah Jerome Ellison Date: Mon, 26 Feb 2024 19:53:51 -0800 Subject: [PATCH 1/4] Remove extraneous vscode files --- .vscode/launch.json | 16 ---------------- .vscode/settings.json | 3 --- 2 files changed, 19 deletions(-) delete mode 100644 .vscode/launch.json delete mode 100644 .vscode/settings.json diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index aac569e49..000000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "Python: Module", - "type": "python", - "request": "launch", - "module": "jrnl", - "justMyCode": true, - "args": [] - } - ] -} diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index de288e1ea..000000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "python.formatting.provider": "black" -} \ No newline at end of file From 0c5270224ad519017139e1cf93cc02f9c541dbd4 Mon Sep 17 00:00:00 2001 From: Jonathan Wren Date: Mon, 26 Feb 2024 19:54:17 -0800 Subject: [PATCH 2/4] move NestedDict to utils file --- jrnl/datatypes/NestedDict.py | 7 ------- jrnl/datatypes/__init__.py | 1 - jrnl/plugins/util.py | 9 +++++++-- 3 files changed, 7 insertions(+), 10 deletions(-) delete mode 100644 jrnl/datatypes/NestedDict.py delete mode 100644 jrnl/datatypes/__init__.py diff --git a/jrnl/datatypes/NestedDict.py b/jrnl/datatypes/NestedDict.py deleted file mode 100644 index e989fa5f0..000000000 --- a/jrnl/datatypes/NestedDict.py +++ /dev/null @@ -1,7 +0,0 @@ -"""https://stackoverflow.com/a/74873621/8740440""" - - -class NestedDict(dict): - def __missing__(self, x): - self[x] = NestedDict() - return self[x] diff --git a/jrnl/datatypes/__init__.py b/jrnl/datatypes/__init__.py deleted file mode 100644 index e9859ff98..000000000 --- a/jrnl/datatypes/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from .NestedDict import NestedDict diff --git a/jrnl/plugins/util.py b/jrnl/plugins/util.py index 975c1ddd6..56d119061 100644 --- a/jrnl/plugins/util.py +++ b/jrnl/plugins/util.py @@ -4,12 +4,17 @@ from collections import Counter from typing import TYPE_CHECKING -from jrnl.datatypes import NestedDict - if TYPE_CHECKING: from jrnl.journals import Journal +"""https://stackoverflow.com/a/74873621/8740440""" +class NestedDict(dict): + def __missing__(self, x): + self[x] = NestedDict() + return self[x] + + def get_tags_count(journal: "Journal") -> set[tuple[int, str]]: """Returns a set of tuples (count, tag) for all tags present in the journal.""" # Astute reader: should the following line leave you as puzzled as me the first time From 86886394c033f14ef4e0a1e63987e09bef831699 Mon Sep 17 00:00:00 2001 From: Jonathan Wren Date: Mon, 26 Feb 2024 20:07:32 -0800 Subject: [PATCH 3/4] run formatter --- jrnl/plugins/util.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jrnl/plugins/util.py b/jrnl/plugins/util.py index 56d119061..6b569016f 100644 --- a/jrnl/plugins/util.py +++ b/jrnl/plugins/util.py @@ -8,8 +8,9 @@ from jrnl.journals import Journal -"""https://stackoverflow.com/a/74873621/8740440""" class NestedDict(dict): + """https://stackoverflow.com/a/74873621/8740440""" + def __missing__(self, x): self[x] = NestedDict() return self[x] From 4e90caefd01e322e79325a51d180054b02ba866c Mon Sep 17 00:00:00 2001 From: Jonathan Wren Date: Mon, 26 Feb 2024 20:15:25 -0800 Subject: [PATCH 4/4] fix import error --- jrnl/plugins/calendar_heatmap_exporter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jrnl/plugins/calendar_heatmap_exporter.py b/jrnl/plugins/calendar_heatmap_exporter.py index 46bf0ec58..78cbaf9ab 100644 --- a/jrnl/plugins/calendar_heatmap_exporter.py +++ b/jrnl/plugins/calendar_heatmap_exporter.py @@ -16,7 +16,7 @@ from jrnl.plugins.util import get_journal_frequency_nested if TYPE_CHECKING: - from jrnl.datatypes import NestedDict + from jrnl.plugins.util import NestedDict from jrnl.journals import Entry from jrnl.journals import Journal