Merge branch 'jrnl-org:develop' into develop

This commit is contained in:
Briscoooe 2023-01-09 10:03:22 +00:00 committed by GitHub
commit 8ef8fd7dff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
115 changed files with 1489 additions and 1379 deletions

View file

@ -1,4 +1,4 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
name: Changelog name: Changelog

View file

@ -1,4 +1,4 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
name: Docs name: Docs

View file

@ -1,4 +1,4 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
name: Release name: Release

View file

@ -1,4 +1,4 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
name: Testing Pipeline Files name: Testing Pipeline Files

View file

@ -1,4 +1,4 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
name: Testing name: Testing

View file

@ -1,4 +1,4 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
name: Testing name: Testing

View file

@ -10,20 +10,33 @@
- Add `rich` handler to debug logging [\#1627](https://github.com/jrnl-org/jrnl/pull/1627) ([wren](https://github.com/wren)) - Add `rich` handler to debug logging [\#1627](https://github.com/jrnl-org/jrnl/pull/1627) ([wren](https://github.com/wren))
- Rework Encryption to enable future support of other encryption methods [\#1602](https://github.com/jrnl-org/jrnl/pull/1602) ([wren](https://github.com/wren)) - Rework Encryption to enable future support of other encryption methods [\#1602](https://github.com/jrnl-org/jrnl/pull/1602) ([wren](https://github.com/wren))
**Fixed bugs:**
- jrnl does not update version key in config file [\#1638](https://github.com/jrnl-org/jrnl/issues/1638)
- Add tag to XML file when edited DayOne entry and is searchable afterward [\#1648](https://github.com/jrnl-org/jrnl/pull/1648) ([jonakeys](https://github.com/jonakeys))
- Update version key in config file after version changes [\#1646](https://github.com/jrnl-org/jrnl/pull/1646) ([jonakeys](https://github.com/jonakeys))
**Deprecated:** **Deprecated:**
- Drop Python 3.9 and use Python 3.11 official release [\#1611](https://github.com/jrnl-org/jrnl/pull/1611) ([micahellison](https://github.com/micahellison)) - Drop Python 3.9 and use Python 3.11 official release [\#1611](https://github.com/jrnl-org/jrnl/pull/1611) ([micahellison](https://github.com/micahellison))
**Build:** **Build:**
- Update copyright notices for 2023 [\#1660](https://github.com/jrnl-org/jrnl/pull/1660) ([wren](https://github.com/wren))
- Fix bug where changelog is always slightly out of date on release tags [\#1631](https://github.com/jrnl-org/jrnl/pull/1631) ([wren](https://github.com/wren)) - Fix bug where changelog is always slightly out of date on release tags [\#1631](https://github.com/jrnl-org/jrnl/pull/1631) ([wren](https://github.com/wren))
- Add `simplify` plugin to linting checks [\#1630](https://github.com/jrnl-org/jrnl/pull/1630) ([wren](https://github.com/wren)) - Add `simplify` plugin to linting checks [\#1630](https://github.com/jrnl-org/jrnl/pull/1630) ([wren](https://github.com/wren))
- Add type hints [\#1614](https://github.com/jrnl-org/jrnl/pull/1614) ([outa](https://github.com/outa)) - Add type hints [\#1614](https://github.com/jrnl-org/jrnl/pull/1614) ([outa](https://github.com/outa))
**Documentation:** **Documentation:**
- Documentation Change [\#1651](https://github.com/jrnl-org/jrnl/issues/1651)
- Fix markup in "Advanced Usage" doc [\#1655](https://github.com/jrnl-org/jrnl/pull/1655) ([multani](https://github.com/multani))
- Remove Windows 7 known issue since Windows 7 is no longer supported [\#1636](https://github.com/jrnl-org/jrnl/pull/1636) ([micahellison](https://github.com/micahellison)) - Remove Windows 7 known issue since Windows 7 is no longer supported [\#1636](https://github.com/jrnl-org/jrnl/pull/1636) ([micahellison](https://github.com/micahellison))
**Packaging:**
- Update dependency rich to v13 [\#1654](https://github.com/jrnl-org/jrnl/pull/1654) ([renovate[bot]](https://github.com/apps/renovate))
## [v3.3](https://pypi.org/project/jrnl/v3.3/) (2022-10-29) ## [v3.3](https://pypi.org/project/jrnl/v3.3/) (2022-10-29)
[Full Changelog](https://github.com/jrnl-org/jrnl/compare/v3.3-beta2...v3.3) [Full Changelog](https://github.com/jrnl-org/jrnl/compare/v3.3-beta2...v3.3)

View file

@ -1,5 +1,5 @@
<!-- <!--
Copyright © 2012-2022 jrnl contributors Copyright © 2012-2023 jrnl contributors
License: https://www.gnu.org/licenses/gpl-3.0.html License: https://www.gnu.org/licenses/gpl-3.0.html
--> -->

View file

@ -1,5 +1,5 @@
<!-- <!--
Copyright © 2012-2022 jrnl contributors Copyright © 2012-2023 jrnl contributors
License: https://www.gnu.org/licenses/gpl-3.0.html License: https://www.gnu.org/licenses/gpl-3.0.html
--> -->

View file

@ -1,5 +1,5 @@
<!-- <!--
Copyright © 2012-2022 jrnl contributors Copyright © 2012-2023 jrnl contributors
License: https://www.gnu.org/licenses/gpl-3.0.html License: https://www.gnu.org/licenses/gpl-3.0.html
--> -->
@ -20,8 +20,8 @@ for example:
``` yaml ``` yaml
journals: journals:
default: ~\journal.txt default: ~/journal.txt
work: ~\work.txt work: ~/work.txt
``` ```
The `default` journal gets created the first time you start `jrnl` The `default` journal gets created the first time you start `jrnl`
@ -80,6 +80,7 @@ The `work` journal is encrypted, prints to `json` by default, and is edited usin
You can override a configuration field for the current instance of `jrnl` using `--config-override CONFIG_KEY CONFIG_VALUE` where `CONFIG_KEY` is a valid configuration field, specified in dot notation and `CONFIG_VALUE` is the (valid) desired override value. The dot notation can be used to change config keys within other keys, such as `colors.title` for the `title` key within the `colors` key. You can override a configuration field for the current instance of `jrnl` using `--config-override CONFIG_KEY CONFIG_VALUE` where `CONFIG_KEY` is a valid configuration field, specified in dot notation and `CONFIG_VALUE` is the (valid) desired override value. The dot notation can be used to change config keys within other keys, such as `colors.title` for the `title` key within the `colors` key.
You can specify multiple overrides as multiple calls to `--config-override`. You can specify multiple overrides as multiple calls to `--config-override`.
!!! note !!! note
These overrides allow you to modify ***any*** field of your jrnl configuration. We trust that you know what you are doing. These overrides allow you to modify ***any*** field of your jrnl configuration. We trust that you know what you are doing.
@ -95,7 +96,6 @@ jrnl --config-override journals.todo "$(git rev-parse --show-toplevel)/todo.txt"
# Pass multiple overrides # Pass multiple overrides
jrnl --config-override display_format fancy --config-override linewrap 20 \ jrnl --config-override display_format fancy --config-override linewrap 20 \
--config-override colors.title green --config-override colors.title green
``` ```
### Using an alternate config ### Using an alternate config
@ -105,7 +105,7 @@ You can specify an alternate configuration file for the current instance of `jrn
#### Examples: #### Examples:
``` ``` sh
# Use personalised configuration file for personal journal entries # Use personalised configuration file for personal journal entries
jrnl --config-file ~/foo/jrnl/personal-config.yaml jrnl --config-file ~/foo/jrnl/personal-config.yaml

View file

@ -1,5 +1,5 @@
<!-- <!--
Copyright © 2012-2022 jrnl contributors Copyright © 2012-2023 jrnl contributors
License: https://www.gnu.org/licenses/gpl-3.0.html License: https://www.gnu.org/licenses/gpl-3.0.html
--> -->

View file

@ -1,5 +1,5 @@
<!-- <!--
Copyright © 2012-2022 jrnl contributors Copyright © 2012-2023 jrnl contributors
License: https://www.gnu.org/licenses/gpl-3.0.html License: https://www.gnu.org/licenses/gpl-3.0.html
--> -->

View file

@ -1,15 +1,36 @@
<!-- <!--
Copyright © 2012-2022 jrnl contributors Copyright © 2012-2023 jrnl contributors
License: https://www.gnu.org/licenses/gpl-3.0.html License: https://www.gnu.org/licenses/gpl-3.0.html
--> -->
# External editors # External editors
Configure your preferred external editor by updating the `editor` option Configure your preferred external editor by updating the `editor` option
in your [configuration file](./reference-config-file.md#editor) in your [configuration file](./reference-config-file.md#editor). If your editor is not
in your operating system's `PATH` environment variable, then you will have to
enter the full path of your editor.
If your editor is not in your operating system's `PATH` environment variable, Once it's configured, you can create an entry as a new document in your editor using the `jrnl`
then you will have to enter in the full path of your editor. command by itself:
``` text
jrnl
```
You can specify the time and title of the entry as usual on the first line of the document.
If you want, you can skip the editor by including a quick entry with the `jrnl` command:
``` text
jrnl yesterday: All my troubles seemed so far away.
```
If you want to start the entry on the command line and continue writing in your chosen editor,
use the `--edit` flag. For example:
``` text
jrnl yesterday: All my troubles seemed so far away. --edit
```
!!! note !!! note
To save and log any entry edits, save and close the file. To save and log any entry edits, save and close the file.

View file

@ -1,5 +1,5 @@
<!-- <!--
Copyright © 2012-2022 jrnl contributors Copyright © 2012-2023 jrnl contributors
License: https://www.gnu.org/licenses/gpl-3.0.html License: https://www.gnu.org/licenses/gpl-3.0.html
--> -->

View file

@ -1,5 +1,5 @@
<!-- <!--
Copyright © 2012-2022 jrnl contributors Copyright © 2012-2023 jrnl contributors
License: https://www.gnu.org/licenses/gpl-3.0.html License: https://www.gnu.org/licenses/gpl-3.0.html
--> -->

View file

@ -1,5 +1,5 @@
<!-- <!--
Copyright © 2012-2022 jrnl contributors Copyright © 2012-2023 jrnl contributors
License: https://www.gnu.org/licenses/gpl-3.0.html License: https://www.gnu.org/licenses/gpl-3.0.html
--> -->

View file

@ -1,5 +1,5 @@
<!-- <!--
Copyright © 2012-2022 jrnl contributors Copyright © 2012-2023 jrnl contributors
License: https://www.gnu.org/licenses/gpl-3.0.html License: https://www.gnu.org/licenses/gpl-3.0.html
--> -->

View file

@ -1,5 +1,5 @@
<!-- <!--
Copyright © 2012-2022 jrnl contributors Copyright © 2012-2023 jrnl contributors
License: https://www.gnu.org/licenses/gpl-3.0.html License: https://www.gnu.org/licenses/gpl-3.0.html
--> -->

View file

@ -1,5 +1,5 @@
<!-- <!--
Copyright © 2012-2022 jrnl contributors Copyright © 2012-2023 jrnl contributors
License: https://www.gnu.org/licenses/gpl-3.0.html License: https://www.gnu.org/licenses/gpl-3.0.html
--> -->

View file

@ -1,5 +1,5 @@
<!-- <!--
Copyright © 2012-2022 jrnl contributors Copyright © 2012-2023 jrnl contributors
License: https://www.gnu.org/licenses/gpl-3.0.html License: https://www.gnu.org/licenses/gpl-3.0.html
--> -->

View file

@ -1,5 +1,5 @@
<!-- <!--
Copyright © 2012-2022 jrnl contributors Copyright © 2012-2023 jrnl contributors
License: https://www.gnu.org/licenses/gpl-3.0.html License: https://www.gnu.org/licenses/gpl-3.0.html
--> -->

View file

@ -1,5 +1,5 @@
<!-- <!--
Copyright © 2012-2022 jrnl contributors Copyright © 2012-2023 jrnl contributors
License: https://www.gnu.org/licenses/gpl-3.0.html License: https://www.gnu.org/licenses/gpl-3.0.html
--> -->

View file

@ -1,5 +1,5 @@
/* /*
Copyright © 2012-2022 jrnl contributors Copyright © 2012-2023 jrnl contributors
License: https://www.gnu.org/licenses/gpl-3.0.html License: https://www.gnu.org/licenses/gpl-3.0.html
*/ */

View file

@ -1,5 +1,5 @@
/* /*
Copyright © 2012-2022 jrnl contributors Copyright © 2012-2023 jrnl contributors
License: https://www.gnu.org/licenses/gpl-3.0.html License: https://www.gnu.org/licenses/gpl-3.0.html
Atom One Dark With support for ReasonML by Gidi Morris, based off work by Atom One Dark With support for ReasonML by Gidi Morris, based off work by

View file

@ -1,5 +1,5 @@
/* /*
Copyright © 2012-2022 jrnl contributors Copyright © 2012-2023 jrnl contributors
License: https://www.gnu.org/licenses/gpl-3.0.html License: https://www.gnu.org/licenses/gpl-3.0.html
*/ */

View file

@ -1,5 +1,5 @@
/* /*
Copyright © 2012-2022 jrnl contributors Copyright © 2012-2023 jrnl contributors
License: https://www.gnu.org/licenses/gpl-3.0.html License: https://www.gnu.org/licenses/gpl-3.0.html
*/ */

View file

@ -1,5 +1,5 @@
<!-- <!--
Copyright © 2012-2022 jrnl contributors Copyright © 2012-2023 jrnl contributors
License: https://www.gnu.org/licenses/gpl-3.0.html License: https://www.gnu.org/licenses/gpl-3.0.html
--> -->

View file

@ -1,5 +1,5 @@
<!-- <!--
Copyright © 2012-2022 jrnl contributors Copyright © 2012-2023 jrnl contributors
License: https://www.gnu.org/licenses/gpl-3.0.html License: https://www.gnu.org/licenses/gpl-3.0.html
--> -->

View file

@ -1,5 +1,5 @@
<!-- <!--
Copyright © 2012-2022 jrnl contributors Copyright © 2012-2023 jrnl contributors
License: https://www.gnu.org/licenses/gpl-3.0.html License: https://www.gnu.org/licenses/gpl-3.0.html
--> -->

View file

@ -1,4 +1,4 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
import contextlib import contextlib
@ -74,6 +74,7 @@ class DayOne(Journal.Journal):
self.config["tagsymbols"][0] + tag.lower() self.config["tagsymbols"][0] + tag.lower()
for tag in dict_entry.get("Tags", []) for tag in dict_entry.get("Tags", [])
] ]
if entry._tags: entry._tags.sort()
"""Extended DayOne attributes""" """Extended DayOne attributes"""
# just ignore it if the keys don't exist # just ignore it if the keys don't exist
@ -167,7 +168,7 @@ class DayOne(Journal.Journal):
return "\n".join([f"{str(e)}\n# {e.uuid}\n" for e in self.entries]) return "\n".join([f"{str(e)}\n# {e.uuid}\n" for e in self.entries])
def _update_old_entry(self, entry: Entry, new_entry: Entry) -> None: def _update_old_entry(self, entry: Entry, new_entry: Entry) -> None:
for attr in ("title", "body", "date"): for attr in ("title", "body", "date", "tags"):
old_attr = getattr(entry, attr) old_attr = getattr(entry, attr)
new_attr = getattr(new_entry, attr) new_attr = getattr(new_entry, attr)
if old_attr != new_attr: if old_attr != new_attr:
@ -195,6 +196,7 @@ class DayOne(Journal.Journal):
for entry in entries_from_editor: for entry in entries_from_editor:
entry = self._get_and_remove_uuid_from_entry(entry) entry = self._get_and_remove_uuid_from_entry(entry)
if entry._tags: entry._tags.sort()
# Remove deleted entries # Remove deleted entries
edited_uuids = [e.uuid for e in entries_from_editor] edited_uuids = [e.uuid for e in entries_from_editor]
@ -204,5 +206,9 @@ class DayOne(Journal.Journal):
for entry in entries_from_editor: for entry in entries_from_editor:
for old_entry in self.entries: for old_entry in self.entries:
if entry.uuid == old_entry.uuid: if entry.uuid == old_entry.uuid:
if old_entry._tags:
tags_not_in_body = [tag for tag in old_entry._tags if(tag not in entry._body)]
if tags_not_in_body:
entry._tags.extend(tags_not_in_body.sort())
self._update_old_entry(old_entry, entry) self._update_old_entry(old_entry, entry)
break break

View file

@ -1,4 +1,4 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
import datetime import datetime

View file

@ -1,4 +1,4 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
import codecs import codecs

View file

@ -1,4 +1,4 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
import datetime import datetime

View file

@ -1,4 +1,4 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
try: try:

View file

@ -1,4 +1,4 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
import sys import sys

View file

@ -1,4 +1,4 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
import argparse import argparse

View file

@ -1,4 +1,4 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
import logging import logging

View file

@ -1,4 +1,4 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
import re import re

View file

@ -1,4 +1,4 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
""" """
@ -14,6 +14,7 @@ run.
Also, please note that all (non-builtin) imports should be scoped to each function to Also, please note that all (non-builtin) imports should be scoped to each function to
avoid any possible overhead for these standalone commands. avoid any possible overhead for these standalone commands.
""" """
import argparse import argparse
import logging import logging
import platform import platform
@ -47,7 +48,7 @@ def preconfig_version(_):
output = f""" output = f"""
{__title__} {__version__} {__title__} {__version__}
Copyright © 2012-2022 jrnl contributors Copyright © 2012-2023 jrnl contributors
This is free software, and you are welcome to redistribute it under certain This is free software, and you are welcome to redistribute it under certain
conditions; for details, see: https://www.gnu.org/licenses/gpl-3.0.html conditions; for details, see: https://www.gnu.org/licenses/gpl-3.0.html

View file

@ -1,4 +1,4 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
import argparse import argparse

View file

@ -1,4 +1,4 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
import logging import logging

View file

@ -1,5 +1,6 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
import logging import logging
from abc import ABC from abc import ABC
from abc import abstractmethod from abc import abstractmethod

View file

@ -1,5 +1,6 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
from .BaseEncryption import BaseEncryption from .BaseEncryption import BaseEncryption

View file

@ -1,5 +1,6 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
import logging import logging
from jrnl.encryption.BaseEncryption import BaseEncryption from jrnl.encryption.BaseEncryption import BaseEncryption

View file

@ -1,5 +1,6 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
import hashlib import hashlib
import logging import logging

View file

@ -1,5 +1,6 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
import base64 import base64
import logging import logging

View file

@ -1,5 +1,6 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
import logging import logging
from jrnl.encryption.BaseEncryption import BaseEncryption from jrnl.encryption.BaseEncryption import BaseEncryption

View file

@ -1,5 +1,6 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
from enum import Enum from enum import Enum
from importlib import import_module from importlib import import_module
from typing import TYPE_CHECKING from typing import TYPE_CHECKING

View file

@ -1,4 +1,4 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
from typing import TYPE_CHECKING from typing import TYPE_CHECKING

View file

@ -1,4 +1,4 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
import contextlib import contextlib
@ -9,6 +9,7 @@ import sys
from rich.pretty import pretty_repr from rich.pretty import pretty_repr
from jrnl import __version__
from jrnl.config import DEFAULT_JOURNAL_KEY from jrnl.config import DEFAULT_JOURNAL_KEY
from jrnl.config import get_config_path from jrnl.config import get_config_path
from jrnl.config import get_default_config from jrnl.config import get_default_config
@ -32,12 +33,20 @@ def upgrade_config(config_data: dict, alt_config_path: str | None = None) -> Non
"""Checks if there are keys missing in a given config dict, and if so, updates the config file accordingly. """Checks if there are keys missing in a given config dict, and if so, updates the config file accordingly.
This essentially automatically ports jrnl installations if new config parameters are introduced in later This essentially automatically ports jrnl installations if new config parameters are introduced in later
versions. versions.
Also checks for existence of and difference in version number between config dict and current jrnl version,
and if so, update the config file accordingly.
Supply alt_config_path if using an alternate config through --config-file.""" Supply alt_config_path if using an alternate config through --config-file."""
default_config = get_default_config() default_config = get_default_config()
missing_keys = set(default_config).difference(config_data) missing_keys = set(default_config).difference(config_data)
if missing_keys: if missing_keys:
for key in missing_keys: for key in missing_keys:
config_data[key] = default_config[key] config_data[key] = default_config[key]
different_version = (config_data["version"] != __version__)
if different_version:
config_data["version"] = __version__
if missing_keys or different_version:
save_config(config_data, alt_config_path) save_config(config_data, alt_config_path)
config_path = alt_config_path if alt_config_path else get_config_path() config_path = alt_config_path if alt_config_path else get_config_path()
print_msg( print_msg(

View file

@ -1,5 +1,6 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
import logging import logging
import sys import sys
from typing import TYPE_CHECKING from typing import TYPE_CHECKING

View file

@ -1,5 +1,6 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
import keyring import keyring
from jrnl.messages import Message from jrnl.messages import Message

View file

@ -1,4 +1,4 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
from typing import TYPE_CHECKING from typing import TYPE_CHECKING

View file

@ -1,4 +1,4 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
from enum import Enum from enum import Enum

View file

@ -1,4 +1,4 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
from enum import Enum from enum import Enum

View file

@ -1,4 +1,4 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
from jrnl.messages import Message from jrnl.messages import Message

View file

@ -1,4 +1,4 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
import shlex import shlex

View file

@ -1,4 +1,4 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
import textwrap import textwrap

View file

@ -1,5 +1,6 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
from typing import TYPE_CHECKING from typing import TYPE_CHECKING
from jrnl.config import make_yaml_valid_dict from jrnl.config import make_yaml_valid_dict

View file

@ -1,4 +1,4 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
import os.path import os.path

View file

@ -1,4 +1,4 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
from typing import Type from typing import Type

View file

@ -1,4 +1,4 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
from collections import Counter from collections import Counter

View file

@ -1,4 +1,4 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
import logging import logging

View file

@ -1,4 +1,4 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
import sys import sys

View file

@ -1,4 +1,4 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
import json import json

View file

@ -1,4 +1,4 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
import os import os

View file

@ -1,4 +1,4 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
from typing import TYPE_CHECKING from typing import TYPE_CHECKING

View file

@ -1,4 +1,4 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
import errno import errno

View file

@ -1,4 +1,4 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
from typing import TYPE_CHECKING from typing import TYPE_CHECKING

View file

@ -1,4 +1,4 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
from typing import TYPE_CHECKING from typing import TYPE_CHECKING

View file

@ -1,4 +1,4 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
import os import os

View file

@ -1,4 +1,4 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
from jrnl.messages import Message from jrnl.messages import Message

View file

@ -1,4 +1,4 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
import datetime import datetime

View file

@ -1,4 +1,4 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
import logging import logging

2498
poetry.lock generated

File diff suppressed because it is too large Load diff

View file

@ -37,7 +37,7 @@ parsedatetime = ">=2.6"
python-dateutil = "^2.8" # https://github.com/dateutil/dateutil/blob/master/RELEASING python-dateutil = "^2.8" # https://github.com/dateutil/dateutil/blob/master/RELEASING
pyxdg = ">=0.27.0" pyxdg = ">=0.27.0"
"ruamel.yaml" = "^0.17.21" "ruamel.yaml" = "^0.17.21"
rich = "^12.2.0" rich = ">=12.2.0, <14.0.0"
# dayone-only deps # dayone-only deps
tzlocal = ">=4.0" # https://github.com/regebro/tzlocal/blob/master/CHANGES.txt tzlocal = ">=4.0" # https://github.com/regebro/tzlocal/blob/master/CHANGES.txt

View file

@ -1,4 +1,4 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
import json import json

View file

@ -1,4 +1,4 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
Feature: Build process Feature: Build process

View file

@ -1,4 +1,4 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
Feature: Change entry times in journal Feature: Change entry times in journal

View file

@ -1,4 +1,4 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
Feature: Multiple journals Feature: Multiple journals
@ -133,3 +133,9 @@ Feature: Multiple journals
Given we use the config "multiple.yaml" Given we use the config "multiple.yaml"
When we run "jrnl --config-override highlight false" When we run "jrnl --config-override highlight false"
Then the output should not contain "There is at least one duplicate key in your configuration file" Then the output should not contain "There is at least one duplicate key in your configuration file"
Scenario: Update version number in config file when running newer version
Given we use the config "format_md.yaml"
When we run "jrnl -1"
Then the output should contain "Configuration updated to newest version at"
And the version in the config file should be up-to-date

View file

@ -1,4 +1,4 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
Feature: Functionality of jrnl outside of actually handling journals Feature: Functionality of jrnl outside of actually handling journals

View file

@ -1,4 +1,4 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
Feature: Reading and writing to journal with custom date formats Feature: Reading and writing to journal with custom date formats

View file

@ -1,4 +1,4 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
Feature: Delete entries from journal Feature: Delete entries from journal

View file

@ -1,4 +1,4 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
Feature: Encrypting and decrypting journals Feature: Encrypting and decrypting journals

View file

@ -1,4 +1,4 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
Feature: Journals iteracting with the file system in a way that users can see Feature: Journals iteracting with the file system in a way that users can see

View file

@ -1,4 +1,4 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
Feature: Custom formats Feature: Custom formats

View file

@ -1,4 +1,4 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
Feature: Importing data Feature: Importing data

View file

@ -1,4 +1,4 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
Feature: Multiple journals Feature: Multiple journals

View file

@ -1,4 +1,4 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
Feature: Implementing Runtime Overrides for Select Configuration Keys Feature: Implementing Runtime Overrides for Select Configuration Keys

View file

@ -1,4 +1,4 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
Feature: Using the installed keyring Feature: Using the installed keyring

View file

@ -1,4 +1,4 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
Feature: Searching in a journal Feature: Searching in a journal

View file

@ -1,4 +1,4 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
Feature: Starring entries Feature: Starring entries

View file

@ -1,4 +1,4 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
Feature: Tagging Feature: Tagging

View file

@ -0,0 +1,19 @@
# Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html
Feature: Using templates
Scenario Outline: Template contents should be used in new entry
Given we use the config "<config_file>"
And we use the password "test" if prompted
When we run "jrnl --config-override template features/templates/basic.template"
And we run "jrnl -1"
Then the output should contain "This text is in the basic template"
Examples: configs
| config_file |
| basic_onefile.yaml |
| basic_encrypted.yaml |
| basic_folder.yaml |
| basic_dayone.yaml |

View file

@ -1,4 +1,4 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
Feature: Upgrading Journals from 1.x.x to 2.x.x Feature: Upgrading Journals from 1.x.x to 2.x.x

View file

@ -1,4 +1,4 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
Feature: Writing new entries. Feature: Writing new entries.
@ -334,3 +334,20 @@ Feature: Writing new entries.
When we run "jrnl work This is a new entry" When we run "jrnl work This is a new entry"
Then the output should contain "Entry added to work journal" Then the output should contain "Entry added to work journal"
And we should get no error And we should get no error
Scenario Outline: Tags are saved when an entry is edited with --edit and can be searched afterward
Given we use the config "<config_file>"
And we use the password "test" if prompted
And we append to the editor if opened
@newtag
When we run "jrnl --edit -1"
When we run "jrnl --tags @newtag"
Then the output should contain
1 entry found
Examples: configs
| config_file |
| basic_onefile.yaml |
| basic_encrypted.yaml |
| basic_folder.yaml |
| basic_dayone.yaml |

View file

@ -1,4 +1,4 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
from pytest_bdd import scenarios from pytest_bdd import scenarios
@ -20,5 +20,6 @@ scenarios("features/password.feature")
scenarios("features/search.feature") scenarios("features/search.feature")
scenarios("features/star.feature") scenarios("features/star.feature")
scenarios("features/tag.feature") scenarios("features/tag.feature")
scenarios("features/template.feature")
scenarios("features/upgrade.feature") scenarios("features/upgrade.feature")
scenarios("features/write.feature") scenarios("features/write.feature")

View file

@ -1,4 +1,4 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
from pytest import mark from pytest import mark

View file

@ -0,0 +1 @@
This text is in the basic template

View file

@ -1,4 +1,4 @@
# Copyright © 2012-2022 jrnl contributors # Copyright © 2012-2023 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html # License: https://www.gnu.org/licenses/gpl-3.0.html
import os import os

Some files were not shown because too many files have changed in this diff Show more