mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-07-08 01:06:12 +02:00
Refactor --template code (#1711)
* Move path concerns to path.py and template concerns to editor.py -- BDD tests are failing * Move path-related constants from config.py to path.py * Mock get_templates_path in its new calling file * Mediate template arg vs. config in controller then read template text in editor and unify those two use cases. Some tests still failing * Fix test whose message had changed * poe format * Refactor for easier unit testing and add unit tests * Use path strings instead of Path objects in return values to prevent side effects that caused unit tests to fail on some platforms * poe format * Attempt to bypass getcwd errors in CI with patch * Consistently use strings for paths instead of some strings and some pathlib.Path * Keep pathlib within a function for readability * fix for ruamel.yaml versions >=0.17.22 * Run poe format --------- Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
This commit is contained in:
parent
78d11d74bd
commit
4a7057c038
11 changed files with 190 additions and 147 deletions
|
@ -105,16 +105,12 @@ class MsgText(Enum):
|
|||
|
||||
KeyboardInterruptMsg = "Aborted by user"
|
||||
|
||||
CantReadTemplateGlobalConfig = """
|
||||
Could not read template file defined in config:
|
||||
{global_template_path}
|
||||
"""
|
||||
CantReadTemplate = """
|
||||
Unable to find a template file {template_path}.
|
||||
|
||||
CantReadTemplateCLIArg = """
|
||||
Unable to find a template file based on the passed arg, and no global template was detected.
|
||||
The following filepaths were checked:
|
||||
jrnl XDG Template Directory : {jrnl_template_dir}
|
||||
Local Filepath : {normalized_template_arg_filepath}
|
||||
The following paths were checked:
|
||||
* {jrnl_template_dir}{template_path}
|
||||
* {actual_template_path}
|
||||
"""
|
||||
|
||||
NoNamedJournal = "No '{journal_name}' journal configured\n{journals}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue