Commit graph

46 commits

Author SHA1 Message Date
MinchinWeb
cfadcd39ca Apply isort Mk II (#942)
* Apply isort!
2020-05-09 13:14:43 -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
MinchinWeb
cec0beff9a Listing all entries in DayOne Classic journal throws IndexError (#786)
* Reproduce bug in #780
🎵 I have no body, no body to love me... 🎵
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...
2020-04-10 11:51:56 -07:00
MinchinWeb
04f6154c93 Apply black formatter to code
[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
2020-04-10 11:51:56 -07:00
Jonathan Wren
46c4c88231 (#770) run black formatter on codebase for standardization 2020-04-10 11:51:56 -07:00
Peter Schmidbauer
9d8d6a83ae remove py2 remnants and use mocks in tests
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
2020-04-10 11:51:55 -07:00
Manuel Ebert
6a53da5efd Indent character optional 2016-08-19 21:44:01 +00:00
Philip Douglass
ba05411a80 User defined indent character (#419)
Make indent character configurable.
2016-04-15 23:00:49 -07:00
Philip Douglass
eec009fd18 Clean up text wrapping once and for all 2016-04-07 14:29:28 -04:00
Manuel Ebert
c2ca11caa7 Drop whitespace in print
Fixes #222 and #376
2015-12-28 21:53:23 -08:00
Manuel Ebert
95d399d5c3 Seperation of title and entry is now purely virtual.
Fixes #360
2015-12-28 21:24:39 -08:00
Manuel Ebert
b2542db5e5 Fix XML export 2015-12-28 13:01:33 -08:00
Manuel Ebert
57007a8266 Cuddle timestamp in brackets to fix #318 2015-04-05 02:22:49 +04:00
Gregory Crosswhite
6258465f5d Added support for importing entries. 2014-10-24 15:21:10 -07:00
Manuel Ebert
bf1048729c Cleans up entry 2014-09-12 14:22:15 -07:00
Manuel Ebert
4301927b72 Use unicode literals
Fixes #273
2014-09-02 13:26:50 -07:00
Kurt Neufeld
2f1894c765 using a common tag regex for searching and highlighting 2014-08-30 10:02:59 -06:00
Manuel Ebert
db3de3d1cc Tags at the beginning of lines 2014-08-07 13:25:50 +02:00
Matt Hoffman
d5142a0a0a There should be a whitespace character in front of a tag. Fixes issue #237. 2014-07-22 22:14:26 -04:00
B Krishna Chaitanya
add0aea46d Unescaped -, + and * in regex 2014-06-30 14:38:00 +05:30
B Krishna Chaitanya
ef0e192d79 Include [-+/*#] in tag characters 2014-06-27 21:12:42 +05:30
B Krishna Chaitanya
af222fd526 Changed regex to accept symbols 2014-06-27 11:58:59 +05:30
Manuel Ebert
6a5a98919e Fixes writing new lines between entries 2014-03-31 12:37:37 -07:00
Manuel Ebert
7ab969dcfb Fixes white spaces at the beginning of lines, fixes #134 2014-03-24 10:48:51 -07:00
William Minchin
545d2c296a Fix linewrap
If a line was exactly the length of `linewrap`, the extra space was
causing the next line to be blank. But if the line is empty, we need the
space to maintain the `| ` sidebar.
2014-02-07 08:24:30 -07:00
William Minchin
8c461c7f9c Don't replace all double spaces
want to maintain the ability to format with the use of just text.
2014-02-07 08:21:28 -07:00
Manuel Ebert
0e637d26d0 DayOne support for --edit 2013-12-21 15:00:26 +01:00
Manuel Ebert
e4bc0794f1 Modified flag for entries 2013-12-20 16:16:48 +01:00
Manuel Ebert
1e9fe2cf1e -short becomes --short 2013-11-04 00:36:10 -08:00
Manuel Ebert
31e64ff6a0 "Starred" in json export 2013-11-03 20:02:28 -08:00
Manuel Ebert
82336ffe75 Starring entries and looking at the stars 2013-11-03 20:02:18 -08:00
Manuel Ebert
4e36d7baf0 Python 2.6 compatibility 2013-08-28 13:48:18 -07:00
Manuel Ebert
db11803791 Tagging fixes 2013-07-23 21:01:57 -07:00
Manuel Ebert
29005c0e07 Better Python2.6 compatibility 2013-07-19 13:03:27 +02:00
Manuel Ebert
4d681ca095 Fixes bug in tag export 2013-07-17 18:13:51 +02:00
Manuel Ebert
20fb701a1a Addresses unicode issues in Python 3
Fixes #79
2013-06-24 15:54:04 +02:00
Manuel Ebert
9852f227b7 Better Unicode support
Closes #72
2013-06-09 15:55:03 -07:00
Manuel Ebert
f14c7c4d5f Fixes issue where now date was given 2013-03-04 14:44:04 -08:00
Stephan Gabler
d5aa29f844 remove the leading whitespace introduced by textwrap 2012-07-17 12:12:47 +02:00
Manuel Ebert
a4e6831548 Strips blank lines at the end of Entry bodies when prettyprinting. 2012-05-31 11:37:02 +02:00
Manuel Ebert
7a8b847bd7 Suppress empty bodies in prettyprinting 2012-05-31 11:33:28 +02:00
Manuel Ebert
fea171170a Refactors prettyprinting into the pprint method, __str__ will only produce journal-file-ready strings again. 2012-05-31 11:22:34 +02:00
Manuel Ebert
d5b6d559c3 New style display of posts 2012-05-30 18:12:10 +02:00
Manuel Ebert
8a28afc7bd Using string.format instead of % 2012-05-30 17:50:37 +02:00
Manuel Ebert
7ae9f2bed2 Adds word wrap support. 2012-05-30 17:43:55 +02:00
Manuel Ebert
dfa8278cb5 Experimental new directory structure 2012-05-24 13:23:46 +02:00