mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-20 13:08:31 +02:00
Merge pull request #819 from jrnl-org/develop
Merge latest develop into master for v2.2-beta2
This commit is contained in:
commit
caedf1ae7f
2 changed files with 12 additions and 2 deletions
|
@ -12,6 +12,11 @@
|
|||
- Password confirmation [\#706](https://github.com/jrnl-org/jrnl/pull/706) ([pspeter](https://github.com/pspeter))
|
||||
- Pretty print journal entries [\#692](https://github.com/jrnl-org/jrnl/pull/692) ([alichtman](https://github.com/alichtman))
|
||||
|
||||
**Fixed bugs:**
|
||||
|
||||
- Close temp file before passing it to editor to prevent file locking issues in Windows [\#792](https://github.com/jrnl-org/jrnl/pull/792) ([micahellison](https://github.com/micahellison))
|
||||
- Fix crash while encrypting a journal on first run without saving password [\#789](https://github.com/jrnl-org/jrnl/pull/789) ([dbxnr](https://github.com/dbxnr))
|
||||
|
||||
**Build:**
|
||||
|
||||
- Change PyPI auth method in build pipeline [\#807](https://github.com/jrnl-org/jrnl/pull/807) ([wren](https://github.com/wren))
|
||||
|
|
|
@ -103,7 +103,7 @@ def set_keychain(journal_name, password):
|
|||
if password is None:
|
||||
try:
|
||||
keyring.delete_password("jrnl", journal_name)
|
||||
except RuntimeError:
|
||||
except keyring.errors.PasswordDeleteError:
|
||||
pass
|
||||
else:
|
||||
keyring.set_password("jrnl", journal_name, password)
|
||||
|
@ -142,21 +142,26 @@ def scope_config(config, journal_name):
|
|||
|
||||
def get_text_from_editor(config, template=""):
|
||||
filehandle, tmpfile = tempfile.mkstemp(prefix="jrnl", text=True, suffix=".txt")
|
||||
os.close(filehandle)
|
||||
|
||||
with open(tmpfile, "w", encoding="utf-8") as f:
|
||||
if template:
|
||||
f.write(template)
|
||||
|
||||
try:
|
||||
subprocess.call(
|
||||
shlex.split(config["editor"], posix="win" not in sys.platform) + [tmpfile]
|
||||
)
|
||||
except AttributeError:
|
||||
subprocess.call(config["editor"] + [tmpfile])
|
||||
|
||||
with open(tmpfile, "r", encoding="utf-8") as f:
|
||||
raw = f.read()
|
||||
os.close(filehandle)
|
||||
os.remove(tmpfile)
|
||||
|
||||
if not raw:
|
||||
print("[Nothing saved to file]", file=sys.stderr)
|
||||
|
||||
return raw
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue