Skip to content

Commit

Permalink
Merge pull request #1 from wren/cal-heatmap-1759
Browse files Browse the repository at this point in the history
  • Loading branch information
alichtman authored Jun 27, 2024
2 parents 81f0f6f + 4e90cae commit a824977
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 30 deletions.
16 changes: 0 additions & 16 deletions .vscode/launch.json

This file was deleted.

3 changes: 0 additions & 3 deletions .vscode/settings.json

This file was deleted.

7 changes: 0 additions & 7 deletions jrnl/datatypes/NestedDict.py

This file was deleted.

1 change: 0 additions & 1 deletion jrnl/datatypes/__init__.py

This file was deleted.

2 changes: 1 addition & 1 deletion jrnl/plugins/calendar_heatmap_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
10 changes: 8 additions & 2 deletions jrnl/plugins/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,18 @@
from collections import Counter
from typing import TYPE_CHECKING

from jrnl.datatypes import NestedDict

if TYPE_CHECKING:
from jrnl.journals import Journal


class NestedDict(dict):
"""https://stackoverflow.com/a/74873621/8740440"""

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
Expand Down

0 comments on commit a824977

Please sign in to comment.