Skip to content

Commit

Permalink
Change a path
Browse files Browse the repository at this point in the history
  • Loading branch information
za3k committed Jun 12, 2024
1 parent 7d48f21 commit 4ca6fde
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions budget_summary.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/python3
import datetime, glob, os, re, sys

WEEKLY_REVIEW="/home/zachary/.projects/weekly-review"

DATE_FORMAT="%Y-%m-%d"
def load_review():
if len(sys.argv) > 1:
Expand All @@ -13,9 +15,9 @@ def load_review():
while day_offset > 0: day_offset-= 7
assert -6 <= day_offset <= 0
current_date += datetime.timedelta(days=day_offset)
fp = "/home/zachary/weekly-review/_posts/{}/{}-weekly-review.md".format(current_date.year, current_date)
fp = os.path.join(WEEKLY_REVIEW,"_posts/{}/{}-weekly-review.md".format(current_date.year, current_date))
if not os.path.exists(fp):
fp = "/home/zachary/weekly-review/_posts/{}/{}-weekly-review.md".format(current_date.year, current_date.strftime(DATE_FORMAT))
fp = os.path.join(WEEKLY_REVIEW,"_posts/{}/{}-weekly-review.md".format(current_date.year, current_date.strftime(DATE_FORMAT)))
with open(fp, "r") as f:
return list(f)
def load_budget():
Expand Down

0 comments on commit 4ca6fde

Please sign in to comment.