Commit graph

32 commits

Author SHA1 Message Date
Jonathan Wren
a54ed90259 Move import to be standalone command to reduce clutter in cli.py 2020-08-01 15:54:13 -07:00
Micah Jerome Ellison
4ca6e3f95f Display warning if Python version is less than 3.7 (#994)
* 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
2020-07-12 16:24:46 -07:00
Micah Jerome Ellison
28093894ad Add diagnostic argument #727 (#984) 2020-06-20 11:18:53 -07:00
eshrh
2a3fd820b9 Create journal with absolute path when no path is specified (#972)
* create jrnl with abspath

Co-authored-by: = <esrh@netc.eu>
2020-06-13 11:08:22 -07:00
Eshan
74724b2185 Create directory if it doesn't exist (#963)
* create dir if it doesn't exist
* switch order of print and creation
* makedirs instead of mkdir and stderr printing
* add test
* black reformatting
2020-06-06 12:46:06 -07:00
Jonathan Wren
7c7e2fae82 Fix for hanging Windows tests on Travis (#969) 2020-05-27 18:22:09 -07:00
Eshan
b575174a60 Fix title splitting logic to account for both newlines and periods (#958)
* remove period parsing in title
* fix title splitter
* revert title-body switch
* keep both splitting types
* make black happy
* make it lstrip not strip
* fix title-body order for the last time
* make black happy again
* added test
* second test for single line entry with punctuation
* delete extra blank lines
2020-05-27 14:14:39 -07:00
Jonathan Wren
a4d020423f Fix editor config when an argument with a space is used (#953)
* 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
2020-05-23 15:56:31 -07:00
dbxnr
15429d4f61 Interactive delete (#850)
* fixup alichtman's implementation
* cleanup imports

Co-authored-by: Aaron Lichtman <aaronlichtman@gmail.com>
Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2020-04-10 16:18:34 -07:00
Aaron Lichtman
f4fca3e5a4 Add --delete for interactive removal of entries (#698)
* Add --delete for interactive removal of entries
* Add inquirer dependency for fancy prompting
* Fix some minor style issues
* Fix #434 
* Use PyInquirer instead of inquirer for Windows compatibility
* Add WIP (broken) test
* Change deletion interface to be more basic
* Update environment.py

Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2020-04-10 16:18:34 -07:00
Jonathan Wren
302d353c4d Fix up tests and related issues
Upgrade poetry if already installed
Get rid of test function that was causing windows problems
2020-04-10 11:51:56 -07:00
Aaron Lichtman
9e5d160bbd Pretty print journal entries (#692)
* 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
2020-04-10 11:51:56 -07:00
Micah Jerome Ellison
32bd4a2b71 Restore emoji test now that it works in Windows Travis builds 2020-04-10 11:51:56 -07:00
Micah Jerome Ellison
a3a161376e Keep skip_win directive for empty entry test that still stalls on Travis 2020-04-10 11:51:56 -07:00
Micah Jerome Ellison
923e0c25d5 Remove all skip_win directives now that Travis is not mangling newlines on Windows 2020-04-10 11:51:56 -07:00
Jonathan Wren
5f31e1ab39 remove broken test (windows can't handle emoji) 2020-04-10 11:51:56 -07:00
Jonathan Wren
4086573f9d [#766] Skip another broken windows test 2020-04-10 11:51:56 -07:00
Jonathan Wren
da55914ec3 [#766] Skip the broken test on windows for now 2020-04-10 11:51:56 -07:00
Aaron Lichtman
1fd1fcc00d Exit jrnl if no text entered into editor
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>
2020-04-10 11:51:55 -07:00
Manuel Ebert
22ae53407e Split tests 2015-04-20 14:13:34 +02:00
flight16
a212e86503 Fix breaking test submitted in ebee196444. 2015-04-13 23:23:54 +09:00
flight16
ebee196444 Add single letter alias -s for option --short
--short was being used in a test for date logic, but I added a second
test for explicitness.
2015-04-13 09:08:43 +09:00
Manuel Ebert
c508e0c574 Update all tests to new time format 2015-04-05 03:25:39 +04:00
Manuel Ebert
e75e3d73a0 Converts tests to YAML 2014-09-12 15:28:12 -07:00
Manuel Ebert
60c03d96d6 Fixes config tests 2014-09-12 14:22:45 -07:00
Manuel Ebert
1822f50c70 Tests for date parsing and -on 2014-07-21 13:30:36 +09:00
Manuel Ebert
bf9adeb28a Tests for new structure 2013-11-29 10:23:16 -08:00
Manuel Ebert
279547c350 Tests for using stderr prompts 2013-07-22 12:04:32 +02:00
Manuel Ebert
13f8e668dc Mock stdin 2013-07-19 12:44:39 +02:00
Manuel Ebert
cb9beac711 Emoji support 2013-07-19 11:46:02 +02:00
Manuel Ebert
af16165159 Tests for writing entries from the command line 2013-07-19 11:36:39 +02:00
Manuel Ebert
47c90b6d40 Core testing 2013-07-18 22:49:22 +02:00