* behavior outline
* enforce positive initial linewrap
Check column widths
update gitignore
throw error when linewrap too small
simply check for large enough linewrap value
* delete unused error message
* PR feedback
make exception more informative
update check_linewrap signature in src and test
make check_linewrap a free function
* delete unused function
* delete else..pass block
* newline for make format
Add --config-override feature
* add test and argument handler for runtime override of configurations.
* identify location to apply override in "main"
* update gitignore
* remove unneeded import
* add jrnl interface test for overriden configurations
* trivial whitespace change
* implement runtime override
* make format
* refactor override unittest
* clean up unused import
* start writing integration test
* add linewrap override scenario
* implement editor override step
* add dev dependencies on pytest -mock and -cov
* make format
* remove unused imports
* make format
* rename --override to --config-override
* move override implementation into own module
* begin TDD of dot notated overrides
* rewrite behavior scenario
* implement recursive config overrides
* clean up unittests
* iterate on behave step
* make format
* cleanup
* move override behave tests out of core
* refactor recursive code
* make format
* code cleanup
* remove unused import
* update test config
* rewrite test for better mock call expect
* make format
* binary search misbehaving windows test
* unittest multiple overrides
* uncomment dot notation unittest
* add multiple override scenario spec
* make format
* make format
* update unittests for new syntax
* update integ tests for new syntax
* update gitignore
* guard override application
* deserialize function as return type
* make format
* organize deserialization unittests
* better, more specific behave tests
* test different editor launch commands
* formatting
* handle datatypes in deserialization and update helptext
* stick to config convention in testbed
* update tests ith better verifications
* make format
* space
* review feedbac
* make format
* skip on win
* update deps
* update tests with better verifications
make format
space
review feedbac
* skip on win
* update deps
* refactor deserialization
organize test_parse_args
make format
* skip on win
* refactor deserialization
organize test_parse_args
make format
* update tests ith better verifications
* make format
* space
* make format
* document apply_overrides
* update gitignore
* document config-override enhancement
* Simplify config override syntax (#5)
* update tests and expected behavior
* clean up arg parsing tests
* update deserialization
* update deserialization
* config argparse action
* update override application logic
* update tests; delete unused imports
* override param must be list
* update docstring
* update test input to SUT
* update remaining override unittests
* make format
* forgot to update CLI syntax
* update documentation to sphinx style
* variable renames
* Lockfile merge (#7)
* Add brew and gitter badges to README
* Update changelog [ci skip]
* Make journal selection behavior more consistent when there's a colon with no date (#1164)
* Simplify config override syntax (#8)
* update tests and expected behavior
* clean up arg parsing tests
* update deserialization
* update deserialization
* config argparse action
* update override application logic
* update tests; delete unused imports
* override param must be list
* update docstring
* update test input to SUT
* update remaining override unittests
* make format
* forgot to update CLI syntax
* formatting
* Update pyproject.toml
* update lockfile to remove pytest-cov and pytest-mock deps
* update docs
* reuse existing mock; delete unneeded code
* move overrides earlier in the execution
use existing configs instead of custom
make format
clean up imports
* update for passworded access
context.parser -> parsed_args
* test that no editor is launched
* remove unnecessary mocks
* rename variable for intent
* reinstate getpass deletion
* update gitignore
* capture failure mode
* remove unneeded imports
* renamed variable
* delete redundant step
* comment on step
* clean up step behavior description
* [WIP] lock down journal access behavior
* skip -> wip
* correct command for overriding journal via dot keys
* update wip test for updating a "temp" journal and then reading baack its entries
* remove "mock" from poetry file
* make CI happy
* complex behavior sequence for default journal override
* separate out smaller pieces of logic
test that apply_overrides acts on base configuration and not the copy
* defer modification of loaded configuration to update_config
remove unused fixtures
delete complicated UT since behavior is covered in overrides.feature integ test
delete redundant UT
* Update .gitignore
* remove skip_win
* forward override unpacking to yaml library
* merge config override step with existing config_var step in core
delete config_override step
unify step description syntax
* delete unused and redundant code
* rebases are hard
* remove wip tag from test
* remove skipped tests for windows
* Address code review
yield -> return
remove needless copy
adjust spacing
re-inline args return
reset packaging info to e6c0a16342
revert package version for this PR
* consolidate imports
* Defer config_override unpacking to dict *after* base config is loaded
store cli overrides without unpacking just yet
move deserialize_config_args to config module
delete custom Action class for config operations
apply [k,v] -> {k, v} for each override
update test data
update import
* rename deserialize_config_args to better express intent
make format
* Fix inverted POSIX check, refactor os_compat, and add tests for it
* Fix missing parentheses and remove skip_win on test that is passing in Windows now
* Fix expected quotes in quoted args
* Make output clearer on failing test
* Bringing skip_win back to test whose failure is a bit more complicated than expected
* Introduce -reminisce, -month, -day, and -year
* Update expected_args in parse_args tests
* Add check before creating compare_d
* Misc changes
* Implement testing for -month, -day, -year, and -reminisce
* Compress tests into one Scenario Outline
* Fix failing tests by updating dates_similar journal
* Create 'we set current date and time to' step
* Use time.parse in reminisce
* Update dates_similar journal
* Make 'Searching in a journal' test shorter
* Lint
* Implement reminiscing test
* Add combination tests
* Finalize tests
* Finalize pytests
* Simplify reminisce tests
* Change reminsice help (since it also shows today's entries)
* Re-do tests; use various tests
* Remove old test data
* Better scenario description
* Standardize format for compare_d
* Rename -reminisce to -today-in-history
* Moving configuration values and methods from install.py to config.py -- everything is broken right now
* Using context to store config path - still lots broken
* Use mocks and context.config_path to store test configs - many tests still broken though
* Update changelog [ci skip]
* Fix jrnl --ls crash
* Fix crash when no editor configured
* Attempt to patch config path with test data - doesn't appear to be working
* Properly use patched config path and add config given to scenario that wasn't using it
* Fix copypasta
* Fix editor test that needed patched config and trapping for system exit
* Add exception and handling for when configuration directory is actually a file
* Remove extraneous comment
* Use more generic JrnlError with messaging switchboard
* Format code a bit nicer
* Remove unnecessary given in diagnostic test
* Ensure full error message is output
* Remove unnecessary whitespace characters
* Create tests and steps for temporary filename suffix
* Have temporary filename suffix be -{template_filename} or .jrnl
* Finalize extension_editor_file
* Make suffix local variable in get_text_from_editor
* Update authors to "jrnl contributors" to comply with GPL3
* Include jrnl email address with contributors
* Include GPL notice in jrnl --version
* Apply consistent copyright and license to all Python files
* Add copyright and license to documentation
* Add copyright and license to docs theme
* Wiping poetry cache to try to resolve a test issue
* Testing with Python 3.9.0 in attempt to bypass GitHub Actions failure in 3.9.1
* make format
* Exclude Windows Python 3.9 build which is failing due to a GitHub Actions problem
* Modify testing to get around this 3.9 issue...
* Fix exclude
* Update version pin on pyxdg and run poetry update
* Update pytest pin and rerun poetry update
* Update black pin to latest version, poetry update, and make format
* make behave slightly less verbose for use with behave --format progress2
* standardize behave tests
* move tests around to be more behavior driven
* clean up txt file after tests
* add more tests, add more functionality to behave for calling mock editor
* move around behave tests, get rid of regression files
* clean up some code around keyrings
* add more placeholder test scenarios (marked with @todo)
You can run just these tests with `behave --no-skipped --tags=todo`
* fix "missing_directory" test
This test was missing the config file it was trying to use. So, it was
really a very useless, broken test that we absolutely should not have
approved the PR (#963) for.
* add write tests for each journal type
* update version tests, add new regex match behave step
* add config test outlines
* add journal types to some search tests
* change "basic" config reference to "simple"
* update configs
* add more journal types in search
* fix basic folder journal reference
* add flush output steps to behave, update delete flag tests
* fix failing test with a flush
* update more delete flag tests to include other journal types
* fix file cleanup after failed test with no debug on
* fix password test
* fix DayOne tag sample data, move search/format tag tests, and run them on multiple jrnl types
* added ability to auto-prompt for password for encrypted journals
Only uses password when prompted, and doesn't get in the way of other
input prompts. This allows us to run the same scenarios on both
encrypted journals and other journal types.
* fold encrypted scenarios into the rest of the scenarios where possible
* remove apostrophe that is breaking tests on CI
* add more journal type tests to import feature
* standardize whitespace in behave tests, take out duplicate test
* update handling of cache directories in test suite (easier syntax)
* skip failing YAML exporter emoji test on Windows
* added @todo tags for things that need follow-up
Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
* More refactoring of cli.py
break up code from cli.py (now in jrnl.py) up into smaller functions
get rid of export mode
move --encrypt and --decrypt to commands.py
clean up the help screen even more
update flag name for import
* reorganize code, move around lots of functions
* clean up import statements
* move run function out of cli and into jrnl
* rename confusingly named function
* move editor function into editor file
* rename parse_args.py to args.py to make room for more args functions
* Fix error in test suite for windows
I accidentally flipped the conditional, so this fixes it.
Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
* Update app description on help screen
Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
* add test to repro issue #955
* Allow editing of DayOne entries
* Add broken test for Dayone
Add test for editing Dayone entries (this test currently fails)
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
* Fix editing logic for DayOneJournal
DayOneJournal previously reimplemented Journal._parse inside of
DayOneJournal.parse_editable_string, and in doing so caused issues
between itself and the class it was inheriting from. This commit fixes
the issue by moving the UUID to be in the body of the entry, rather than
above it. So, then Journal._parse still finds the correct boundaries
between entries, and DayOneJournal then parses the UUID afterward.
Co-authored-by: MinchinWeb <w_minchin@hotmail.com>
Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
* Add Python version check and faulty test to confirm it's working (should fail on 3.6 build only)
* Apply formatting
* Fix behave Python version test
* Make error message more descriptive and friendly
* Updating changelog [ci skip]
* Incrementing version to v2.4 [ci skip]
* [DayOne] remove extra spaces from the titles of edited DayOne entries
Otherwise, a leading space was being introduced
* [DayOne] maintain existing tags stored in DayOne metadata
* [DayOne] brings back extended DayOne attributes
* [DayOne] maintain metadata on edited entries
Fixes#358, See also #159
* [DayOne Exporter] apply black formatting
* [JSON Exporter] add support for extended DayOne Metadata
* [DayOne] [Tests] test that extended DayOne metadata is added to new entries
Co-authored-by: Jrnl Bot <jrnl.bot@gmail.com>
* Fix editor config when an argument with a space is used
* skip broken test on windows
* fix jrnl not behaving nicely with testing suite
* fix argument parsing for test suite
* fix one windows test, disable one windows test
This adds the ability to run commands in a cache directory without the
test writer knowing where the cache directory is located. This will let
us expand later if we want to start using system temp folders, without
having to rewrite any of our tests.
* clean up extra directories after running behave
* clean up white space issues
* move repeated code into function
* clean up behave code for creating cache directories
* Fix for windows shell parsing in our test suite
Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
* Prevent filtered deletion from deleting entire journal #932 and add lots of deletion tests
* Undo removal of deletion feature
* Use more performant deletion
* [Markdown Exporter] [YAML Exporter] Ensure exported entires end in a newline
Fixes#768, Fixes#881.
If the exported entry does not have a final empty line, this will add one on export. Some Markdown parsers get picky about not having a empty line above a heading....
* fix black formatting issues
* explicitly sort filenames
to deal with inconsistent default file ordering on different OS's
* Update .gitignore
* Update test for typo fix
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
* [Tests] makes sure `--version` works
Directly reads the version number from pyproject.toml
* Tag the tests
To run just this test, use `behave --tags=deployments_tests`
* Pretty print journal entry titles and dates.
Changes appearance of all jrnl viewing commands, such as $ jrnl --short and
$ jrnl -n {NUM}.
Fix#508
* Removed extra newline at end of title
* Use ansiwrap to properly wrap strings with ANSI escapes
* Add ansiwrap to pyproject.toml
* Allow configuration of colors
- Replaced raw escapes with colorama
- Added colors key to config
- Add checks for validity of color values
* Add color configuration documentation
* Fix broken tests due to config change
* Add tests for colors in configs
- Identifying invalid color configs
- Upgrading config from no colors -> colors
* Add colorama dependency for all platforms
* Allow users to disable colorization of output
* Update poetry.lock
* Add tag and body color customization options
* Fix colorization of tags in title and body
* Updated tests to use no color by default
* Change pass to continue in verify_config()
* Better style in Entry.py
* Reduce code duplication for tag highlighting
- Breaks "unreadable date" regression test for unknown reason
* Properly colorize tags and print body
* Reformatting and clean up
* Replace list comprehension with generator
* Handle invalid colors by not using a color
* Process ANSI escapes properly with behave
* Fixed the 'spaces after tags directly next to punctuation' bug
Broke processing of tags next to any punctuation at all
* Closer to working tag colorization but not perfect
* Add tests printing for multiline journals
Fix#717
* Correctly indent first line of multiline entry
* Add test for multiline entries with tags
* Remove redundant UNICODE flag
* Progress towards proper tag colorization and body formatting
* Fix newline colorization bug
Debug code left intact since there are more bugs to fix :/
* And now the space just ends up before the tag instead of after it
* Fix assertion syntax warning
* Moved tag test to tagging.feature file
* Strip out debug code and clean up
* Bold datetimes in title
* Bold all titles
Fix#720
* Remove PY2 and PY3 constants
* Fix regression in features/steps/core.py
* Fix tag_regex
* Remove redundant re.UNICODE flag
* Remove extraneous code
Update FolderJournal reference to entry __unicode__ method to __str__
Remove DayOne test made obsolete by FolderJournal
Fix FolderJournal path tests for Windows paths
Apply Black linting
Adds feature for issue #170 (and #398) where you configure your journal to
be a directory and entries are added as sub-directories and files:
yyyy/mm/dd.txt. Multiple entries in a day will go in the same file, but a
new entry for a specific day will create a new file (and directory
structure).
Fix failed test scenarios for folder journal.
[Travis] add a linting stage (via `black`)
[Travis] update as per code review
Remove "Lint" as separate stage; have `black` check the output rather
than run the re-formmater
See #739 (Python 3.8), #619 (Windows)
Appease the Travis gods
[Travis] no auto-ruby
[Travis] include a test in not UTC
see #742
[Travis] Add Python to PATH on Windows
[Travis] Windows: try Python 3.7 for cryptography wheels?
[Travis] Windows tests time out
Add test for aborting jrnl entry from editor
Use native mocking
Add comment explaining discrepancy between expected and asserted output
Fix check_empty_output method
Check message on stderr and patch subprocess.call
Add _mock_editor_function
Update features/steps/core.py
Add return from mock function
Add debug statements
Debug
Update features/steps/core.py
Move sys.exit() down
Fix test?
Fix test?
Fix test?
Clean up debug statements
Clean up debug statements
Remove extraneous code
Remove extra space
Add test for empty stdin input
Remove extra debug line
Fix test?
Fix test?
Update features/core.feature
Fix test?
Fix no stdin input test
Co-Authored-By: pspeter <peter.schmidb@gmail.com>
fstring wip
Run pyupgrade
fix broken pyupgrade fstring
run pyupgrade on plugin dir
fixup! remove py2 remnants and use mocks in tests
small print bugfix
The file=sys.stderr was part of the format(), so an error got printed to
stdout
Drop use of codecs package
Use builtins.open() instead
fixup! remove py2 remnants and use mocks in tests