Commit graph

364 commits

Author SHA1 Message Date
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
9664924096 Move all password handling to EncryptedJournal
This commit should greatly simplify all password handling logic. No passwords are stored in the config dict anymore. Only the Encrypted Journals have any password related logic. I also had to remove some password fields from the test files, which shows how dangerous the previous approach was. A slight code change could've leaked passwords to the config file. However, I had to change the install progress a little bit to make this work. It will now not ask you for a password right away but rather if you want to encrypt or not. Only if you reply 'y' will it ask you for the password later on.
2020-04-10 11:51:56 -07:00
Manuel Ebert
c8d59727eb Explicitly write Version to file
Delay import of asteval
Use __version__.py instead of VERSION.txt
2020-04-10 11:51:56 -07:00
Jims
b8d43db558 Added case-insensitive searching of entry title and body
added search test
Renamed searching to contains. Made changes as per pull-request:
https://github.com/jrnl-org/jrnl/pull/740
2020-04-10 11:51:56 -07:00
Peter Schmidbauer
8eb185f8a2 Add password confirmation dialog 2020-04-10 11:51:55 -07:00
Micah Jerome Ellison
24cd1d460b [GH-738] preventing readline usage on Windows - removes autocomplete on the install step for Windows users 2020-04-10 11:51:55 -07:00
Jonathan Wren
10d8a32b64 Squashed commit of the following:
commit 75113187432939a51486422c3f70b3a9e2bcf0aa
Merge: 74d1854 47e10fb
Author: Jonathan Wren <9453067+wren@users.noreply.github.com>
Date:   Thu Oct 24 17:02:10 2019 -0700

    Merge pull request #665 from notbalanced/issue_662

    Fixes Issue #662 - Day names not treated consistently for new entry

commit 74d1854a4bba468221b4eee254bdee2bb40f5d5a
Merge: 97e4d6a 6a5726a
Author: Jonathan Wren <9453067+wren@users.noreply.github.com>
Date:   Sat Oct 5 15:30:57 2019 -0700

    Merge pull request #418 from philipsd6/2.0-fancy_exporter

    Add exporter to output entries inside unicode box character boxes

commit 47e10fbee7
Author: Craig Moyer <craig.moyer@gmail.com>
Date:   Sun Sep 29 19:06:53 2019 -0400

    Fix issue #662 to properly handle day names as new entry dates and
    command line (-on, -from, -to).

commit 9588913100
Author: Craig Moyer <craig.moyer@gmail.com>
Date:   Sun Sep 29 08:27:27 2019 -0400

    Syncing with jrnl-org/master

commit 4c68eb193d
Merge: 81dfebb 97e4d6a
Author: Craig Moyer <craig.moyer@gmail.com>
Date:   Sun Sep 29 07:52:02 2019 -0400

    Merge remote-tracking branch 'upstream/master' into 2.0-rc1-maebert

commit 81dfebb2c0
Author: Manuel Ebert <manuel@1450.me>
Date:   Mon Apr 29 20:34:18 2019 +0200

    export changes

commit 6a5726acd2
Author: Philip Douglass <philip@philipdouglass.com>
Date:   Fri Dec 22 20:56:36 2017 -0500

    Enable FancyExporter plugin

commit 3d1b226871
Author: Philip Douglass <philip@philipdouglass.com>
Date:   Fri Jan 29 11:17:41 2016 -0500

    Add exporter to output entries inside unicode box character boxes
