mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-21 13:38:31 +02:00
flake8 fixes
This commit is contained in:
parent
ad1bfd3092
commit
b58e387771
6 changed files with 7 additions and 11 deletions
|
@ -1,15 +1,14 @@
|
||||||
import ast
|
import ast
|
||||||
from codecs import decode, encode
|
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
import json
|
|
||||||
import os
|
import os
|
||||||
|
from pathlib import Path
|
||||||
import shlex
|
import shlex
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
from unittest.mock import patch
|
from unittest.mock import patch
|
||||||
|
|
||||||
import keyring
|
import keyring
|
||||||
import tzlocal
|
import toml
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
from behave import given, then, when
|
from behave import given, then, when
|
||||||
|
|
|
@ -3,7 +3,6 @@ import hashlib
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
from typing import Optional
|
|
||||||
|
|
||||||
from cryptography.fernet import Fernet, InvalidToken
|
from cryptography.fernet import Fernet, InvalidToken
|
||||||
from cryptography.hazmat.backends import default_backend
|
from cryptography.hazmat.backends import default_backend
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
import getpass
|
|
||||||
import glob
|
import glob
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
|
@ -10,8 +9,6 @@ import xdg.BaseDirectory
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
from . import __version__, upgrade, util
|
from . import __version__, upgrade, util
|
||||||
from .EncryptedJournal import EncryptedJournal
|
|
||||||
from .Journal import PlainJournal
|
|
||||||
from .util import UserAbort, verify_config
|
from .util import UserAbort, verify_config
|
||||||
|
|
||||||
if "win32" not in sys.platform:
|
if "win32" not in sys.platform:
|
||||||
|
|
|
@ -3,8 +3,6 @@
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from .. import util
|
|
||||||
|
|
||||||
|
|
||||||
class JRNLImporter:
|
class JRNLImporter:
|
||||||
"""This plugin imports entries from other jrnl files."""
|
"""This plugin imports entries from other jrnl files."""
|
||||||
|
@ -16,7 +14,6 @@ class JRNLImporter:
|
||||||
"""Imports from an existing file if input is specified, and
|
"""Imports from an existing file if input is specified, and
|
||||||
standard input otherwise."""
|
standard input otherwise."""
|
||||||
old_cnt = len(journal.entries)
|
old_cnt = len(journal.entries)
|
||||||
old_entries = journal.entries
|
|
||||||
if input:
|
if input:
|
||||||
with open(input, "r", encoding="utf-8") as f:
|
with open(input, "r", encoding="utf-8") as f:
|
||||||
other_journal_txt = f.read()
|
other_journal_txt = f.read()
|
||||||
|
|
|
@ -55,6 +55,10 @@ class MarkdownExporter(TextExporter):
|
||||||
previous_line = line
|
previous_line = line
|
||||||
newbody = newbody + previous_line # add very last line
|
newbody = newbody + previous_line # add very last line
|
||||||
|
|
||||||
|
# make sure the export ends with a blank line
|
||||||
|
if previous_line not in ["\r", "\n", "\r\n", "\n\r"]:
|
||||||
|
newbody = newbody + os.linesep
|
||||||
|
|
||||||
if warn_on_heading_level is True:
|
if warn_on_heading_level is True:
|
||||||
print(
|
print(
|
||||||
f"{WARNING_COLOR}WARNING{RESET_COLOR}: "
|
f"{WARNING_COLOR}WARNING{RESET_COLOR}: "
|
||||||
|
|
|
@ -46,7 +46,7 @@ include_trailing_comma = true
|
||||||
force_grid_wrap = 0
|
force_grid_wrap = 0
|
||||||
use_parentheses = true
|
use_parentheses = true
|
||||||
line_length = 88
|
line_length = 88
|
||||||
known_first_party = "jrnl"
|
known_first_party = ["jrnl", "behave"]
|
||||||
force_sort_within_sections = true
|
force_sort_within_sections = true
|
||||||
|
|
||||||
[build-system]
|
[build-system]
|
||||||
|
|
Loading…
Add table
Reference in a new issue