Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions bin/timelit.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,16 @@ def main():
show(image_path_prefix + 'quote_Leg_0_credits.png')

while True:
now = datetime.datetime.now().strftime('%H%M')
now = datetime.datetime.now()
now_time = now.strftime('%H%M')
image_name = "quote_{}_*_credits.png"
images = glob.glob(image_path_prefix + image_name.format(now))
images = glob.glob(image_path_prefix + image_name.format(now_time))

FAST_MODE = 120 if 500 < int(now_time) < 2300 else 900

if len(images) > 0:
show(random.choice(images))
time.sleep(60)
time.sleep(FAST_MODE)
else:
time.sleep(60)

Expand Down