From b522f761eed1210fc1cc31c84a3b3b2e4c5ce98f Mon Sep 17 00:00:00 2001 From: Jrnl Bot Date: Wed, 15 Jan 2020 06:33:18 +0000 Subject: [PATCH 01/43] Updating changelog [ci skip] --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d5b4a5f..45cb7a2f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,9 +10,11 @@ - Reduce startup time by 55% [\#719](https://github.com/jrnl-org/jrnl/pull/719) ([maebert](https://github.com/maebert)) - Refactor password logic to prevent accidental password leakage [\#708](https://github.com/jrnl-org/jrnl/pull/708) ([pspeter](https://github.com/pspeter)) - Password confirmation [\#706](https://github.com/jrnl-org/jrnl/pull/706) ([pspeter](https://github.com/pspeter)) +- Pretty print journal entries [\#692](https://github.com/jrnl-org/jrnl/pull/692) ([alichtman](https://github.com/alichtman)) **Build:** +- Change PyPI auth method in build pipeline [\#807](https://github.com/jrnl-org/jrnl/pull/807) ([wren](https://github.com/wren)) - Automagically update the changelog you see before your very eyes! [\#806](https://github.com/jrnl-org/jrnl/pull/806) ([wren](https://github.com/wren)) - Update Black version and lock file to fix builds on develop branch [\#784](https://github.com/jrnl-org/jrnl/pull/784) ([wren](https://github.com/wren)) - Run black formatter on codebase for standardization [\#778](https://github.com/jrnl-org/jrnl/pull/778) ([wren](https://github.com/wren)) From fd591b82a357a1bbbf62646dca738c2f729640bf Mon Sep 17 00:00:00 2001 From: Jonathan Wren Date: Tue, 14 Jan 2020 22:58:36 -0800 Subject: [PATCH 02/43] unpin poetry version in requirments --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 37dab626..50f088c6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,7 @@ before_install: - date install: - - pip install poetry~=0.12.17 + - pip install poetry - poetry install - poetry run python --version From 2433363ca8773ce60580df00403bfc98b6132cd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Ooms?= Date: Thu, 16 Jan 2020 14:51:22 +0100 Subject: [PATCH 03/43] Explain how fish can be configured to exclude jrnl commands from history by default --- docs/encryption.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/encryption.md b/docs/encryption.md index 2cb5d547..35a26313 100644 --- a/docs/encryption.md +++ b/docs/encryption.md @@ -56,10 +56,14 @@ setopt HIST_IGNORE_SPACE alias jrnl=" jrnl" ``` -The fish shell does not support automatically preventing logging like -this. To prevent `jrnl` commands being logged by fish, you must make -sure to type a space before every `jrnl` command you enter. To delete -existing `jrnl` commands from fishโ€™s history, run +If you are using `fish` instead of `bash` or `zsh`, you can get the same behaviour by +adding this to your `fish` configuration: + +``` sh +abbr jrnl=" jrnl" +``` + +To delete existing `jrnl` commands from `fish`โ€™s history, run `history delete --prefix 'jrnl '`. ## Manual decryption From a753f53f5427931752577fbdc4af89860197a6f6 Mon Sep 17 00:00:00 2001 From: Jonathan Wren Date: Sat, 25 Jan 2020 11:47:52 -0800 Subject: [PATCH 04/43] add version file to repo --- .gitignore | 1 - jrnl/__version__.py | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 jrnl/__version__.py diff --git a/.gitignore b/.gitignore index a06808df..2382cabe 100644 --- a/.gitignore +++ b/.gitignore @@ -52,4 +52,3 @@ exp/ _extras/ *.sublime-* site/ -jrnl/__version__.py diff --git a/jrnl/__version__.py b/jrnl/__version__.py new file mode 100644 index 00000000..4bf5d5ff --- /dev/null +++ b/jrnl/__version__.py @@ -0,0 +1 @@ +__version__ = "v2.2-beta" From c88457f9ff58946bf9f4dc9e7dedf14860f13956 Mon Sep 17 00:00:00 2001 From: Jonathan Wren Date: Sat, 25 Jan 2020 11:52:47 -0800 Subject: [PATCH 05/43] fix poetry warning --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index b5c2a6b1..284da2ba 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,7 +30,7 @@ pyyaml = "^5.1" behave = "^1.2" mkdocs = "^1.0" flake8 = "^3.7" -black = {version = "^19.10b0",allows-prereleases = true} +black = {version = "^19.10b0",allow-prereleases = true} [tool.poetry.scripts] jrnl = 'jrnl.cli:run' From f10cb4d4f89ac6f4ff4e42e8258c9926542e2764 Mon Sep 17 00:00:00 2001 From: Jonathan Wren Date: Sat, 25 Jan 2020 12:13:54 -0800 Subject: [PATCH 06/43] add maintainer field to config --- pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 284da2ba..c53a175c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,6 +7,9 @@ authors = [ "Jonathan Wren ", "Micah Ellison " ] +maintainers = [ + "Jonathan Wren and Micah Ellison ", +] license = "MIT" readme = "README.md" homepage = "https://jrnl.sh" From 879733a59f5b91c37ddf96c1be88dbdeb10e7cdb Mon Sep 17 00:00:00 2001 From: Jonathan Wren Date: Sat, 25 Jan 2020 12:14:09 -0800 Subject: [PATCH 07/43] update poetry version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index c53a175c..bc557beb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "jrnl" -version = "v2.1.1" +version = "v2.2-beta" description = "Collect your thoughts and notes without leaving the command line." authors = [ "Manuel Ebert ", From 932a5b6cc33db9834b365e615ceb97b39b1924ec Mon Sep 17 00:00:00 2001 From: Jrnl Bot Date: Sat, 25 Jan 2020 22:12:27 +0000 Subject: [PATCH 08/43] Updating changelog [ci skip] --- CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 93055ede..de50e8c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,6 @@ - Reduce startup time by 55% [\#719](https://github.com/jrnl-org/jrnl/pull/719) ([maebert](https://github.com/maebert)) - Refactor password logic to prevent accidental password leakage [\#708](https://github.com/jrnl-org/jrnl/pull/708) ([pspeter](https://github.com/pspeter)) - Password confirmation [\#706](https://github.com/jrnl-org/jrnl/pull/706) ([pspeter](https://github.com/pspeter)) -- Pretty print journal entries [\#692](https://github.com/jrnl-org/jrnl/pull/692) ([alichtman](https://github.com/alichtman)) **Fixed bugs:** From 9f615191b4374eb8c850dca8dee1de6c4f903db2 Mon Sep 17 00:00:00 2001 From: Micah Ellison <4383304+micahellison@users.noreply.github.com> Date: Sat, 25 Jan 2020 15:39:05 -0800 Subject: [PATCH 09/43] Prevent Travis from turning LF to CRLF in Windows --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 37dab626..8219d49a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,7 @@ cache: git: depth: false + autocrlf: false before_install: - date From 25a7577f0b5d46acc57a32b2234ddab1ac733118 Mon Sep 17 00:00:00 2001 From: Micah Ellison <4383304+micahellison@users.noreply.github.com> Date: Sat, 25 Jan 2020 15:40:05 -0800 Subject: [PATCH 10/43] Remove all skip_win directives now that Travis is not mangling newlines on Windows --- features/core.feature | 1 - features/dayone_regressions.feature | 1 - features/encryption.feature | 3 --- features/upgrade.feature | 3 --- 4 files changed, 8 deletions(-) diff --git a/features/core.feature b/features/core.feature index c023cd4c..94da701a 100644 --- a/features/core.feature +++ b/features/core.feature @@ -20,7 +20,6 @@ Feature: Basic reading and writing to a journal When we run "jrnl -n 1" Then the output should contain "2013-07-23 09:00 A cold and stormy day." - @skip_win Scenario: Writing an empty entry from the editor Given we use the config "editor.yaml" When we open the editor and enter "" diff --git a/features/dayone_regressions.feature b/features/dayone_regressions.feature index f6098ba6..62c8cc24 100644 --- a/features/dayone_regressions.feature +++ b/features/dayone_regressions.feature @@ -24,7 +24,6 @@ Feature: Zapped Dayone bugs stay dead! | I'm feeling sore because I forgot to stretch. """ - @skip_win Scenario: Opening an folder that's not a DayOne folder gives a nice error message Given we use the config "empty_folder.yaml" When we run "jrnl Herro" diff --git a/features/encryption.feature b/features/encryption.feature index 081a208f..787fa850 100644 --- a/features/encryption.feature +++ b/features/encryption.feature @@ -12,7 +12,6 @@ Then we should see the message "Journal decrypted" And the journal should have 2 entries - @skip_win Scenario: Encrypting a journal Given we use the config "basic.yaml" When we run "jrnl --encrypt" and enter @@ -27,7 +26,6 @@ Then the output should contain "Password" And the output should contain "2013-06-10 15:40 Life is good" - @skip_win Scenario: Mistyping your password Given we use the config "basic.yaml" When we run "jrnl --encrypt" and enter @@ -45,7 +43,6 @@ Then the output should contain "Password" And the output should contain "2013-06-10 15:40 Life is good" - @skip_win Scenario: Storing a password in Keychain Given we use the config "multiple.yaml" When we run "jrnl simple --encrypt" and enter diff --git a/features/upgrade.feature b/features/upgrade.feature index b2c569c7..ef597d4f 100644 --- a/features/upgrade.feature +++ b/features/upgrade.feature @@ -1,6 +1,5 @@ Feature: Upgrading Journals from 1.x.x to 2.x.x - @skip_win Scenario: Upgrade and parse journals with square brackets Given we use the config "upgrade_from_195.json" When we run "jrnl -9" and enter "Y" @@ -12,7 +11,6 @@ Feature: Upgrading Journals from 1.x.x to 2.x.x """ Then the journal should have 2 entries - @skip_win Scenario: Upgrading a journal encrypted with jrnl 1.x Given we use the config "encrypted_old.json" When we run "jrnl -n 1" and enter @@ -24,7 +22,6 @@ Feature: Upgrading Journals from 1.x.x to 2.x.x Then the output should contain "Password" and the output should contain "2013-06-10 15:40 Life is good" - @skip_win Scenario: Upgrade and parse journals with little endian date format Given we use the config "upgrade_from_195_little_endian_dates.json" When we run "jrnl -9" and enter "Y" From 9cc8539ff94ea18b9d6249b554aedf6de695bdae Mon Sep 17 00:00:00 2001 From: Micah Ellison <4383304+micahellison@users.noreply.github.com> Date: Sat, 25 Jan 2020 15:57:58 -0800 Subject: [PATCH 11/43] Keep skip_win directive for empty entry test that still stalls on Travis --- features/core.feature | 1 + 1 file changed, 1 insertion(+) diff --git a/features/core.feature b/features/core.feature index 94da701a..c023cd4c 100644 --- a/features/core.feature +++ b/features/core.feature @@ -20,6 +20,7 @@ Feature: Basic reading and writing to a journal When we run "jrnl -n 1" Then the output should contain "2013-07-23 09:00 A cold and stormy day." + @skip_win Scenario: Writing an empty entry from the editor Given we use the config "editor.yaml" When we open the editor and enter "" From e54da410008d2c8786b8e4006be300b66fb49ab0 Mon Sep 17 00:00:00 2001 From: MinchinWeb Date: Sat, 25 Jan 2020 18:01:55 -0700 Subject: [PATCH 12/43] [DayOne] YAML export improvements (#773) * [YAML Export] code style improvements * [Dayone] Brings back extended Dayone attributes to YAML export c.f. 7d3afd811ba2c32463391b709331019e3cbfc40f reverse fd46ffea23eb1cb98121bde3a3993a4fa56e1afb * [YAML Exporter] switch to f-strings * [Black] apply black formatter to YAML Exporter * Code fixes as per review --- jrnl/plugins/yaml_exporter.py | 44 +++++++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 12 deletions(-) diff --git a/jrnl/plugins/yaml_exporter.py b/jrnl/plugins/yaml_exporter.py index b0177b39..430b68f7 100644 --- a/jrnl/plugins/yaml_exporter.py +++ b/jrnl/plugins/yaml_exporter.py @@ -19,11 +19,10 @@ class YAMLExporter(TextExporter): """Returns a markdown representation of a single entry, with YAML front matter.""" if to_multifile is False: print( - "{}ERROR{}: YAML export must be to individual files. " - "Please specify a directory to export to.".format( - "\033[31m", "\033[0m" - ), - file=sys.stderr, + "{}ERROR{}: YAML export must be to individual files. Please \ + specify a directory to export to.".format( + ERROR_COLOR, RESET_COLOR, file=sys.stderr + ) ) return @@ -33,16 +32,14 @@ class YAMLExporter(TextExporter): tagsymbols = entry.journal.config["tagsymbols"] # see also Entry.Entry.rag_regex - multi_tag_regex = re.compile( - r"(?u)^\s*([{tags}][-+*#/\w]+\s*)+$".format(tags=tagsymbols) - ) + multi_tag_regex = re.compile(fr"(?u)^\s*([{tagsymbols}][-+*#/\w]+\s*)+$") """Increase heading levels in body text""" newbody = "" heading = "#" previous_line = "" warn_on_heading_level = False - for line in entry.body.splitlines(True): + for line in body.splitlines(True): if re.match(r"^#+ ", line): """ATX style headings""" newbody = newbody + previous_line + heading + line @@ -80,9 +77,32 @@ class YAMLExporter(TextExporter): dayone_attributes = "" if hasattr(entry, "uuid"): dayone_attributes += "uuid: " + entry.uuid + "\n" - # TODO: copy over pictures, if present - # source directory is entry.journal.config['journal'] - # output directory is...? + if ( + hasattr(entry, "creator_device_agent") + or hasattr(entry, "creator_generation_date") + or hasattr(entry, "creator_host_name") + or hasattr(entry, "creator_os_agent") + or hasattr(entry, "creator_software_agent") + ): + dayone_attributes += "creator:\n" + if hasattr(entry, "creator_device_agent"): + dayone_attributes += f" device agent: {entry.creator_device_agent}\n" + if hasattr(entry, "creator_generation_date"): + dayone_attributes += " generation date: {}\n".format( + str(entry.creator_generation_date) + ) + if hasattr(entry, "creator_host_name"): + dayone_attributes += f" host name: {entry.creator_host_name}\n" + if hasattr(entry, "creator_os_agent"): + dayone_attributes += f" os agent: {entry.creator_os_agent}\n" + if hasattr(entry, "creator_software_agent"): + dayone_attributes += ( + f" software agent: {entry.creator_software_agent}\n" + ) + + # TODO: copy over pictures, if present + # source directory is entry.journal.config['journal'] + # output directory is...? return "title: {title}\ndate: {date}\nstared: {stared}\ntags: {tags}\n{dayone} {body} {space}".format( date=date_str, From ace4f576b2db471d718044e25f5c60ce6274051e Mon Sep 17 00:00:00 2001 From: Jrnl Bot Date: Sun, 26 Jan 2020 01:13:04 +0000 Subject: [PATCH 13/43] Updating changelog [ci skip] --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index de50e8c7..3969df3d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ **Implemented enhancements:** +- Update YAML exporter to handle Dayone format [\#773](https://github.com/jrnl-org/jrnl/pull/773) ([MinchinWeb](https://github.com/MinchinWeb)) - Full text search \(case insensitive\) with "-contains" [\#740](https://github.com/jrnl-org/jrnl/pull/740) ([empireshades](https://github.com/empireshades)) - Reduce startup time by 55% [\#719](https://github.com/jrnl-org/jrnl/pull/719) ([maebert](https://github.com/maebert)) - Refactor password logic to prevent accidental password leakage [\#708](https://github.com/jrnl-org/jrnl/pull/708) ([pspeter](https://github.com/pspeter)) From 5033bb3e30eeba896de22e1fd6ce6a67db75e389 Mon Sep 17 00:00:00 2001 From: Jrnl Bot Date: Sun, 26 Jan 2020 01:35:23 +0000 Subject: [PATCH 14/43] Updating changelog [ci skip] --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3969df3d..e4dbdba8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ **Build:** +- Fix all skipped tests on Travis Windows builds by preserving newlines [\#823](https://github.com/jrnl-org/jrnl/pull/823) ([micahellison](https://github.com/micahellison)) - Change PyPI auth method in build pipeline [\#807](https://github.com/jrnl-org/jrnl/pull/807) ([wren](https://github.com/wren)) - Automagically update the changelog you see before your very eyes! [\#806](https://github.com/jrnl-org/jrnl/pull/806) ([wren](https://github.com/wren)) - Update Black version and lock file to fix builds on develop branch [\#784](https://github.com/jrnl-org/jrnl/pull/784) ([wren](https://github.com/wren)) From 9383c6cda3c6a31d196ab2634d141d98c8e2ca21 Mon Sep 17 00:00:00 2001 From: Jrnl Bot Date: Sat, 25 Jan 2020 22:13:51 +0000 Subject: [PATCH 15/43] Incrementing version to v2.2-beta2 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index bc557beb..c4a7e41c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "jrnl" -version = "v2.2-beta" +version = "v2.2-beta2" description = "Collect your thoughts and notes without leaving the command line." authors = [ "Manuel Ebert ", From ba3f688e8fd56bc1e0d1f3c73a2d16f926204b04 Mon Sep 17 00:00:00 2001 From: heymajor <13547412+heymajor@users.noreply.github.com> Date: Sat, 1 Feb 2020 16:12:30 -0500 Subject: [PATCH 16/43] Updating/expanding template explanation --- docs/recipes.md | 74 +++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 62 insertions(+), 12 deletions(-) diff --git a/docs/recipes.md b/docs/recipes.md index 08e51711..b9335419 100644 --- a/docs/recipes.md +++ b/docs/recipes.md @@ -13,7 +13,7 @@ jrnl @alberto --tags | grep @melo And will get something like `@melo: 9`, meaning there are 9 entries where both `@alberto` and `@melo` are tagged. How does this work? First, -`jrnl @alberto` will filter the journal to only entries containing the +`jrnl @alberto` will filter the journal to only entries containing **the** tag `@alberto`, and then the `--tags` option will print out how often each tag occurred in this filtered journal. Finally, we pipe this to `grep` which will only display the line containing `@melo`. @@ -70,17 +70,61 @@ jrnlimport () { ### Using templates -Say you always want to use the same template for creating new entries. -If you have an [external editor](../advanced) set up, you can use this: +!!! note + Templates require an [external editor](../advanced) be configured. + +A template is a code snippet that makes it easier to enter use repeated text +each time a new journal entry is started. There are two ways you can utilize +templates in your entries. + +#### 1. Command line arguments + +If you had a `template.txt` file with the following contents: ```sh -jrnl < my_template.txt -jrnl -1 --edit +My Personal Journal +Title: + +Body: ``` -Another nice solution that allows you to define individual prompts comes -from [Jacobo de -Vera](https://github.com/maebert/jrnl/issues/194#issuecomment-47402869): +The `template.txt` file could be used to create a new entry with these +command line arguements: + +```sh +jrnl < template.txt # Imports template.txt as the most recent entry +jrnl -1 --edit # Opens the most recent entry in the editor +``` + +#### 2. Include the template file in `jrnl.yaml` + +A more efficient way to work with a template file is to declare the file +in your config file by changing the `template` setting from `false` to the +template file's path in double quotes: + +```sh +... +tagsymbols: "@" +template: "/path/to/template.txt" +timeformat: '%Y-%m-%d %H:%M' +version: "2.1.1" +``` + +Changes can be saved as you continue writing the journal entry and will be +logged as a new entry in the journal you specified in the original argument. + +!!! tip +To read your journal entry or to verify the entry saved, you can use this +command: `jrnl -n 1' (Check out [Import and Export](../export/#export-to-files) for more export options). + +```sh +jrnl -n 1 +``` + +### Prompts on shell reload + +If you'd like to be prompted each time you refresh your shell, you can include +this in your `.bash_profile`: ```sh function log_question() @@ -93,6 +137,11 @@ log_question 'What did I achieve today?' log_question 'What did I make progress with?' ``` +Whenever your shell is reloaded, you will be prompted to answer each of the +questions in the example above. Each answer will be logged as a separate +journal entry at the `default_hour` and `default_minute` listed in your +`jrnl.yaml` [config file](../advanced/#configuration-file). + ### Display random entry You can use this to select one title at random and then display the whole @@ -107,10 +156,11 @@ jrnl -on "$(jrnl --short | shuf -n 1 | cut -d' ' -f1,2)" ## External editors -To use external editors for writing and editing journal entries, set -them up in your `jrnl.yaml` (see `advanced usage ` for -details). Generally, after writing an entry, you will have to save and -close the file to save the changes to jrnl. +Configure your preferred external editor by updating the `editor` option +in your `jrnl.yaml` file. (See [advanced usage](../advanced) for details). + +!!! note + To save and log any entry edits, save and close the file. ### Sublime Text From 0efd78cf3c6af1f8bc844cbc95095609ae05255d Mon Sep 17 00:00:00 2001 From: Jrnl Bot Date: Sat, 1 Feb 2020 21:22:57 +0000 Subject: [PATCH 17/43] Updating changelog [ci skip] --- CHANGELOG.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index de50e8c7..f86d2325 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,19 @@ ## [Unreleased](https://github.com/jrnl-org/jrnl/) -[Full Changelog](https://github.com/jrnl-org/jrnl/compare/v2.1.1...HEAD) +[Full Changelog](https://github.com/jrnl-org/jrnl/compare/v2.2...HEAD) + +**Implemented enhancements:** + +- Update YAML exporter to handle Dayone format [\#773](https://github.com/jrnl-org/jrnl/pull/773) ([MinchinWeb](https://github.com/MinchinWeb)) + +**Build:** + +- Fix all skipped tests on Travis Windows builds by preserving newlines [\#823](https://github.com/jrnl-org/jrnl/pull/823) ([micahellison](https://github.com/micahellison)) + +## [v2.2](https://pypi.org/project/jrnl/v2.2/) (2020-02-01) + +[Full Changelog](https://github.com/jrnl-org/jrnl/compare/v2.2-beta2...v2.2) **Implemented enhancements:** @@ -18,6 +30,8 @@ **Build:** +- Fix issue where jrnl would always out 'source' for version, fix Poetry config to build and publish properly [\#820](https://github.com/jrnl-org/jrnl/pull/820) ([wren](https://github.com/wren)) +- Unpin poetry [\#808](https://github.com/jrnl-org/jrnl/pull/808) ([wren](https://github.com/wren)) - Change PyPI auth method in build pipeline [\#807](https://github.com/jrnl-org/jrnl/pull/807) ([wren](https://github.com/wren)) - Automagically update the changelog you see before your very eyes! [\#806](https://github.com/jrnl-org/jrnl/pull/806) ([wren](https://github.com/wren)) - Update Black version and lock file to fix builds on develop branch [\#784](https://github.com/jrnl-org/jrnl/pull/784) ([wren](https://github.com/wren)) @@ -30,6 +44,7 @@ **Updated documentation:** +- Explain how fish can be configured to exclude jrnl commands from history by default [\#809](https://github.com/jrnl-org/jrnl/pull/809) ([aureooms](https://github.com/aureooms)) - Remove merge marker in recipes.md [\#782](https://github.com/jrnl-org/jrnl/pull/782) ([markphelps](https://github.com/markphelps)) - Fix merge conflict left-over [\#767](https://github.com/jrnl-org/jrnl/pull/767) ([thejspr](https://github.com/thejspr)) - Display header in docs on mobile devices [\#763](https://github.com/jrnl-org/jrnl/pull/763) ([maebert](https://github.com/maebert)) From c4f7d481bd84b021b7f5b1d1164ddea284a27f47 Mon Sep 17 00:00:00 2001 From: Jrnl Bot Date: Sat, 1 Feb 2020 21:24:21 +0000 Subject: [PATCH 18/43] Incrementing version to v2.2 [ci skip] --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index c4a7e41c..beb98479 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "jrnl" -version = "v2.2-beta2" +version = "v2.2" description = "Collect your thoughts and notes without leaving the command line." authors = [ "Manuel Ebert ", From 57e39b592f5ca56763b555130a3d6ef5d9342e0d Mon Sep 17 00:00:00 2001 From: Jonathan Wren Date: Sat, 1 Feb 2020 14:51:19 -0800 Subject: [PATCH 19/43] Take out build system from pyproject config #781 We don't use it, and it breaks the homebrew install. --- pyproject.toml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index beb98479..e1dfcfbd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,7 +38,3 @@ black = {version = "^19.10b0",allow-prereleases = true} [tool.poetry.scripts] jrnl = 'jrnl.cli:run' -[build-system] -requires = ["poetry>=0.12"] -build-backend = "poetry.masonry.api" - From 436370b53818b7a6a3746ed681b0e28f451a7ad2 Mon Sep 17 00:00:00 2001 From: heymajor <13547412+heymajor@users.noreply.github.com> Date: Sat, 1 Feb 2020 17:52:33 -0500 Subject: [PATCH 20/43] Smoothing out formatting issues --- docs/recipes.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/docs/recipes.md b/docs/recipes.md index b9335419..d688b429 100644 --- a/docs/recipes.md +++ b/docs/recipes.md @@ -13,7 +13,7 @@ jrnl @alberto --tags | grep @melo And will get something like `@melo: 9`, meaning there are 9 entries where both `@alberto` and `@melo` are tagged. How does this work? First, -`jrnl @alberto` will filter the journal to only entries containing **the** +`jrnl @alberto` will filter the journal to only entries containing the tag `@alberto`, and then the `--tags` option will print out how often each tag occurred in this filtered journal. Finally, we pipe this to `grep` which will only display the line containing `@melo`. @@ -104,18 +104,16 @@ template file's path in double quotes: ```sh ... -tagsymbols: "@" template: "/path/to/template.txt" -timeformat: '%Y-%m-%d %H:%M' -version: "2.1.1" +... ``` Changes can be saved as you continue writing the journal entry and will be logged as a new entry in the journal you specified in the original argument. !!! tip -To read your journal entry or to verify the entry saved, you can use this -command: `jrnl -n 1' (Check out [Import and Export](../export/#export-to-files) for more export options). + To read your journal entry or to verify the entry saved, you can use this + command: `jrnl -n 1` (Check out [Import and Export](../export/#export-to-files) for more export options). ```sh jrnl -n 1 From 6bf0ccfb2bbdafe3b3709d9976e42af2f18b53ff Mon Sep 17 00:00:00 2001 From: Jrnl Bot Date: Wed, 5 Feb 2020 20:34:10 +0000 Subject: [PATCH 21/43] Updating changelog [ci skip] --- CHANGELOG.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e4dbdba8..1c635848 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,24 @@ ## [Unreleased](https://github.com/jrnl-org/jrnl/) +[Full Changelog](https://github.com/jrnl-org/jrnl/compare/v2.2...HEAD) + +**Implemented enhancements:** + +- Update YAML exporter to handle Dayone format [\#773](https://github.com/jrnl-org/jrnl/pull/773) ([MinchinWeb](https://github.com/MinchinWeb)) + +**Build:** + +- Fix all skipped tests on Travis Windows builds by preserving newlines [\#823](https://github.com/jrnl-org/jrnl/pull/823) ([micahellison](https://github.com/micahellison)) + +**Updated documentation:** + +- Updating/clarifying template explanation [\#829](https://github.com/jrnl-org/jrnl/pull/829) ([heymajor](https://github.com/heymajor)) + +# Changelog + +## [Unreleased](https://github.com/jrnl-org/jrnl/) + [Full Changelog](https://github.com/jrnl-org/jrnl/compare/v2.1.1...HEAD) **Implemented enhancements:** From f40e0de4b9efbfeaf876beb0535df75f4c088dc7 Mon Sep 17 00:00:00 2001 From: Jrnl Bot Date: Thu, 6 Feb 2020 06:27:18 +0000 Subject: [PATCH 22/43] Updating changelog [ci skip] --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f86d2325..28f147b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,10 @@ - Fix all skipped tests on Travis Windows builds by preserving newlines [\#823](https://github.com/jrnl-org/jrnl/pull/823) ([micahellison](https://github.com/micahellison)) +**Updated documentation:** + +- Updating/clarifying template explanation [\#829](https://github.com/jrnl-org/jrnl/pull/829) ([heymajor](https://github.com/heymajor)) + ## [v2.2](https://pypi.org/project/jrnl/v2.2/) (2020-02-01) [Full Changelog](https://github.com/jrnl-org/jrnl/compare/v2.2-beta2...v2.2) From b747de42f64de7ed40c9f72e4f3f7db37eb98b98 Mon Sep 17 00:00:00 2001 From: Jrnl Bot Date: Thu, 6 Feb 2020 06:28:47 +0000 Subject: [PATCH 23/43] Incrementing version to v2.2.1-beta2 [ci skip] --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index e1dfcfbd..9dc76df4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "jrnl" -version = "v2.2" +version = "v2.2.1-beta2" description = "Collect your thoughts and notes without leaving the command line." authors = [ "Manuel Ebert ", From 2e7da235284b68ec6435c09fe5856328f04e27c6 Mon Sep 17 00:00:00 2001 From: Jrnl Bot Date: Sat, 8 Feb 2020 20:12:49 +0000 Subject: [PATCH 24/43] Updating changelog [ci skip] --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ec865924..99ee37ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,13 +10,13 @@ **Build:** +- Remove poetry from build system in pyproject config to fix `brew install` [\#830](https://github.com/jrnl-org/jrnl/pull/830) ([wren](https://github.com/wren)) - Fix all skipped tests on Travis Windows builds by preserving newlines [\#823](https://github.com/jrnl-org/jrnl/pull/823) ([micahellison](https://github.com/micahellison)) **Updated documentation:** - Updating/clarifying template explanation [\#829](https://github.com/jrnl-org/jrnl/pull/829) ([heymajor](https://github.com/heymajor)) - ## [v2.2](https://pypi.org/project/jrnl/v2.2/) (2020-02-01) [Full Changelog](https://github.com/jrnl-org/jrnl/compare/v2.2-beta2...v2.2) From 539eafd0bb71c2a9542b838d3ea6ede2a5a7119d Mon Sep 17 00:00:00 2001 From: Jonathan Wren Date: Sat, 8 Feb 2020 12:13:53 -0800 Subject: [PATCH 25/43] Small fixes to changelog --- CHANGELOG.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 99ee37ec..7c0493e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,7 +19,7 @@ ## [v2.2](https://pypi.org/project/jrnl/v2.2/) (2020-02-01) -[Full Changelog](https://github.com/jrnl-org/jrnl/compare/v2.2-beta2...v2.2) +[Full Changelog](https://github.com/jrnl-org/jrnl/compare/v2.1.1...v2.2) **Implemented enhancements:** @@ -59,7 +59,7 @@ ## [v2.1.1](https://pypi.org/project/jrnl/v2.1.1/) (2019-11-26) -[Full Changelog](https://github.com/jrnl-org/jrnl/compare/v2.1.1-beta...v2.1.1) +[Full Changelog](https://github.com/jrnl-org/jrnl/compare/v2.1.post2...v2.1.1) **Implemented enhancements:** @@ -82,7 +82,7 @@ ## [v2.1.post2](https://pypi.org/project/jrnl/v2.1.post2/) (2019-11-11) -[Full Changelog](https://github.com/jrnl-org/jrnl/compare/v2.1-beta6...v2.1.post2) +[Full Changelog](https://github.com/jrnl-org/jrnl/compare/v2.0.1...v2.1.post2) **Fixed bugs:** @@ -100,7 +100,7 @@ ## [v2.0.1](https://pypi.org/project/jrnl/v2.0.1/) (2019-09-26) -[Full Changelog](https://github.com/jrnl-org/jrnl/compare/v2.0.1-beta...v2.0.1) +[Full Changelog](https://github.com/jrnl-org/jrnl/compare/v2.0.0...v2.0.1) **Implemented enhancements:** @@ -118,7 +118,9 @@ ## [v2.0.0](https://pypi.org/project/jrnl/v2.0.0/) (2019-08-24) -[Full Changelog](https://github.com/jrnl-org/jrnl/compare/v2.0-rc4...v2.0.0) +[Full Changelog](https://github.com/jrnl-org/jrnl/compare/1.9.8...v2.0.0) + +๐Ÿšจ **BREAKING CHANGES** ๐Ÿšจ **Implemented enhancements:** - Change cryptographic backend from PyCrypto to cryptography.io From 630a8fcaec3d6f3c8c79fae27f462980d11dc5da Mon Sep 17 00:00:00 2001 From: Stav Shamir Date: Sat, 8 Feb 2020 22:18:01 +0200 Subject: [PATCH 26/43] Add test scenarios for the export feature (#824) * Fix behave keyword "and" to correct case "And" * Extract export_steps module * Add scenario for XML export * Add scenario for tags export * Add scenario for fancy export * Add scenario for yaml export * Remove unused module export.py * Run `make format` * Fix `create_directory` step --- features/exporting.feature | 73 ++++++++++++++++--- features/steps/core.py | 48 ------------- features/steps/export_steps.py | 124 +++++++++++++++++++++++++++++++++ jrnl/export.py | 62 ----------------- 4 files changed, 187 insertions(+), 120 deletions(-) create mode 100644 features/steps/export_steps.py delete mode 100644 jrnl/export.py diff --git a/features/exporting.feature b/features/exporting.feature index db2ef5b3..5705fda1 100644 --- a/features/exporting.feature +++ b/features/exporting.feature @@ -4,21 +4,20 @@ Feature: Exporting a Journal Given we use the config "tags.yaml" When we run "jrnl --export json" Then we should get no error - and the output should be parsable as json - and "entries" in the json output should have 2 elements - and "tags" in the json output should contain "@idea" - and "tags" in the json output should contain "@journal" - and "tags" in the json output should contain "@dan" + And the output should be parsable as json + And "entries" in the json output should have 2 elements + And "tags" in the json output should contain "@idea" + And "tags" in the json output should contain "@journal" + And "tags" in the json output should contain "@dan" Scenario: Exporting using filters should only export parts of the journal Given we use the config "tags.yaml" When we run "jrnl -until 'may 2013' --export json" - # Then we should get no error Then the output should be parsable as json - and "entries" in the json output should have 1 element - and "tags" in the json output should contain "@idea" - and "tags" in the json output should contain "@journal" - and "tags" in the json output should not contain "@dan" + And "entries" in the json output should have 1 element + And "tags" in the json output should contain "@idea" + And "tags" in the json output should contain "@journal" + And "tags" in the json output should not contain "@dan" Scenario: Exporting using custom templates Given we use the config "basic.yaml" @@ -83,3 +82,57 @@ Feature: Exporting a Journal More stuff more stuff again """ + + Scenario: Exporting to XML + Given we use the config "tags.yaml" + When we run "jrnl --export xml" + Then the output should be a valid XML string + And "entries" node in the xml output should have 2 elements + And "tags" in the xml output should contain ["@idea", "@journal", "@dan"] + + Scenario: Exporting tags + Given we use the config "tags.yaml" + When we run "jrnl --export tags" + Then the output should be + """ + @idea : 2 + @journal : 1 + @dan : 1 + """ + + Scenario: Exporting fancy + Given we use the config "tags.yaml" + When we run "jrnl --export fancy" + Then the output should be + """ + โ”Žโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ2013-04-09 15:39 + โ”ƒ I have an @idea: โ•˜โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•• + โ” โ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ”ค + โ”ƒ (1) write a command line @journal software โ”‚ + โ”ƒ (2) ??? โ”‚ + โ”ƒ (3) PROFIT! โ”‚ + โ”–โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ + โ”Žโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ2013-06-10 15:40 + โ”ƒ I met with @dan. โ•˜โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•• + โ” โ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ•Œโ”ค + โ”ƒ As alway's he shared his latest @idea on how to rule the world with me. โ”‚ + โ”ƒ inst โ”‚ + โ”–โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ + """ + + Scenario: Export to yaml + Given we use the config "tags.yaml" + And we created a directory named "exported_journal" + When we run "jrnl --export yaml -o exported_journal" + Then "exported_journal" should contain the files ["2013-04-09_i-have-an-idea.md", "2013-06-10_i-met-with-dan.md"] + And the content of exported yaml "exported_journal/2013-04-09_i-have-an-idea.md" should be + """ + title: I have an @idea: + date: 2013-04-09 15:39 + stared: False + tags: idea, journal + + (1) write a command line @journal software + (2) ??? + (3) PROFIT! + """ diff --git a/features/steps/core.py b/features/steps/core.py index af0a657e..0a3841c4 100644 --- a/features/steps/core.py +++ b/features/steps/core.py @@ -3,7 +3,6 @@ from unittest.mock import patch from behave import given, when, then from jrnl import cli, install, Journal, util, plugins from jrnl import __version__ -from dateutil import parser as date_parser from collections import defaultdict try: @@ -185,53 +184,6 @@ def no_error(context): assert context.exit_status == 0, context.exit_status -@then("the output should be parsable as json") -def check_output_json(context): - out = context.stdout_capture.getvalue() - assert json.loads(out), out - - -@then('"{field}" in the json output should have {number:d} elements') -@then('"{field}" in the json output should have 1 element') -def check_output_field(context, field, number=1): - out = context.stdout_capture.getvalue() - out_json = json.loads(out) - assert field in out_json, [field, out_json] - assert len(out_json[field]) == number, len(out_json[field]) - - -@then('"{field}" in the json output should not contain "{key}"') -def check_output_field_not_key(context, field, key): - out = context.stdout_capture.getvalue() - out_json = json.loads(out) - assert field in out_json - assert key not in out_json[field] - - -@then('"{field}" in the json output should contain "{key}"') -def check_output_field_key(context, field, key): - out = context.stdout_capture.getvalue() - out_json = json.loads(out) - assert field in out_json - assert key in out_json[field] - - -@then('the json output should contain {path} = "{value}"') -def check_json_output_path(context, path, value): - """ E.g. - the json output should contain entries.0.title = "hello" - """ - out = context.stdout_capture.getvalue() - struct = json.loads(out) - - for node in path.split("."): - try: - struct = struct[int(node)] - except ValueError: - struct = struct[node] - assert struct == value, struct - - @then("the output should be") @then('the output should be "{text}"') def check_output(context, text=None): diff --git a/features/steps/export_steps.py b/features/steps/export_steps.py new file mode 100644 index 00000000..b7965ab8 --- /dev/null +++ b/features/steps/export_steps.py @@ -0,0 +1,124 @@ +import json +import os +import shutil +from xml.etree import ElementTree + +from behave import then, given + + +@then("the output should be parsable as json") +def check_output_json(context): + out = context.stdout_capture.getvalue() + assert json.loads(out), out + + +@then('"{field}" in the json output should have {number:d} elements') +@then('"{field}" in the json output should have 1 element') +def check_output_field(context, field, number=1): + out = context.stdout_capture.getvalue() + out_json = json.loads(out) + assert field in out_json, [field, out_json] + assert len(out_json[field]) == number, len(out_json[field]) + + +@then('"{field}" in the json output should not contain "{key}"') +def check_output_field_not_key(context, field, key): + out = context.stdout_capture.getvalue() + out_json = json.loads(out) + assert field in out_json + assert key not in out_json[field] + + +@then('"{field}" in the json output should contain "{key}"') +def check_output_field_key(context, field, key): + out = context.stdout_capture.getvalue() + out_json = json.loads(out) + assert field in out_json + assert key in out_json[field] + + +@then('the json output should contain {path} = "{value}"') +def check_json_output_path(context, path, value): + """ E.g. + the json output should contain entries.0.title = "hello" + """ + out = context.stdout_capture.getvalue() + struct = json.loads(out) + + for node in path.split("."): + try: + struct = struct[int(node)] + except ValueError: + struct = struct[node] + assert struct == value, struct + + +@then("the output should be a valid XML string") +def assert_valid_xml_string(context): + output = context.stdout_capture.getvalue() + xml_tree = ElementTree.fromstring(output) + assert xml_tree, output + + +@then('"entries" node in the xml output should have {number:d} elements') +def assert_xml_output_entries_count(context, number): + output = context.stdout_capture.getvalue() + xml_tree = ElementTree.fromstring(output) + + xml_tags = (node.tag for node in xml_tree) + assert "entries" in xml_tags, str(list(xml_tags)) + + actual_entry_count = len(xml_tree.find("entries")) + assert actual_entry_count == number, actual_entry_count + + +@then('"tags" in the xml output should contain {expected_tags_json_list}') +def assert_xml_output_tags(context, expected_tags_json_list): + output = context.stdout_capture.getvalue() + xml_tree = ElementTree.fromstring(output) + + xml_tags = (node.tag for node in xml_tree) + assert "tags" in xml_tags, str(list(xml_tags)) + + expected_tags = json.loads(expected_tags_json_list) + actual_tags = set(t.attrib["name"] for t in xml_tree.find("tags")) + assert actual_tags == set(expected_tags), [actual_tags, set(expected_tags)] + + +@given('we created a directory named "{dir_name}"') +def create_directory(context, dir_name): + if os.path.exists(dir_name): + shutil.rmtree(dir_name) + os.mkdir(dir_name) + + +@then('"{dir_name}" should contain the files {expected_files_json_list}') +def assert_dir_contains_files(context, dir_name, expected_files_json_list): + actual_files = os.listdir(dir_name) + expected_files = json.loads(expected_files_json_list) + assert actual_files == expected_files, [actual_files, expected_files] + + +@then('the content of exported yaml "{file_path}" should be') +def assert_exported_yaml_file_content(context, file_path): + expected_content = context.text.strip().splitlines() + + with open(file_path, "r") as f: + actual_content = f.read().strip().splitlines() + + for actual_line, expected_line in zip(actual_content, expected_content): + if actual_line.startswith("tags: ") and expected_line.startswith("tags: "): + assert_equal_tags_ignoring_order(actual_line, expected_line) + else: + assert actual_line.strip() == expected_line.strip(), [ + actual_line.strip(), + expected_line.strip(), + ] + + +def assert_equal_tags_ignoring_order(actual_line, expected_line): + actual_tags = set(tag.strip() for tag in actual_line[len("tags: ") :].split(",")) + expected_tags = set( + tag.strip() for tag in expected_line[len("tags: ") :].split(",") + ) + assert actual_tags == expected_tags, [actual_tags, expected_tags] diff --git a/jrnl/export.py b/jrnl/export.py deleted file mode 100644 index e95d4c12..00000000 --- a/jrnl/export.py +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/env python - -from .util import ERROR_COLOR, RESET_COLOR -from .util import slugify -from .plugins.template import Template -import os - - -class Exporter: - """This Exporter can convert entries and journals into text files.""" - - def __init__(self, format): - with open("jrnl/templates/" + format + ".template") as f: - front_matter, body = f.read().strip("-\n").split("---", 2) - self.template = Template(body) - - def export_entry(self, entry): - """Returns a string representation of a single entry.""" - return str(entry) - - def _get_vars(self, journal): - return {"journal": journal, "entries": journal.entries, "tags": journal.tags} - - def export_journal(self, journal): - """Returns a string representation of an entire journal.""" - return self.template.render_block("journal", **self._get_vars(journal)) - - def write_file(self, journal, path): - """Exports a journal into a single file.""" - try: - with open(path, "w", encoding="utf-8") as f: - f.write(self.export_journal(journal)) - return f"[Journal exported to {path}]" - except OSError as e: - return f"[{ERROR_COLOR}ERROR{RESET_COLOR}: {e.filename} {e.strerror}]" - - def make_filename(self, entry): - return entry.date.strftime( - "%Y-%m-%d_{}.{}".format(slugify(entry.title), self.extension) - ) - - def write_files(self, journal, path): - """Exports a journal into individual files for each entry.""" - for entry in journal.entries: - try: - full_path = os.path.join(path, self.make_filename(entry)) - with open(full_path, "w", encoding="utf-8") as f: - f.write(self.export_entry(entry)) - except OSError as e: - return f"[{ERROR_COLOR}ERROR{RESET_COLOR}: {e.filename} {e.strerror}]" - return f"[Journal exported to {path}]" - - def export(self, journal, format="text", output=None): - """Exports to individual files if output is an existing path, or into - a single file if output is a file name, or returns the exporter's - representation as string if output is None.""" - if output and os.path.isdir(output): # multiple files - return self.write_files(journal, output) - elif output: # single file - return self.write_file(journal, output) - else: - return self.export_journal(journal) From 550347eab1101e3eef38d03dcc0b8531ec5585b5 Mon Sep 17 00:00:00 2001 From: MinchinWeb Date: Sat, 8 Feb 2020 13:34:52 -0700 Subject: [PATCH 27/43] Add UTC support for failing DayOne tests (#785) * [Dayone] don't break if the system timezone is UTC * [DayOne] re-enable tests that were failing on Travis * [DayOne] change as per code review to avoid `except: pass` --- features/dayone.feature | 13 +------------ jrnl/DayOneJournal.py | 6 +++++- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/features/dayone.feature b/features/dayone.feature index 51aa2033..8e50b42b 100644 --- a/features/dayone.feature +++ b/features/dayone.feature @@ -1,7 +1,5 @@ Feature: Dayone specific implementation details. - # fails when system time is UTC (as on Travis-CI) - @skip Scenario: Loading a DayOne Journal Given we use the config "dayone.yaml" When we run "jrnl -from 'feb 2013'" @@ -15,7 +13,7 @@ Feature: Dayone specific implementation details. 2013-07-17 11:38 This entry is starred! """ - # fails when system time is UTC (as on Travis-CI) + # broken still @skip Scenario: Entries without timezone information will be interpreted as in the current timezone Given we use the config "dayone.yaml" @@ -23,7 +21,6 @@ Feature: Dayone specific implementation details. Then we should get no error and the output should contain "2013-01-17T18:37Z" in the local time - @skip Scenario: Writing into Dayone Given we use the config "dayone.yaml" When we run "jrnl 01 may 1979: Being born hurts." @@ -33,8 +30,6 @@ Feature: Dayone specific implementation details. 1979-05-01 09:00 Being born hurts. """ - # fails when system time is UTC (as on Travis-CI) - @skip Scenario: Loading tags from a DayOne Journal Given we use the config "dayone.yaml" When we run "jrnl --tags" @@ -44,8 +39,6 @@ Feature: Dayone specific implementation details. @play : 1 """ - # fails when system time is UTC (as on Travis-CI) - @skip Scenario: Saving tags from a DayOne Journal Given we use the config "dayone.yaml" When we run "jrnl A hard day at @work" @@ -56,8 +49,6 @@ Feature: Dayone specific implementation details. @play : 1 """ - # fails when system time is UTC (as on Travis-CI) - @skip Scenario: Filtering by tags from a DayOne Journal Given we use the config "dayone.yaml" When we run "jrnl @work" @@ -66,8 +57,6 @@ Feature: Dayone specific implementation details. 2013-05-17 11:39 This entry has tags! """ - # fails when system time is UTC (as on Travis-CI) - @skip Scenario: Exporting dayone to json Given we use the config "dayone.yaml" When we run "jrnl --export json" diff --git a/jrnl/DayOneJournal.py b/jrnl/DayOneJournal.py index 83eb6788..8e8b2cd0 100644 --- a/jrnl/DayOneJournal.py +++ b/jrnl/DayOneJournal.py @@ -52,7 +52,11 @@ class DayOne(Journal.Journal): except (KeyError, pytz.exceptions.UnknownTimeZoneError): timezone = tzlocal.get_localzone() date = dict_entry["Creation Date"] - date = date + timezone.utcoffset(date, is_dst=False) + # convert the date to UTC rather than keep messing with + # timezones + if timezone.zone != "UTC": + date = date + timezone.utcoffset(date, is_dst=False) + entry = Entry.Entry( self, date, From 0cb6f5ec928bfc897b1dd88cc16289f279cf985e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Ooms?= Date: Sat, 8 Feb 2020 16:53:01 -0400 Subject: [PATCH 28/43] Fix typo in encryption docs (#812) * Explain how fish can be configured to exclude jrnl commands from history by default * Fix typo in encryption docs --- docs/encryption.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/encryption.md b/docs/encryption.md index 35a26313..dc3216d1 100644 --- a/docs/encryption.md +++ b/docs/encryption.md @@ -60,7 +60,7 @@ If you are using `fish` instead of `bash` or `zsh`, you can get the same behavio adding this to your `fish` configuration: ``` sh -abbr jrnl=" jrnl" +abbr jrnl " jrnl" ``` To delete existing `jrnl` commands from `fish`โ€™s history, run From 7ac3e3160d7e7afaf1025cdd9309d048b1f1d7ac Mon Sep 17 00:00:00 2001 From: Jrnl Bot Date: Sat, 8 Feb 2020 21:06:40 +0000 Subject: [PATCH 29/43] Updating changelog [ci skip] --- CHANGELOG.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c0493e6..c25fd5fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,9 +8,12 @@ - Update YAML exporter to handle Dayone format [\#773](https://github.com/jrnl-org/jrnl/pull/773) ([MinchinWeb](https://github.com/MinchinWeb)) +**Fixed bugs:** + +- Add UTC support for failing DayOne tests [\#785](https://github.com/jrnl-org/jrnl/pull/785) ([MinchinWeb](https://github.com/MinchinWeb)) + **Build:** -- Remove poetry from build system in pyproject config to fix `brew install` [\#830](https://github.com/jrnl-org/jrnl/pull/830) ([wren](https://github.com/wren)) - Fix all skipped tests on Travis Windows builds by preserving newlines [\#823](https://github.com/jrnl-org/jrnl/pull/823) ([micahellison](https://github.com/micahellison)) **Updated documentation:** From e5d7845f180d7b6f44d9e0bbd4d7aa2bfa7d425f Mon Sep 17 00:00:00 2001 From: MinchinWeb Date: Sat, 8 Feb 2020 14:14:33 -0700 Subject: [PATCH 30/43] Listing all entries in DayOne Classic journal throws IndexError (#786) * Reproduce bug in #780 :musical_note: I have no body, no body to love me... :musical_note: The bug is cause by a DayOne entry that has to entry body. * Deal with empty bodies Close #780. * [Travis-CI] add "tree" command to debug missing files * Fix file location I have no idea why, but it ran locally fine without issue. Travis is more particular... --- .travis.yml | 6 ++++ features/data/configs/bug780.yaml | 12 +++++++ .../48A25033B34047C591160A4480197D8B.doentry | 33 +++++++++++++++++++ features/regression.feature | 20 +++++++---- jrnl/Entry.py | 2 +- 5 files changed, 65 insertions(+), 8 deletions(-) create mode 100644 features/data/configs/bug780.yaml create mode 100644 features/data/journals/bug780.dayone/entries/48A25033B34047C591160A4480197D8B.doentry diff --git a/.travis.yml b/.travis.yml index af825d4f..5f977e76 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,8 +9,14 @@ git: depth: false autocrlf: false +addons: + apt: + packages: + - tree + before_install: - date + - tree install: - pip install poetry diff --git a/features/data/configs/bug780.yaml b/features/data/configs/bug780.yaml new file mode 100644 index 00000000..e1d830c2 --- /dev/null +++ b/features/data/configs/bug780.yaml @@ -0,0 +1,12 @@ +default_hour: 9 +default_minute: 0 +editor: '' +encrypt: false +highlight: true +journals: + default: features/journals/bug780.dayone +linewrap: 80 +tagsymbols: '@' +template: false +timeformat: '%Y-%m-%d %H:%M' +indent_character: "|" diff --git a/features/data/journals/bug780.dayone/entries/48A25033B34047C591160A4480197D8B.doentry b/features/data/journals/bug780.dayone/entries/48A25033B34047C591160A4480197D8B.doentry new file mode 100644 index 00000000..426f1ea8 --- /dev/null +++ b/features/data/journals/bug780.dayone/entries/48A25033B34047C591160A4480197D8B.doentry @@ -0,0 +1,33 @@ + + + + + Activity + Stationary + Creation Date + 2019-12-30T21:28:54Z + Entry Text + + Starred + + UUID + 48A25033B34047C591160A4480197D8B + Creator + + Device Agent + PC + Generation Date + 2019-12-30T21:28:54Z + Host Name + LE-TREPORT + OS Agent + Microsoft Windows/10 Home + Software Agent + Journaley/2.1 + + Tags + + i_have_no_body + + + diff --git a/features/regression.feature b/features/regression.feature index bedc1295..a8c1e237 100644 --- a/features/regression.feature +++ b/features/regression.feature @@ -15,13 +15,6 @@ Feature: Zapped bugs should stay dead. Then we should see the message "Entry added" and the journal should contain "[2013-11-30 15:42] Project Started." - Scenario: Date in the future should be parsed correctly - # https://github.com/maebert/jrnl/issues/185 - Given we use the config "basic.yaml" - When we run "jrnl 26/06/2019: Planet? Earth. Year? 2019." - Then we should see the message "Entry added" - and the journal should contain "[2019-06-26 09:00] Planet?" - Scenario: Loading entry with ambiguous time stamp #https://github.com/maebert/jrnl/issues/153 Given we use the config "bug153.yaml" @@ -32,6 +25,19 @@ Feature: Zapped bugs should stay dead. 2013-10-27 03:27 Some text. """ + Scenario: Date in the future should be parsed correctly + # https://github.com/maebert/jrnl/issues/185 + Given we use the config "basic.yaml" + When we run "jrnl 26/06/2019: Planet? Earth. Year? 2019." + Then we should see the message "Entry added" + and the journal should contain "[2019-06-26 09:00] Planet?" + + Scenario: Empty DayOne entry bodies should not error + # https://github.com/jrnl-org/jrnl/issues/780 + Given we use the config "bug780.yaml" + When we run "jrnl --short" + Then we should get no error + Scenario: Title with an embedded period. Given we use the config "basic.yaml" When we run "jrnl 04-24-2014: Created a new website - empty.com. Hope to get a lot of traffic." diff --git a/jrnl/Entry.py b/jrnl/Entry.py index 80754e05..01f56d5a 100755 --- a/jrnl/Entry.py +++ b/jrnl/Entry.py @@ -22,7 +22,7 @@ class Entry: def _parse_text(self): raw_text = self.text lines = raw_text.splitlines() - if lines[0].strip().endswith("*"): + if lines and lines[0].strip().endswith("*"): self.starred = True raw_text = lines[0].strip("\n *") + "\n" + "\n".join(lines[1:]) self._title, self._body = split_title(raw_text) From 4ab9fa573c2387fe5d0219391a3178fed768197e Mon Sep 17 00:00:00 2001 From: Jrnl Bot Date: Sat, 8 Feb 2020 21:26:08 +0000 Subject: [PATCH 31/43] Updating changelog [ci skip] --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c25fd5fb..e0af57a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,11 +10,14 @@ **Fixed bugs:** +- Listing all entries in DayOne Classic journal throws IndexError [\#786](https://github.com/jrnl-org/jrnl/pull/786) ([MinchinWeb](https://github.com/MinchinWeb)) - Add UTC support for failing DayOne tests [\#785](https://github.com/jrnl-org/jrnl/pull/785) ([MinchinWeb](https://github.com/MinchinWeb)) **Build:** +- Remove poetry from build system in pyproject config to fix `brew install` [\#830](https://github.com/jrnl-org/jrnl/pull/830) ([wren](https://github.com/wren)) - Fix all skipped tests on Travis Windows builds by preserving newlines [\#823](https://github.com/jrnl-org/jrnl/pull/823) ([micahellison](https://github.com/micahellison)) +- Update Black version and lock file to fix builds on develop branch [\#784](https://github.com/jrnl-org/jrnl/pull/784) ([wren](https://github.com/wren)) **Updated documentation:** From 89e0bbc3fb46b4f17b619692dc87ecbd6e573e9e Mon Sep 17 00:00:00 2001 From: Micah Ellison <4383304+micahellison@users.noreply.github.com> Date: Sat, 8 Feb 2020 13:26:44 -0800 Subject: [PATCH 32/43] Fix crashing unicode Travis tests on Windows and fail build if Windows tests fail --- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index af825d4f..0ddf4c61 100644 --- a/.travis.yml +++ b/.travis.yml @@ -51,7 +51,6 @@ jobs: fast_finish: true allow_failures: - python: nightly - - os: windows include: - name: Lint, via Black @@ -74,6 +73,7 @@ jobs: env: - JRNL_PYTHON_VERSION=3.6.8 - PATH=/c/Python36:/c/Python36/Scripts:$PATH + - PYTHONIOENCODING=UTF-8 # Python 3.7 Tests - name: Python 3.7 on Linux @@ -89,6 +89,7 @@ jobs: env: - JRNL_PYTHON_VERSION=3.7.5 - PATH=/c/Python37:/c/Python37/Scripts:$PATH + - PYTHONIOENCODING=UTF-8 # Python 3.8 Tests - name: Python 3.8 on Linux @@ -104,6 +105,7 @@ jobs: env: - JRNL_PYTHON_VERSION=3.8.0 - PATH=/c/Python38:/c/Python38/Scripts:$PATH + - PYTHONIOENCODING=UTF-8 # ... and beyond! - name: Python nightly on Linux From 40b330e5ee26861b4df0aceab70cc6b74e8ac86b Mon Sep 17 00:00:00 2001 From: micahellison <4383304+micahellison@users.noreply.github.com> Date: Sat, 8 Feb 2020 13:51:14 -0800 Subject: [PATCH 33/43] Fix crashing unicode Travis tests on Windows and fail build if Windows tests fail (#836) --- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 5f977e76..4753a731 100644 --- a/.travis.yml +++ b/.travis.yml @@ -57,7 +57,6 @@ jobs: fast_finish: true allow_failures: - python: nightly - - os: windows include: - name: Lint, via Black @@ -80,6 +79,7 @@ jobs: env: - JRNL_PYTHON_VERSION=3.6.8 - PATH=/c/Python36:/c/Python36/Scripts:$PATH + - PYTHONIOENCODING=UTF-8 # Python 3.7 Tests - name: Python 3.7 on Linux @@ -95,6 +95,7 @@ jobs: env: - JRNL_PYTHON_VERSION=3.7.5 - PATH=/c/Python37:/c/Python37/Scripts:$PATH + - PYTHONIOENCODING=UTF-8 # Python 3.8 Tests - name: Python 3.8 on Linux @@ -110,6 +111,7 @@ jobs: env: - JRNL_PYTHON_VERSION=3.8.0 - PATH=/c/Python38:/c/Python38/Scripts:$PATH + - PYTHONIOENCODING=UTF-8 # ... and beyond! - name: Python nightly on Linux From aaa2efddec9e0da2e8fcbabb0e2f7689eace2251 Mon Sep 17 00:00:00 2001 From: Micah Ellison <4383304+micahellison@users.noreply.github.com> Date: Sat, 8 Feb 2020 13:54:39 -0800 Subject: [PATCH 34/43] Restore emoji test now that it works in Windows Travis builds --- features/core.feature | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/features/core.feature b/features/core.feature index c023cd4c..34539efb 100644 --- a/features/core.feature +++ b/features/core.feature @@ -41,6 +41,14 @@ Feature: Basic reading and writing to a journal When we run "jrnl -on 'june 6 2013' --short" Then the output should be "2013-06-10 15:40 Life is good." + Scenario: Emoji support + Given we use the config "basic.yaml" + When we run "jrnl 23 july 2013: ๐ŸŒž sunny day. Saw an ๐Ÿ˜" + Then we should see the message "Entry added" + When we run "jrnl -n 1" + Then the output should contain "๐ŸŒž" + and the output should contain "๐Ÿ˜" + Scenario: Writing an entry at the prompt Given we use the config "basic.yaml" When we run "jrnl" and enter "25 jul 2013: I saw Elvis. He's alive." From d495f6feaa5bccfcac7e4a69c90133517816888f Mon Sep 17 00:00:00 2001 From: Jrnl Bot Date: Sat, 8 Feb 2020 22:03:03 +0000 Subject: [PATCH 35/43] Updating changelog [ci skip] --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e0af57a4..12344d7c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,9 +15,10 @@ **Build:** +- Fix crashing unicode Travis tests on Windows and fail build if Windows tests fail [\#836](https://github.com/jrnl-org/jrnl/pull/836) ([micahellison](https://github.com/micahellison)) - Remove poetry from build system in pyproject config to fix `brew install` [\#830](https://github.com/jrnl-org/jrnl/pull/830) ([wren](https://github.com/wren)) - Fix all skipped tests on Travis Windows builds by preserving newlines [\#823](https://github.com/jrnl-org/jrnl/pull/823) ([micahellison](https://github.com/micahellison)) -- Update Black version and lock file to fix builds on develop branch [\#784](https://github.com/jrnl-org/jrnl/pull/784) ([wren](https://github.com/wren)) +- Automagically update the changelog you see before your very eyes! [\#806](https://github.com/jrnl-org/jrnl/pull/806) ([wren](https://github.com/wren)) **Updated documentation:** From 686b111e82e126542b27e3eff1ec54783d7304bb Mon Sep 17 00:00:00 2001 From: Jonathan Wren Date: Sat, 8 Feb 2020 17:33:47 -0800 Subject: [PATCH 36/43] Stop multipe changelog generators from crashing into each other --- .build/generate_changelog.sh | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/.build/generate_changelog.sh b/.build/generate_changelog.sh index 58867c20..ea586f4c 100755 --- a/.build/generate_changelog.sh +++ b/.build/generate_changelog.sh @@ -1,5 +1,20 @@ #!/usr/bin/env bash +BRANCH=$TRAVIS_BRANCH +if [[ $TRAVIS_BRANCH == $TRAVIS_TAG ]]; then + BRANCH='master' +fi + +# Check if branch has been updated since this build started +# This tends to happen if multiple things have been merged in at the same time. +if [[ -z $TRAVIS_TAG ]]; then + git fetch origin + if [[ $(git rev-parse "origin/${BRANCH}") != $TRAVIS_COMMIT ]]; then + echo "${BRANCH} has been updated since build started. Aborting changelog." + exit 0 + fi +fi + FILENAME='CHANGELOG.md' # get the latest git tags @@ -40,11 +55,6 @@ docker run -it --rm -v "$(pwd)":/usr/local/src/your-app ferrarimarco/github-chan # Put back our link (instead of the broken one) sed -i 's!https://pypi.org/project/jrnl/HEAD/!https://github.com/jrnl-org/jrnl/!' "$FILENAME" -BRANCH=$TRAVIS_BRANCH -if [[ $TRAVIS_BRANCH == $TRAVIS_TAG ]]; then - BRANCH='master' -fi - git config --global user.email "jrnl.bot@gmail.com" git config --global user.name "Jrnl Bot" git checkout $BRANCH From 28c0d848455b99f9ad74e04e3a386f05d14dc6f5 Mon Sep 17 00:00:00 2001 From: Jonathan Wren Date: Sat, 8 Feb 2020 18:20:06 -0800 Subject: [PATCH 37/43] get rid of debug code --- .travis.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4753a731..0ddf4c61 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,14 +9,8 @@ git: depth: false autocrlf: false -addons: - apt: - packages: - - tree - before_install: - date - - tree install: - pip install poetry From b76cd3dc4960545ea048254899e34a53562cbfbb Mon Sep 17 00:00:00 2001 From: Jonathan Wren <9453067+wren@users.noreply.github.com> Date: Sat, 8 Feb 2020 18:31:47 -0800 Subject: [PATCH 38/43] Update old links (#844) Since we moved the core repo to jrnl-org, the old links no longer work. --- docs/theme/index.html | 6 +++--- features/regression.feature | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/theme/index.html b/docs/theme/index.html index a0f620fb..2221e76f 100755 --- a/docs/theme/index.html +++ b/docs/theme/index.html @@ -34,7 +34,7 @@ "operatingSystem": ["macOS", "Windows", "Linux"], "thumbnailUrl": "https://jrnl.sh/img/banner_og.png", "installUrl": "https://jrnl.sh/installation", - "softwareVersion": "2.0.0rc2" + "softwareVersion": "2.2" } @@ -42,7 +42,7 @@
@@ -58,7 +58,7 @@
diff --git a/features/regression.feature b/features/regression.feature index a8c1e237..5aa1db06 100644 --- a/features/regression.feature +++ b/features/regression.feature @@ -1,7 +1,7 @@ Feature: Zapped bugs should stay dead. Scenario: Writing an entry does not print the entire journal - # https://github.com/maebert/jrnl/issues/87 + # https://github.com/jrnl-org/jrnl/issues/87 Given we use the config "basic.yaml" When we run "jrnl 23 july 2013: A cold and stormy day. I ate crisps on the sofa." Then we should see the message "Entry added" @@ -9,14 +9,14 @@ Feature: Zapped bugs should stay dead. Then the output should not contain "Life is good" Scenario: Date with time should be parsed correctly - # https://github.com/maebert/jrnl/issues/117 + # https://github.com/jrnl-org/jrnl/issues/117 Given we use the config "basic.yaml" When we run "jrnl 2013-11-30 15:42: Project Started." Then we should see the message "Entry added" and the journal should contain "[2013-11-30 15:42] Project Started." Scenario: Loading entry with ambiguous time stamp - #https://github.com/maebert/jrnl/issues/153 + #https://github.com/jrnl-org/jrnl/issues/153 Given we use the config "bug153.yaml" When we run "jrnl -1" Then we should get no error @@ -26,7 +26,7 @@ Feature: Zapped bugs should stay dead. """ Scenario: Date in the future should be parsed correctly - # https://github.com/maebert/jrnl/issues/185 + # https://github.com/jrnl-org/jrnl/issues/185 Given we use the config "basic.yaml" When we run "jrnl 26/06/2019: Planet? Earth. Year? 2019." Then we should see the message "Entry added" From 2be0436ef17aaf61cdeb23fbf677c2f44f454aa1 Mon Sep 17 00:00:00 2001 From: Jonathan Wren <9453067+wren@users.noreply.github.com> Date: Sat, 8 Feb 2020 18:32:30 -0800 Subject: [PATCH 39/43] Update site description (#841) Don't know why this was what it was. Maybe an old joke I don't get? Either way, new description makes more sense. --- mkdocs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkdocs.yml b/mkdocs.yml index ed1795d1..4c56567b 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -12,7 +12,7 @@ markdown_extensions: - admonition repo_url: https://github.com/jrnl-org/jrnl/ site_author: Manuel Ebert -site_description: Never Worry about Money Again. +site_description: Collect your thoughts and notes without leaving the command line. nav: - Overview: overview.md - Quickstart: installation.md From b2eab4bad38c551b7cb4c0a2e7b80b01068ae7d1 Mon Sep 17 00:00:00 2001 From: Jonathan Wren <9453067+wren@users.noreply.github.com> Date: Sat, 8 Feb 2020 18:32:58 -0800 Subject: [PATCH 40/43] Get rid of dumb sex joke (#840) These kinds of jokes make us look bad, and have gotten this project bad PR on social media. It's best to get rid of them. We can still be super glib and funny without crass jokes. --- docs/usage.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/usage.md b/docs/usage.md index 18b35d68..deb612be 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -119,10 +119,10 @@ Will print all entries in which either `@pinkie` or `@WorldDomination` occurred. ```sh -jrnl -n 5 -and @pineapple @lubricant +jrnl -n 5 -and @pinkie @WorldDomination ``` -the last five entries containing both `@pineapple` **and** `@lubricant`. +the last five entries containing both `@pinkie` **and** `@worldDomination`. You can change which symbols you'd like to use for tagging in the configuration. @@ -154,7 +154,7 @@ encrypt) your edited journal after you save and exit the editor. You can also use this feature for deleting entries from your journal ```sh -jrnl @girlfriend -until 'june 2012' --edit +jrnl @texas -until 'june 2012' --edit ``` Just select all text, press delete, and everything is gone... From 7f1f878a08901e790ce7a58c54128dcf8f9f3226 Mon Sep 17 00:00:00 2001 From: Jonathan Wren <9453067+wren@users.noreply.github.com> Date: Sat, 8 Feb 2020 18:33:28 -0800 Subject: [PATCH 41/43] Don't re-run tests on deployment (#839) By the time we get to the deployment step, we've already run these tests dozens of times. We don't need to run them yet again at deploy time. --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 0ddf4c61..a602f51b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -131,6 +131,8 @@ jobs: - poetry version "$TRAVIS_TAG" - echo __version__ = \"$TRAVIS_TAG\" > jrnl/__version__.py - poetry build + script: + - echo "Deployment starting..." deploy: - provider: script script: poetry publish From 74a11cebdd996593162d2f663af10f2510d83cdc Mon Sep 17 00:00:00 2001 From: Jonathan Wren <9453067+wren@users.noreply.github.com> Date: Sat, 8 Feb 2020 18:33:54 -0800 Subject: [PATCH 42/43] Put back build lines in poetry config (#838) Taking out these lines earlier fixed the homebrew release, but broke other things. So, I'm putting them back for now until we can find a better solution. --- pyproject.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 9dc76df4..c8c9984e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,3 +38,7 @@ black = {version = "^19.10b0",allow-prereleases = true} [tool.poetry.scripts] jrnl = 'jrnl.cli:run' +[build-system] +requires = ["poetry>=0.12"] +build-backend = "poetry.masonry.api" + From 95aa3bc1aec9da88678981741f859de5e54cc52a Mon Sep 17 00:00:00 2001 From: Jrnl Bot Date: Sun, 9 Feb 2020 03:31:51 +0000 Subject: [PATCH 43/43] Updating changelog [ci skip] --- CHANGELOG.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 12344d7c..026c1718 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,13 +15,18 @@ **Build:** +- Stop multipe changelog generators from crashing into each other [\#845](https://github.com/jrnl-org/jrnl/pull/845) ([wren](https://github.com/wren)) +- Don't re-run tests on deployment [\#839](https://github.com/jrnl-org/jrnl/pull/839) ([wren](https://github.com/wren)) +- Put back build lines in Poetry config [\#838](https://github.com/jrnl-org/jrnl/pull/838) ([wren](https://github.com/wren)) +- Restore emoji test [\#837](https://github.com/jrnl-org/jrnl/pull/837) ([micahellison](https://github.com/micahellison)) - Fix crashing unicode Travis tests on Windows and fail build if Windows tests fail [\#836](https://github.com/jrnl-org/jrnl/pull/836) ([micahellison](https://github.com/micahellison)) - Remove poetry from build system in pyproject config to fix `brew install` [\#830](https://github.com/jrnl-org/jrnl/pull/830) ([wren](https://github.com/wren)) - Fix all skipped tests on Travis Windows builds by preserving newlines [\#823](https://github.com/jrnl-org/jrnl/pull/823) ([micahellison](https://github.com/micahellison)) -- Automagically update the changelog you see before your very eyes! [\#806](https://github.com/jrnl-org/jrnl/pull/806) ([wren](https://github.com/wren)) **Updated documentation:** +- Update site description [\#841](https://github.com/jrnl-org/jrnl/pull/841) ([wren](https://github.com/wren)) +- Get rid of dumb sex joke [\#840](https://github.com/jrnl-org/jrnl/pull/840) ([wren](https://github.com/wren)) - Updating/clarifying template explanation [\#829](https://github.com/jrnl-org/jrnl/pull/829) ([heymajor](https://github.com/heymajor)) ## [v2.2](https://pypi.org/project/jrnl/v2.2/) (2020-02-01)