2020-04-10 11:51:55 -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
Peter Schmidbauer
e912827396 Fix crash when no keyring backend available 2020-04-10 11:51:55 -07:00
Peter Schmidbauer
7f46d1a40a Fix handling of little-endian date format
Ever since version 2.0, when parsing a journal file, jrnl would not use
the custom date format string anymore. Instead, it relied on the
dateutil library to get the parsing right. This change was made to allow
people to change their date format without having to manually change
their file. However, this broke some existing date formats like
%d.%m.%Y, as it would falsely interpret the month as day and vice versa.
This commit adds some tests to catch this error and fixes it by trying
to parse the dates using the custom format first, only falling back to
dateutil when needed.
2020-04-10 11:51:55 -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
MinchinWeb
c863659916 [Upgrade to 2.0] Expand User directory (#704) 2020-04-10 11:51:55 -07:00
Jonathan Wren
8c0c95d1f6 Poetry updates
update version and author emails
update makefile to use poetry for more things
remove faulty conditional
2020-04-10 11:51:55 -07:00
Manuel Ebert
a61658d453 Add Poetry config
Add deployment through poetry to travis
2020-04-10 11:51:55 -07:00
Justin Proffitt
c249c8ded9 Add '-not' flag for excluding tags from filter
Add tests for the excluding tags with -not
2020-04-10 11:51:55 -07:00
Dawid Zych
bd806efb98 Handle KeyboardInterrupt when installing journal 2020-04-10 11:51:55 -07:00
MinchinWeb
e14910c83f Switch to hashmark Markdown headers on export
Closes #487
[Markdown Export] deal with linebreaks in jrnl files
[YAML Exporter] apply fix just applied to Markdown Exporter
2020-04-10 11:51:55 -07:00
Micah Jerome Ellison
8abbdf4db5 [GH-632] confirming that each journal can be parsed during upgrade, and aborting upgrade if not
[GH-632] raising exception in upgrade.py on fail
Handling it in install.py to prevent config from being overwritten when upgrade fails
[GH-632] removing unnecessary whitespace
[GH-632] removing unreachable return statement
[GH-632] adding call to action to report issue when upgrade fails
2020-04-10 11:51:55 -07:00
Greg Bodnar
623fa6c307 Create encrypted journal
Add failing test for configuring an encrypted journal
Overload open for EncryptedJournal

This avoids the execution path that calls EncryptedJournal._create()
without a password parameter. It results in duplication of code that
requests and stores a password, which should be factored out in a
subsequent change.

Modify test to test for returned strings

The entered string for the password is not being used by the test and I
don't understand why.

Use util wrapper for getpass

This allows for tests to run without prompting for user input.
2020-04-10 11:51:55 -07:00
Jonathan Wren
b260ff35b9 #631 Escape data in square brackets 2020-04-10 11:51:55 -07:00
Jonathan Wren
b84f862253 fix a few linting errors 2020-04-10 11:51:55 -07:00
Micah Jerome Ellison
3a72313d06 Updating Python version and jrnl version for v2.0-rc3 2020-04-10 11:51:55 -07:00
Micah Jerome Ellison
f37f82f782 [GH-614] resolving issues around unreadable dates and unparsed dates 2020-04-10 11:51:55 -07:00
Micah Jerome Ellison
ccf0b7e039 #6 allowing template interpreter to interpret common Python commands 2020-04-10 11:51:55 -07:00
Jonathan Wren
13631b9a68 Fix issue #584 YAMLLoadWarning (#585) 2020-04-10 11:51:55 -07:00
hoclun-rigsep
6826f07b6e Use shlex to parse editor commandline as per 2.0-rc1 (#556) 2018-08-16 15:16:29 -07:00
Radomír Bosák
8fe8e00e1b Catch keyboard interrupt when opening journal (#476)
If the journal is encrypted, jrnl asks for a password using the
getpass.getpass function. If user presses the keyboard interrupt (e.g.
ctrl+c) during the password prompt, jrnl crashes and prints a stack
trace. This however is not very user friendly.

This commit adds a check for KeyboardInterrupt Exception and prints a
message whenever this exception occurs and exits. Stack is no longer
printed.

Fixes #450
2017-03-10 08:54:02 -08:00
Radomír Bosák
ca2d9f072f Fix python2 error in template_explorer.py (#471)
If template_explorer.py was imported in python2, it would fail because
it uses unicode_literals which would ultimately cause passing an unicode
string as the first argument to the 'type' built-in function.

This commit fixes this by converting the unicode to string before it is
passed to the 'type' function.

Fixes #456
2017-03-09 11:59:03 -08:00
Manuel Ebert
60a955de20 Template exporting FTW 2016-08-19 23:20:31 +00:00
Manuel Ebert
f4dfecb62f Fix JSON export 2016-08-19 21:44:12 +00:00
Manuel Ebert
6a53da5efd Indent character optional 2016-08-19 21:44:01 +00:00
Manuel Ebert
bdc9dc598d Fix Keyring tests 2016-08-19 21:43:27 +00:00
Manuel Ebert
69fc08f6f3 Upgrade to cryptography 1.4 2016-08-17 13:41:54 +00:00
Manuel Ebert
85934c1980 Exports 2016-07-17 13:35:35 -07:00
Philip Douglass
ba05411a80 User defined indent character (#419)
Make indent character configurable.
2016-04-15 23:00:49 -07:00
Manuel Ebert
dbf912c661 Merge pull request #417 from philipsd6/2.0-strip_entry_body
Fully strip title and body after SENTENCE_SPLITTER search
2016-04-07 13:15:12 -07:00
Philip Douglass
b2147d53c5 Fully strip title and body after SENTENCE_SPLITTER search 2016-04-07 14:31:16 -04:00
Philip Douglass
eec009fd18 Clean up text wrapping once and for all 2016-04-07 14:29:28 -04:00
Philip Douglass
04082d36c9 Open config_path as utf-8 2016-01-24 21:16:50 -05:00
Philip Douglass
9f7d71aa8f Expand vars and user tilde for upgrade backup 2016-01-24 21:09:17 -05:00
Manuel Ebert
44e243a629 Byte encoding for getpass
Fixes #392 and #393
2016-01-11 12:08:05 -08:00
Manuel Ebert
87aeb17b2c Unicode literals in util 2015-12-28 22:07:26 -08:00
Manuel Ebert
c2ca11caa7 Drop whitespace in print
Fixes #222 and #376
2015-12-28 21:53:23 -08:00
flight16
28d87861cc Merged PR 2015-12-28 21:36:17 -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
849dc89557 --export text doesn't indent
Fixes #373
2015-12-28 13:06:26 -08:00
Manuel Ebert
b2542db5e5 Fix XML export 2015-12-28 13:01:33 -08:00
Manuel Ebert
7c6b2e4bce Support for templates 2015-07-01 22:23:13 -07:00
MinchinWeb
a4496518de [CLI] display instructions to enter an entry on the command line when no editor is set 2015-05-05 15:30:18 -06:00