Skip to content
This repository has been archived by the owner on Dec 18, 2023. It is now read-only.

Commit

Permalink
fix(scripts): 修复时段计算错误
Browse files Browse the repository at this point in the history
时段最后一部分比较错误

Author: ambition-echo
  • Loading branch information
ambition_echo committed Aug 6, 2022
1 parent 277c6b7 commit cadbbc5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/6.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,23 +77,23 @@ def read_json(sunrise, day, sunset, night):
print(day)
num = len(day) // len(theme["dayImageList"])
index = day.index(hour) // num
if index >= len(theme["sunriseImageList"]):
if index >= len(theme["dayImageList"]):
index = -1
set_wallpaper(unpackDir + "/" + theme["imageFilename"].replace(
"*", str(theme["dayImageList"][index])))
elif hour in sunset:
print(sunset)
num = len(sunset) // len(theme["sunsetImageList"])
index = sunset.index(hour) // num
if index >= len(theme["sunriseImageList"]):
if index >= len(theme["sunsetImageList"]):
index = -1
set_wallpaper(unpackDir + "/" + theme["imageFilename"].replace(
"*", str(theme["sunsetImageList"][index])))
elif hour in night:
print(night)
num = len(night) // len(theme["nightImageList"])
index = night.index(hour) // num
if index >= len(theme["sunriseImageList"]):
if index >= len(theme["nightImageList"]):
index = -1
set_wallpaper(unpackDir + "/" + theme["imageFilename"].replace(
"*", str(theme["nightImageList"][index])))
Expand Down

0 comments on commit cadbbc5

Please sign in to comment.