diff --git a/CHANGELOG.md b/CHANGELOG.md index d51df7a8..594d127e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,27 @@ # Changelog -## [Unreleased](https://github.com/jrnl-org/jrnl/) +## [v3.1-beta](https://pypi.org/project/jrnl/v3.1-beta/) (2022-07-30) -[Full Changelog](https://github.com/jrnl-org/jrnl/compare/v3.0...HEAD) +[Full Changelog](https://github.com/jrnl-org/jrnl/compare/v3.0...v3.1-beta) **Implemented enhancements:** - Warn user when there are duplicate keys in the config file [\#1415](https://github.com/jrnl-org/jrnl/issues/1415) +- Support tzlocal v4 [\#1338](https://github.com/jrnl-org/jrnl/issues/1338) +- Update tzlocal to v4.x and remove pytz dependency [\#1528](https://github.com/jrnl-org/jrnl/pull/1528) ([outa](https://github.com/outa)) +- Add linewrap option 'auto' [\#1507](https://github.com/jrnl-org/jrnl/pull/1507) ([jonakeys](https://github.com/jonakeys)) + +**Fixed bugs:** + +- Update formatting function to better account for indentation [\#1541](https://github.com/jrnl-org/jrnl/pull/1541) ([wren](https://github.com/wren)) +- Fixed index out of range error in fancy exporter [\#1522](https://github.com/jrnl-org/jrnl/pull/1522) ([apainintheneck](https://github.com/apainintheneck)) + +**Packaging:** + +- Bump yq from 3.0.2 to 3.1.0 [\#1546](https://github.com/jrnl-org/jrnl/pull/1546) ([dependabot[bot]](https://github.com/apps/dependabot)) +- Bump poethepoet from 0.15.0 to 0.16.0 [\#1542](https://github.com/jrnl-org/jrnl/pull/1542) ([dependabot[bot]](https://github.com/apps/dependabot)) +- Bump keyring from 23.6.0 to 23.7.0 [\#1539](https://github.com/jrnl-org/jrnl/pull/1539) ([dependabot[bot]](https://github.com/apps/dependabot)) +- Bump rich from 12.4.4 to 12.5.1 [\#1538](https://github.com/jrnl-org/jrnl/pull/1538) ([dependabot[bot]](https://github.com/apps/dependabot)) ## [v3.0](https://pypi.org/project/jrnl/v3.0/) (2022-07-09) diff --git a/docs/reference-config-file.md b/docs/reference-config-file.md index 03454c05..80949156 100644 --- a/docs/reference-config-file.md +++ b/docs/reference-config-file.md @@ -101,7 +101,8 @@ If `true`, tags will be highlighted in cyan. ### linewrap Controls the width of the output. Set to `false` if you don't want to -wrap long lines. +wrap long lines. Set to `auto` to let `jrnl` automatically determine +the terminal width. ### colors A dictionary that controls the colors used to display journal entries. diff --git a/jrnl/DayOneJournal.py b/jrnl/DayOneJournal.py index 27ffef6d..faeb5210 100644 --- a/jrnl/DayOneJournal.py +++ b/jrnl/DayOneJournal.py @@ -10,10 +10,10 @@ import re import socket import time import uuid +import zoneinfo from pathlib import Path from xml.parsers.expat import ExpatError -import pytz import tzlocal from jrnl import Entry @@ -39,10 +39,6 @@ class DayOne(Journal.Journal): super().__init__(**kwargs) def open(self): - filenames = [ - os.path.join(self.config["journal"], "entries", f) - for f in os.listdir(os.path.join(self.config["journal"], "entries")) - ] filenames = [] for root, dirnames, f in os.walk(self.config["journal"]): for filename in fnmatch.filter(f, "*.doentry"): @@ -56,14 +52,15 @@ class DayOne(Journal.Journal): pass else: try: - timezone = pytz.timezone(dict_entry["Time Zone"]) - except (KeyError, pytz.exceptions.UnknownTimeZoneError): - timezone = tzlocal.get_localzone() + timezone = zoneinfo.ZoneInfo(dict_entry["Time Zone"]) + except KeyError: + timezone_name = str(tzlocal.get_localzone()) + timezone = zoneinfo.ZoneInfo(timezone_name) date = dict_entry["Creation Date"] # convert the date to UTC rather than keep messing with # timezones - if timezone.zone != "UTC": - date = date + timezone.utcoffset(date, is_dst=False) + if timezone.key != "UTC": + date = date.replace(fold=1) + timezone.utcoffset(date) entry = Entry.Entry( self, diff --git a/jrnl/Entry.py b/jrnl/Entry.py index 73f26190..6754072f 100644 --- a/jrnl/Entry.py +++ b/jrnl/Entry.py @@ -2,12 +2,14 @@ # License: https://www.gnu.org/licenses/gpl-3.0.html import datetime +import logging +import os import re import ansiwrap -from jrnl.color import colorize -from jrnl.color import highlight_tags_with_background_color +from .color import colorize +from .color import highlight_tags_with_background_color class Entry: @@ -104,6 +106,18 @@ class Entry: ) if not short and self.journal.config["linewrap"]: + columns = self.journal.config["linewrap"] + + if columns == "auto": + try: + columns = os.get_terminal_size().columns + except OSError: + logging.debug( + "Can't determine terminal size automatically 'linewrap': '%s'", + self.journal.config["linewrap"], + ) + columns = 79 + # Color date / title and bold title title = ansiwrap.fill( date_str @@ -114,7 +128,7 @@ class Entry: self.journal.config["colors"]["title"], is_title=True, ), - self.journal.config["linewrap"], + columns, ) body = highlight_tags_with_background_color( self, self.body.rstrip(" \n"), self.journal.config["colors"]["body"] @@ -123,7 +137,7 @@ class Entry: colorize( ansiwrap.fill( line, - self.journal.config["linewrap"], + columns, initial_indent=indent, subsequent_indent=indent, drop_whitespace=True, diff --git a/jrnl/__version__.py b/jrnl/__version__.py index 1cb4416f..c4a343ad 100644 --- a/jrnl/__version__.py +++ b/jrnl/__version__.py @@ -1 +1 @@ -__version__ = "v3.0" +__version__ = "v3.1-beta" diff --git a/jrnl/plugins/fancy_exporter.py b/jrnl/plugins/fancy_exporter.py index b9567bfd..2ce39ae0 100644 --- a/jrnl/plugins/fancy_exporter.py +++ b/jrnl/plugins/fancy_exporter.py @@ -1,6 +1,8 @@ # Copyright (C) 2012-2022 jrnl contributors # License: https://www.gnu.org/licenses/gpl-3.0.html +import logging +import os from textwrap import TextWrapper from jrnl.exception import JrnlException @@ -36,7 +38,22 @@ class FancyExporter(TextExporter): def export_entry(cls, entry): """Returns a fancy unicode representation of a single entry.""" date_str = entry.date.strftime(entry.journal.config["timeformat"]) - linewrap = entry.journal.config["linewrap"] or 78 + + if entry.journal.config["linewrap"]: + linewrap = entry.journal.config["linewrap"] + + if linewrap == "auto": + try: + linewrap = os.get_terminal_size().columns + except OSError: + logging.debug( + "Can't determine terminal size automatically 'linewrap': '%s'", + entry.journal.config["linewrap"], + ) + linewrap = 79 + else: + linewrap = 79 + initial_linewrap = max((1, linewrap - len(date_str) - 2)) body_linewrap = linewrap - 2 card = [ @@ -50,7 +67,7 @@ class FancyExporter(TextExporter): subsequent_indent=cls.border_g + " ", ) - title_lines = w.wrap(entry.title) + title_lines = w.wrap(entry.title) or [""] card.append( title_lines[0].ljust(initial_linewrap + 1) + cls.border_d diff --git a/poetry.lock b/poetry.lock index 31d03998..63cebaaf 100644 --- a/poetry.lock +++ b/poetry.lock @@ -52,17 +52,17 @@ python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" [[package]] name = "attrs" -version = "21.4.0" +version = "22.1.0" description = "Classes Without Boilerplate" category = "dev" optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" +python-versions = ">=3.5" [package.extras] -dev = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins", "zope.interface", "furo", "sphinx", "sphinx-notfound-page", "pre-commit", "cloudpickle"] +dev = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "mypy (>=0.900,!=0.940)", "pytest-mypy-plugins", "zope.interface", "furo", "sphinx", "sphinx-notfound-page", "pre-commit", "cloudpickle"] docs = ["furo", "sphinx", "zope.interface", "sphinx-notfound-page"] -tests = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins", "zope.interface", "cloudpickle"] -tests_no_zope = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins", "cloudpickle"] +tests = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "mypy (>=0.900,!=0.940)", "pytest-mypy-plugins", "zope.interface", "cloudpickle"] +tests_no_zope = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "mypy (>=0.900,!=0.940)", "pytest-mypy-plugins", "cloudpickle"] [[package]] name = "backcall" @@ -164,7 +164,7 @@ python-versions = ">=3.5" [[package]] name = "distlib" -version = "0.3.4" +version = "0.3.5" description = "Distribution utilities" category = "dev" optional = false @@ -183,7 +183,7 @@ testing = ["pre-commit"] [[package]] name = "executing" -version = "0.8.3" +version = "0.9.1" description = "Get the currently executing AST node of a frame, and other information" category = "dev" optional = false @@ -365,7 +365,7 @@ i18n = ["Babel (>=2.7)"] [[package]] name = "keyring" -version = "23.6.0" +version = "23.7.0" description = "Store and access your passwords safely." category = "main" optional = false @@ -379,7 +379,7 @@ SecretStorage = {version = ">=3.2", markers = "sys_platform == \"linux\""} [package.extras] docs = ["sphinx", "jaraco.packaging (>=9)", "rst.linker (>=1.9)", "jaraco.tidelift (>=1.4)"] -testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytest-cov", "pytest-enabler (>=1.0.1)", "pytest-black (>=0.3.7)", "pytest-mypy (>=0.9.1)"] +testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytest-cov", "pytest-enabler (>=1.3)", "pytest-black (>=0.3.7)", "pytest-mypy (>=0.9.1)"] [[package]] name = "mako" @@ -399,11 +399,11 @@ testing = ["pytest"] [[package]] name = "markdown" -version = "3.3.7" +version = "3.4.1" description = "Python implementation of Markdown." category = "dev" optional = false -python-versions = ">=3.6" +python-versions = ">=3.7" [package.dependencies] importlib-metadata = {version = ">=4.4", markers = "python_version < \"3.10\""} @@ -593,7 +593,7 @@ testing = ["pytest", "pytest-benchmark"] [[package]] name = "poethepoet" -version = "0.15.0" +version = "0.16.0" description = "A task runner that works well with poetry." category = "dev" optional = false @@ -799,12 +799,15 @@ python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" six = ">=1.5" [[package]] -name = "pytz" -version = "2022.1" -description = "World timezone definitions, modern and historical" +name = "pytz-deprecation-shim" +version = "0.1.0.post0" +description = "Shims to make deprecation of pytz easier" category = "main" optional = false -python-versions = "*" +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,>=2.7" + +[package.dependencies] +tzdata = {version = "*", markers = "python_version >= \"3.6\""} [[package]] name = "pywin32-ctypes" @@ -843,7 +846,7 @@ pyyaml = "*" [[package]] name = "rich" -version = "12.4.4" +version = "12.5.1" description = "Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal" category = "main" optional = false @@ -980,34 +983,46 @@ category = "dev" optional = false python-versions = ">=3.7" +[[package]] +name = "tzdata" +version = "2022.1" +description = "Provider of IANA time zone data" +category = "main" +optional = false +python-versions = ">=2" + [[package]] name = "tzlocal" -version = "2.1" +version = "4.2" description = "tzinfo object for the local timezone" category = "main" optional = false -python-versions = "*" +python-versions = ">=3.6" [package.dependencies] -pytz = "*" +pytz-deprecation-shim = "*" +tzdata = {version = "*", markers = "platform_system == \"Windows\""} + +[package.extras] +devenv = ["black", "pyroma", "pytest-cov", "zest.releaser"] +test = ["pytest-mock (>=3.3)", "pytest (>=4.3)"] [[package]] name = "virtualenv" -version = "20.15.1" +version = "20.16.2" description = "Virtual Python Environment builder" category = "dev" optional = false -python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7" +python-versions = ">=3.6" [package.dependencies] distlib = ">=0.3.1,<1" filelock = ">=3.2,<4" platformdirs = ">=2,<3" -six = ">=1.9.0,<2" [package.extras] docs = ["proselint (>=0.10.2)", "sphinx (>=3)", "sphinx-argparse (>=0.2.5)", "sphinx-rtd-theme (>=0.4.3)", "towncrier (>=21.3)"] -testing = ["coverage (>=4)", "coverage-enable-subprocess (>=1)", "flaky (>=3)", "pytest (>=4)", "pytest-env (>=0.6.2)", "pytest-freezegun (>=0.4.1)", "pytest-mock (>=2)", "pytest-randomly (>=1)", "pytest-timeout (>=1)", "packaging (>=20.0)"] +testing = ["coverage (>=4)", "coverage-enable-subprocess (>=1)", "flaky (>=3)", "packaging (>=20.0)", "pytest (>=4)", "pytest-env (>=0.6.2)", "pytest-freezegun (>=0.4.1)", "pytest-mock (>=2)", "pytest-randomly (>=1)", "pytest-timeout (>=1)"] [[package]] name = "watchdog" @@ -1038,7 +1053,7 @@ python-versions = ">=3.4" [[package]] name = "yq" -version = "3.0.2" +version = "3.1.0" description = "Command-line YAML/XML processor - jq wrapper for YAML/XML documents" category = "dev" optional = false @@ -1055,20 +1070,20 @@ tests = ["coverage", "flake8", "wheel"] [[package]] name = "zipp" -version = "3.8.0" +version = "3.8.1" description = "Backport of pathlib-compatible object wrapper for zip files" category = "main" optional = false python-versions = ">=3.7" [package.extras] -docs = ["sphinx", "jaraco.packaging (>=9)", "rst.linker (>=1.9)"] -testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytest-cov", "pytest-enabler (>=1.0.1)", "jaraco.itertools", "func-timeout", "pytest-black (>=0.3.7)", "pytest-mypy (>=0.9.1)"] +docs = ["sphinx", "jaraco.packaging (>=9)", "rst.linker (>=1.9)", "jaraco.tidelift (>=1.4)"] +testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytest-cov", "pytest-enabler (>=1.3)", "jaraco.itertools", "func-timeout", "pytest-black (>=0.3.7)", "pytest-mypy (>=0.9.1)"] [metadata] lock-version = "1.1" python-versions = ">=3.9.0, <3.12" -content-hash = "647a60d3f5c77ae365e4acef948b048a112eebd0315e026ffe31a0cc441c6601" +content-hash = "5f5954af39ca238b840a95e932999bcb1ead3b8d403d0d18e0a89806ddcc59f9" [metadata.files] ansiwrap = [ @@ -1088,10 +1103,7 @@ asttokens = [ {file = "asttokens-2.0.5.tar.gz", hash = "sha256:9a54c114f02c7a9480d56550932546a3f1fe71d8a02f1bc7ccd0ee3ee35cf4d5"}, ] atomicwrites = [] -attrs = [ - {file = "attrs-21.4.0-py2.py3-none-any.whl", hash = "sha256:2d27e3784d7a565d36ab851fe94887c5eccd6a463168875832a1be79c82828b4"}, - {file = "attrs-21.4.0.tar.gz", hash = "sha256:626ba8234211db98e869df76230a137c4c40a12d72445c45d5f5b716f076e2fd"}, -] +attrs = [] backcall = [ {file = "backcall-0.2.0-py2.py3-none-any.whl", hash = "sha256:fbbce6a29f263178a1f7915c1940bde0ec2b2a967566fe1c65c1dfb7422bd255"}, {file = "backcall-0.2.0.tar.gz", hash = "sha256:5cbdbf27be5e7cfadb448baf0aa95508f91f2bbc6c6437cd9cd06e2a4c215e1e"}, @@ -1115,18 +1127,12 @@ decorator = [ {file = "decorator-5.1.1-py3-none-any.whl", hash = "sha256:b8c3f85900b9dc423225913c5aace94729fe1fa9763b38939a95226f02d37186"}, {file = "decorator-5.1.1.tar.gz", hash = "sha256:637996211036b6385ef91435e4fae22989472f9d571faba8927ba8253acbc330"}, ] -distlib = [ - {file = "distlib-0.3.4-py2.py3-none-any.whl", hash = "sha256:6564fe0a8f51e734df6333d08b8b94d4ea8ee6b99b5ed50613f731fd4089f34b"}, - {file = "distlib-0.3.4.zip", hash = "sha256:e4b58818180336dc9c529bfb9a0b58728ffc09ad92027a3f30b7cd91e3458579"}, -] +distlib = [] execnet = [ {file = "execnet-1.9.0-py2.py3-none-any.whl", hash = "sha256:a295f7cc774947aac58dde7fdc85f4aa00c42adf5d8f5468fc630c1acf30a142"}, {file = "execnet-1.9.0.tar.gz", hash = "sha256:8f694f3ba9cc92cab508b152dcfe322153975c29bda272e2fd7f3f00f36e47c5"}, ] -executing = [ - {file = "executing-0.8.3-py2.py3-none-any.whl", hash = "sha256:d1eef132db1b83649a3905ca6dd8897f71ac6f8cac79a7e58a1a09cf137546c9"}, - {file = "executing-0.8.3.tar.gz", hash = "sha256:c6554e21c6b060590a6d3be4b82fb78f8f0194d809de5ea7df1c093763311501"}, -] +executing = [] filelock = [ {file = "filelock-3.7.1-py3-none-any.whl", hash = "sha256:37def7b658813cda163b56fc564cdc75e86d338246458c4c28ae84cabefa2404"}, {file = "filelock-3.7.1.tar.gz", hash = "sha256:3a0fd85166ad9dbab54c9aec96737b744106dc5f15c0b09a6744a445299fcf04"}, @@ -1173,15 +1179,9 @@ jinja2 = [ {file = "Jinja2-3.1.2-py3-none-any.whl", hash = "sha256:6088930bfe239f0e6710546ab9c19c9ef35e29792895fed6e6e31a023a182a61"}, {file = "Jinja2-3.1.2.tar.gz", hash = "sha256:31351a702a408a9e7595a8fc6150fc3f43bb6bf7e319770cbc0db9df9437e852"}, ] -keyring = [ - {file = "keyring-23.6.0-py3-none-any.whl", hash = "sha256:372ff2fc43ab779e3f87911c26e6c7acc8bb440cbd82683e383ca37594cb0617"}, - {file = "keyring-23.6.0.tar.gz", hash = "sha256:3ac00c26e4c93739e19103091a9986a9f79665a78cf15a4df1dba7ea9ac8da2f"}, -] +keyring = [] mako = [] -markdown = [ - {file = "Markdown-3.3.7-py3-none-any.whl", hash = "sha256:f5da449a6e1c989a4cea2631aa8ee67caa5a2ef855d551c88f9e309f4634c621"}, - {file = "Markdown-3.3.7.tar.gz", hash = "sha256:cbb516f16218e643d8e0a95b309f77eb118cb138d39a4f27851e6a63581db874"}, -] +markdown = [] markupsafe = [ {file = "MarkupSafe-2.1.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:86b1f75c4e7c2ac2ccdaec2b9022845dbb81880ca318bb7a0a01fbf7813e3812"}, {file = "MarkupSafe-2.1.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:f121a1420d4e173a5d96e47e9a0c0dcff965afdf1626d28de1460815f7c4ee7a"}, @@ -1352,10 +1352,7 @@ python-dateutil = [ {file = "python-dateutil-2.8.2.tar.gz", hash = "sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86"}, {file = "python_dateutil-2.8.2-py2.py3-none-any.whl", hash = "sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9"}, ] -pytz = [ - {file = "pytz-2022.1-py2.py3-none-any.whl", hash = "sha256:e68985985296d9a66a881eb3193b0906246245294a881e7c8afe623866ac6a5c"}, - {file = "pytz-2022.1.tar.gz", hash = "sha256:1e760e2fe6a8163bc0b3d9a19c4f84342afa0a2affebfaa84b01b978a02ecaa7"}, -] +pytz-deprecation-shim = [] pywin32-ctypes = [ {file = "pywin32-ctypes-0.2.0.tar.gz", hash = "sha256:24ffc3b341d457d48e8922352130cf2644024a4ff09762a2261fd34c36ee5942"}, {file = "pywin32_ctypes-0.2.0-py2.py3-none-any.whl", hash = "sha256:9dc2d991b3479cc2df15930958b674a48a227d5361d413827a4cfd0b5876fc98"}, @@ -1403,10 +1400,7 @@ pyyaml-env-tag = [ {file = "pyyaml_env_tag-0.1-py3-none-any.whl", hash = "sha256:af31106dec8a4d68c60207c1886031cbf839b68aa7abccdb19868200532c2069"}, {file = "pyyaml_env_tag-0.1.tar.gz", hash = "sha256:70092675bda14fdec33b31ba77e7543de9ddc88f2e5b99160396572d11525bdb"}, ] -rich = [ - {file = "rich-12.4.4-py3-none-any.whl", hash = "sha256:d2bbd99c320a2532ac71ff6a3164867884357da3e3301f0240090c5d2fdac7ec"}, - {file = "rich-12.4.4.tar.gz", hash = "sha256:4c586de507202505346f3e32d1363eb9ed6932f0c2f63184dea88983ff4971e2"}, -] +rich = [] "ruamel.yaml" = [ {file = "ruamel.yaml-0.17.21-py3-none-any.whl", hash = "sha256:742b35d3d665023981bd6d16b3d24248ce5df75fdb4e2924e93a05c1f8b61ca7"}, {file = "ruamel.yaml-0.17.21.tar.gz", hash = "sha256:8b7ce697a2f212752a35c1ac414471dc16c424c9573be4926b56ff3f5d23b7af"}, @@ -1468,10 +1462,8 @@ traitlets = [ {file = "traitlets-5.3.0.tar.gz", hash = "sha256:0bb9f1f9f017aa8ec187d8b1b2a7a6626a2a1d877116baba52a129bfa124f8e2"}, ] typing-extensions = [] -tzlocal = [ - {file = "tzlocal-2.1-py2.py3-none-any.whl", hash = "sha256:e2cb6c6b5b604af38597403e9852872d7f534962ae2954c7f35efcb1ccacf4a4"}, - {file = "tzlocal-2.1.tar.gz", hash = "sha256:643c97c5294aedc737780a49d9df30889321cbe1204eac2c2ec6134035a92e44"}, -] +tzdata = [] +tzlocal = [] virtualenv = [] watchdog = [ {file = "watchdog-2.1.9-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:a735a990a1095f75ca4f36ea2ef2752c99e6ee997c46b0de507ba40a09bf7330"}, @@ -1509,7 +1501,4 @@ xmltodict = [ {file = "xmltodict-0.13.0.tar.gz", hash = "sha256:341595a488e3e01a85a9d8911d8912fd922ede5fecc4dce437eb4b6c8d037e56"}, ] yq = [] -zipp = [ - {file = "zipp-3.8.0-py3-none-any.whl", hash = "sha256:c4f6e5bbf48e74f7a38e7cc5b0480ff42b0ae5178957d564d18932525d5cf099"}, - {file = "zipp-3.8.0.tar.gz", hash = "sha256:56bf8aadb83c24db6c4b577e13de374ccfb67da2078beba1d037c17980bf43ad"}, -] +zipp = [] diff --git a/pyproject.toml b/pyproject.toml index 51bd6ff6..fa40a1c3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "jrnl" -version = "v3.0" +version = "v3.1-beta" description = "Collect your thoughts and notes without leaving the command line." authors = [ "jrnl contributors ", @@ -40,8 +40,7 @@ pyxdg = ">=0.27.0" rich = "^12.2.0" # dayone-only deps -pytz = ">=2020" # https://pythonhosted.org/pytz/#issues-limitations -tzlocal = ">2.0, <3.0" # https://github.com/regebro/tzlocal/blob/master/CHANGES.txt +tzlocal = ">=4.0" # https://github.com/regebro/tzlocal/blob/master/CHANGES.txt [tool.poetry.dev-dependencies] black = { version = ">=21.5b2", allow-prereleases = true } diff --git a/tests/bdd/features/config_file.feature b/tests/bdd/features/config_file.feature index d6b6121f..5cd3a6c5 100644 --- a/tests/bdd/features/config_file.feature +++ b/tests/bdd/features/config_file.feature @@ -107,6 +107,16 @@ Feature: Multiple journals When we run "jrnl --cf empty_file.yaml" Then the error output should contain "Unable to parse config file" + Scenario: Use a config file with linewrap set to 'auto' + Given we use the config "linewrap_auto.yaml" + When we run "jrnl -1" + Then the output should contain "Life is good." + + Scenario: Use a config file with linewrap set to 'auto' and use format 'fancy' + Given we use the config "linewrap_auto.yaml" + When we run "jrnl -1 --format fancy" + Then the output should contain "Life is good." + Scenario: Show a warning message when the config file contains duplicate keys at the same level Given the config "duplicate_keys.yaml" exists And we use the config "duplicate_keys.yaml" @@ -122,4 +132,4 @@ Feature: Multiple journals Scenario: Don't show a duplicate keys warning message when using --config-override on an existing value Given we use the config "multiple.yaml" 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" \ No newline at end of file + Then the output should not contain "There is at least one duplicate key in your configuration file" diff --git a/tests/bdd/features/datetime.feature b/tests/bdd/features/datetime.feature index 28d63169..e2b0fa76 100644 --- a/tests/bdd/features/datetime.feature +++ b/tests/bdd/features/datetime.feature @@ -175,7 +175,7 @@ Feature: Reading and writing to journal with custom date formats When we run "jrnl -1" Then we should get no error And the output should be - 2013-10-27 03:27 Some text. + 2013-10-27 04:27 Some text. @skip #1422 diff --git a/tests/data/configs/linewrap_auto.yaml b/tests/data/configs/linewrap_auto.yaml new file mode 100644 index 00000000..69188710 --- /dev/null +++ b/tests/data/configs/linewrap_auto.yaml @@ -0,0 +1,17 @@ +default_hour: 9 +default_minute: 0 +editor: "" +encrypt: false +highlight: true +journals: + default: features/journals/simple.journal +linewrap: auto +tagsymbols: "@" +template: false +timeformat: "%Y-%m-%d %H:%M" +indent_character: "|" +colors: + date: none + title: none + body: none + tags: none