Skip to content

Commit

Permalink
Merge pull request #769 from MinchinWeb/black
Browse files Browse the repository at this point in the history
Black Formatter
  • Loading branch information
wren committed Dec 21, 2019
2 parents 717078b + e984a9a commit 2e920a7
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 14 deletions.
7 changes: 7 additions & 0 deletions .travis.yml
Expand Up @@ -53,6 +53,13 @@ jobs:
- os: windows

include:
- stage: Lint & Tests
name: Lint, via Black
python: 3.8
# black is automatically installed by peotry
script:
- black --check . --verbose --diff

# Python 3.6 Tests
- name: Python 3.6 on Linux
python: 3.6
Expand Down
11 changes: 7 additions & 4 deletions features/steps/core.py
Expand Up @@ -60,12 +60,15 @@ def read_journal(journal_name="default"):
def open_journal(journal_name="default"):
config = util.load_config(install.CONFIG_FILE_PATH)
journal_conf = config["journals"][journal_name]
if (
type(journal_conf) is dict
): # We can override the default config on a by-journal basis


if type(journal_conf) is dict:
# We can override the default config on a by-journal basis
config.update(journal_conf)
else: # But also just give them a string to point to the journal file
else:
# But also just give them a string to point to the journal file
config["journal"] = journal_conf

return Journal.open_journal(journal_name, config)


Expand Down
4 changes: 1 addition & 3 deletions jrnl/Entry.py
Expand Up @@ -108,9 +108,7 @@ def pprint(self, short=False):
return title
else:
return "{title}{sep}{body}\n".format(
title=title,
sep="\n" if has_body else "",
body=body if has_body else "",
title=title, sep="\n" if has_body else "", body=body if has_body else ""
)

def __repr__(self):
Expand Down
5 changes: 2 additions & 3 deletions jrnl/install.py
Expand Up @@ -138,9 +138,8 @@ def install():
os.path.expandvars(journal_path)
)

path = os.path.split(default_config["journals"][DEFAULT_JOURNAL_KEY])[
0
] # If the folder doesn't exist, create it
# If the folder doesn't exist, create it
path = os.path.split(default_config["journals"][DEFAULT_JOURNAL_KEY])[0]
try:
os.makedirs(path)
except OSError:
Expand Down
7 changes: 3 additions & 4 deletions jrnl/upgrade.py
Expand Up @@ -26,7 +26,7 @@ def upgrade_jrnl_if_necessary(config_path):
config = util.load_config(config_path)

print(
"""Welcome to jrnl {}.
f"""Welcome to jrnl {__version__}.
It looks like you've been using an older version of jrnl until now. That's
okay - jrnl will now upgrade your configuration and journal files. Afterwards
Expand All @@ -40,10 +40,9 @@ def upgrade_jrnl_if_necessary(config_path):
Please note that jrnl 1.x is NOT forward compatible with this version of jrnl.
If you choose to proceed, you will not be able to use your journals with
older versions of jrnl anymore.
""".format(
__version__
)
"""
)

encrypted_journals = {}
plain_journals = {}
other_journals = {}
Expand Down

0 comments on commit 2e920a7

Please sign in to comment.