mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-10 08:38:32 +02:00
Merge pull request #1 from wren/cal-heatmap-1759
This commit is contained in:
commit
a82497771e
6 changed files with 9 additions and 30 deletions
16
.vscode/launch.json
vendored
16
.vscode/launch.json
vendored
|
@ -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": []
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
|
@ -1,3 +0,0 @@
|
||||||
{
|
|
||||||
"python.formatting.provider": "black"
|
|
||||||
}
|
|
|
@ -1,7 +0,0 @@
|
||||||
"""https://stackoverflow.com/a/74873621/8740440"""
|
|
||||||
|
|
||||||
|
|
||||||
class NestedDict(dict):
|
|
||||||
def __missing__(self, x):
|
|
||||||
self[x] = NestedDict()
|
|
||||||
return self[x]
|
|
|
@ -1 +0,0 @@
|
||||||
from .NestedDict import NestedDict
|
|
|
@ -16,7 +16,7 @@ from jrnl.plugins.text_exporter import TextExporter
|
||||||
from jrnl.plugins.util import get_journal_frequency_nested
|
from jrnl.plugins.util import get_journal_frequency_nested
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from jrnl.datatypes import NestedDict
|
from jrnl.plugins.util import NestedDict
|
||||||
from jrnl.journals import Entry
|
from jrnl.journals import Entry
|
||||||
from jrnl.journals import Journal
|
from jrnl.journals import Journal
|
||||||
|
|
||||||
|
|
|
@ -4,12 +4,18 @@
|
||||||
from collections import Counter
|
from collections import Counter
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from jrnl.datatypes import NestedDict
|
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from jrnl.journals import Journal
|
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]]:
|
def get_tags_count(journal: "Journal") -> set[tuple[int, str]]:
|
||||||
"""Returns a set of tuples (count, tag) for all tags present in the journal."""
|
"""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
|
# Astute reader: should the following line leave you as puzzled as me the first time
|
||||||
|
|
Loading…
Add table
Reference in a new issue