mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-10 16:48:31 +02:00
Keep pathlib within a function for readability
This commit is contained in:
parent
0809d28ba2
commit
03d5d3ee2f
1 changed files with 3 additions and 2 deletions
|
@ -2,6 +2,7 @@
|
|||
# License: https://www.gnu.org/licenses/gpl-3.0.html
|
||||
|
||||
import os.path
|
||||
from pathlib import Path
|
||||
|
||||
import xdg.BaseDirectory
|
||||
|
||||
|
@ -39,8 +40,8 @@ def get_templates_path() -> str:
|
|||
doesn't exist.
|
||||
"""
|
||||
# jrnl_xdg_resource_path is created by save_data_path if it does not exist
|
||||
jrnl_xdg_resource_path = xdg.BaseDirectory.save_data_path(XDG_RESOURCE)
|
||||
jrnl_templates_path = os.path.join(jrnl_xdg_resource_path, "templates")
|
||||
jrnl_xdg_resource_path = Path(xdg.BaseDirectory.save_data_path(XDG_RESOURCE))
|
||||
jrnl_templates_path = jrnl_xdg_resource_path / "templates"
|
||||
# Create the directory if needed.
|
||||
jrnl_templates_path.mkdir(exist_ok=True)
|
||||
return str(jrnl_templates_path)
|
||||
|
|
Loading…
Add table
Reference in a new issue