Commit graph

54 commits

Author SHA1 Message Date
dependabot[bot]
a8f0b18219
Bump black from 21.12b0 to 22.1.0 (#1404)
* Bump black from 21.12b0 to 22.1.0

Bumps [black](https://github.com/psf/black) from 21.12b0 to 22.1.0.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
- [Commits](https://github.com/psf/black/commits/22.1.0)

---
updated-dependencies:
- dependency-name: black
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>

* Run make format

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2022-02-05 12:04:06 -08:00
Jonathan Wren
4aabb73847 Implement datetime handling in pytest-bdd
- This was awful and convoluted

Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2021-07-03 15:49:18 -07:00
Ben Beasley
a9c539821f
Remove useless shebangs and executable permissions (#1283)
* Remove executable permissions from non-script files

* Remove harmless-but-useless shebang lines
2021-07-03 15:20:52 -07:00
eshrh
8a78c34917
Support title splitting for fullwidth CJK terminals (#1163)
* Split by fullwidth terminals without spaces.
* Add test
* Update write.feature
2021-01-23 15:29:43 -08:00
Micah Jerome Ellison
9fe56b9e10
Comply with GPL by acknowledging all authors and including license info in each source file (#1121)
* 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
2020-12-19 22:28:22 -08:00
Felix Yan
9ee4c21f6b
Add Ellipsis to SENTENCE_SPLITTER (#1044)
Ellipsis is used to terminal sentences in Chinese and used a lot at end of title.
2020-09-11 12:56:46 -07:00
Jonathan Wren
631e08a557
Clean up help screen, get rid of util.py (#1027)
* 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>
2020-08-22 11:40:39 -07:00
Jonathan Wren
a11aa24c7e Allow editing of DayOne entries (#1001)
* 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>
2020-07-18 12:54:52 -07:00
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