Commit graph

55 commits

Author SHA1 Message Date
Micah Jerome Ellison
c5729420a4
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 14:53:15 -08:00
Micah Jerome Ellison
48cde1b473
Check for readline module instead of Windows when initializing autocomplete in install (#1104) 2020-12-04 15:13:38 -08:00
Micah Jerome Ellison
c38c39efee
Update dependencies - pyxdg, pytest, black (#1076)
* 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
2020-11-14 12:42:34 -08: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
a54ed90259 Move import to be standalone command to reduce clutter in cli.py 2020-08-01 15:54:13 -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
wotgl
63df95f2ea Speed up jrnl by 10%, improve slow imports (#959)
* Improve slow imports
* Fix codestyle
* fix twice version validation
* Fix a syntax mistake
2020-05-27 14:11:40 -07:00
MinchinWeb
cfadcd39ca Apply isort Mk II (#942)
* Apply isort!
2020-05-09 13:14:43 -07:00
Jonathan Wren
e3a46e9846 fix various small issues in the codebase 2020-04-18 12:35:46 -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
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
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
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
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
Dawid Zych
bd806efb98 Handle KeyboardInterrupt when installing journal 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
Philip Douglass
ba05411a80 User defined indent character (#419)
Make indent character configurable.
2016-04-15 23:00:49 -07:00
Manuel Ebert
7c6b2e4bce Support for templates 2015-07-01 22:23:13 -07:00
Manuel Ebert
a5f08e6081 Introduce legacy classes 2015-04-05 07:25:22 +10:00
Manuel Ebert
df82ad1f4d Properly initialise journal files after creating them 2015-04-04 18:58:33 +11:00
Manuel Ebert
cc85d905ca Return config after install
Fixes #297
2015-04-04 18:47:09 +11:00
Manuel Ebert
c0ec95679b Make backup of config when upgrading
Fixes #307
2015-04-04 18:36:34 +11:00
Manuel Ebert
2615070df0 Hardcoded salt to fix crypto 2015-04-04 17:50:44 +11:00
Pablo Carranza
640d426b71 Added basic logging feature to understand how is configuration loaded
Conflicts:

	jrnl/cli.py
	jrnl/util.py
2014-11-09 15:55:52 -05:00
Manuel Ebert
a1b5a4099e Work on cryptography 2014-09-27 13:15:46 -07:00
Manuel Ebert
0a19701ae9 Use 'version' in configs 2014-09-12 15:27:48 -07:00
Manuel Ebert
51a6ac2d51 Upgrade scaffolding 2014-09-12 14:28:03 -07:00
Manuel Ebert
abeaa28d13 Fix config writing for python 3 2014-09-12 14:22:45 -07:00
Manuel Ebert
63ad45db75 YAML configs
See #184, #230, #197
2014-09-12 14:22:30 -07:00
Matthias Vogelgesang
afae3d16a7 Use PyXDG to save config and journal in XDG dirs
This change also hides the CONFIG_PATH state information entirely within
the install module. Therefore, the cli module does not have to care about
checking existence of files and paths.
2014-09-12 14:20:05 -07:00
Matthias Vogelgesang
fca3d131bd Require config arguments 2014-09-12 14:18:52 -07:00
Matthias Vogelgesang
4f73660231 Try $VISUAL and $EDITOR for config['editor']
On UNIX derivates they expand to the default or preferred editor and avoid
unnecessary first time edits of the config file.
2014-06-24 22:52:04 +02:00
Patrice Peterson
6f5b3f52f3 Allow use of environment variables in config paths
This patch simply adds several calls to `os.expandvars` to functions
that parse paths in the config file.
2014-06-23 16:12:41 +02:00
Manuel Ebert
02a2ecbf97 Create path to journal during installation
Fixes #152
2014-04-10 15:57:24 -04:00
Manuel Ebert
d35502423a Cleaned up imports to work with Python2.6 and Python 3.3 2014-01-23 14:33:14 +01:00
Manuel Ebert
9d352b4bad Gets rid of colorama 2014-01-02 23:41:53 +01:00
William Minchin
34acf9002f Set default linewrap to 79 globally 2013-11-27 12:52:56 -07:00
William Minchin
79a8b59e6f Windows: wraps lines at 79 chars by default
trying to wrap lines at 80 char in Windows' CMD results in blank lines
following lines that are exactly 80 char long
2013-11-27 10:25:17 -07:00
Manuel Ebert
fb629266e6 ixed a bug that caused creating encrypted journals to fail 2013-11-20 16:55:41 -08:00
Manuel Ebert
a96435b6dc Disambiguates jrnl.update_config and install.update_config 2013-10-17 16:00:27 -07:00
Manuel Ebert
34b730a5c9 Saves password to keyring
Closes #96 and deprecates password field in config
2013-10-17 14:55:59 -07:00
Aniket Pant
d4a97f873c Update installation after removal of default folder config
Signed-off-by: Aniket Pant <me@aniketpant.com>
2013-06-26 13:09:22 +05:30
Aniket Pant
7e1b5316aa Add default export folder config
Signed-off-by: Aniket Pant <me@aniketpant.com>
2013-06-21 19:20:57 +05:30
Manuel Ebert
634d84c77e Fixes for Python 3 Support 2013-04-19 15:19:21 +02:00
Manuel Ebert
3052e0cce7 Python 3 compatibility 2013-04-19 14:46:05 +02:00
Manuel Ebert
65b4d5ffa0 Fixes install routine 2013-04-17 12:02:26 +02:00
Manuel Ebert
e0f7d235b1 Uses colorama instead of clint 2013-04-17 10:19:02 +02:00
Manuel Ebert
c26ed24389 Better support for individual configs 2012-07-23 13:09:45 +02:00