Skip to content

Commit

Permalink
Use get_app_dir
Browse files Browse the repository at this point in the history
  • Loading branch information
vinayak-mehta committed May 23, 2020
1 parent b4ffc0d commit 6f2da95
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ master

**Improvements**

* Fix days left [comparison operators](https://github.com/vinayak-mehta/conrad/commit/b4ffc0d54ded8dd9ae94ecd9202715512264583b).
* [#85](https://github.com/vinayak-mehta/conrad/issues/85) Add crawler for awesome-italy-events. [#91](https://github.com/vinayak-mehta/conrad/pull/91) by Vinayak Mehta.

0.3.2 (2019-11-08)
Expand Down
5 changes: 3 additions & 2 deletions conrad/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@

import os

from click import get_app_dir

from .__version__ import __version__


USER_HOME = os.path.expanduser("~")
CONRAD_HOME = os.path.join(USER_HOME, ".conrad")
CONRAD_HOME = get_app_dir("conrad")
SQL_ALCHEMY_CONN = "sqlite:///{}/conrad.db".format(CONRAD_HOME)


Expand Down
6 changes: 3 additions & 3 deletions conrad/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ def _show(ctx, *args, **kwargs):
events = list(
session.query(Event).filter(*filters).order_by(Event.start_date).all()
)
if len(events):
if len(events) > 0:
header = [
"id",
"Name",
Expand Down Expand Up @@ -335,7 +335,7 @@ def _remind(ctx, *args, **kwargs):
.order_by(Event.start_date)
.all()
)
if len(reminders):
if len(reminders) > 0:
header = ["id", "Name", "Start Date", "Days Left"]
reminders_output = []

Expand Down Expand Up @@ -413,7 +413,7 @@ def _import(ctx, *args, **kwargs):
input_events = json.load(f)

failures = validate(input_events)
if len(failures):
if len(failures) > 0:
raise click.UsageError(
"The following validations failed!\n{}".format(
"".join(
Expand Down

0 comments on commit 6f2da95

Please sign in to comment.