Skip to content

Commit 32894e4

Browse files
committed
Apply black formatting
1 parent 5f9421a commit 32894e4

File tree

4 files changed

+6
-19
lines changed

4 files changed

+6
-19
lines changed

src/config.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ class MagInkDashConfig:
2626
LAT: float = float(os.getenv("LAT", 34.118333))
2727
LNG: float = float(os.getenv("LNG", -118.300333))
2828
WEATHER_UNITS: WeatherUnits = WeatherUnits[os.getenv("WEATHER_UNITS", "metric")]
29-
NUM_DAYS_IN_TEMPLATE: int = (
30-
5 # Not configurable because it's hard-coded in the HTML template
31-
)
29+
NUM_DAYS_IN_TEMPLATE: int = 5 # Not configurable because it's hard-coded in the HTML template
3230

3331
def get_config():
3432
global _current_config

src/ics_cal/ics.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@ def get_events(self, ics_url, calStartDatetime, calEndDatetime, displayTZ, numDa
3838

3939
for event in eventList:
4040
if event["isMultiday"]:
41-
numDays = (
42-
event["endDatetime"].date() - event["startDatetime"].date()
43-
).days
41+
numDays = (event["endDatetime"].date() - event["startDatetime"].date()).days
4442
for day in range(0, numDays):
4543
calDict.setdefault(
4644
event["startDatetime"].date() + dt.timedelta(days=day), []

src/main.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,8 @@ def get_image() -> FileResponse:
5656
)
5757

5858
currTime = dt.datetime.now(pytz.timezone(cfg.DISPLAY_TZ))
59-
currDate = currTime.date()
6059
calStartDatetime = currTime.replace(hour=0, minute=0, second=0, microsecond=0)
61-
calEndDatetime = calStartDatetime + dt.timedelta(
62-
days=cfg.NUM_CAL_DAYS_TO_QUERY, seconds=-1
63-
)
60+
calEndDatetime = calStartDatetime + dt.timedelta(days=cfg.NUM_CAL_DAYS_TO_QUERY, seconds=-1)
6461

6562
events = calModule.get_events(
6663
cfg.ICS_URL,

src/render/render.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,8 @@ def set_viewport_size(self, driver):
3535
inner_height = int(html.get_attribute("clientHeight"))
3636

3737
# "Internal width you want to set+Set "outer frame width" to window size
38-
target_width = self.cfg.IMAGE_WIDTH + (
39-
current_window_size["width"] - inner_width
40-
)
41-
target_height = self.cfg.IMAGE_HEIGHT + (
42-
current_window_size["height"] - inner_height
43-
)
38+
target_width = self.cfg.IMAGE_WIDTH + (current_window_size["width"] - inner_width)
39+
target_height = self.cfg.IMAGE_HEIGHT + (current_window_size["height"] - inner_height)
4440

4541
driver.set_window_rect(width=target_width, height=target_height)
4642

@@ -117,9 +113,7 @@ def process_inputs(
117113

118114
if len(cal_events_days) == 0:
119115
cal_events_days.append("Today")
120-
cal_events_list.append(
121-
'<div class="event"><span class="event-time">None</span></div>'
122-
)
116+
cal_events_list.append('<div class="event"><span class="event-time">None</span></div>')
123117

124118
self.extend_list(cal_events_days, self.cfg.NUM_DAYS_IN_TEMPLATE, "")
125119
self.extend_list(cal_events_list, self.cfg.NUM_DAYS_IN_TEMPLATE, "")

0 commit comments

Comments
 (0)