Skip to content

Commit 1b71cab

Browse files
committed
code format
1 parent 5371a5a commit 1b71cab

File tree

1 file changed

+33
-9
lines changed
  • MagTag_Webb_Telescope_Status

1 file changed

+33
-9
lines changed

MagTag_Webb_Telescope_Status/code.py

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@
3131
# SLEEP_TIME = 60 * 60 * 24 # seconds
3232

3333
# URL to fetch the data from
34-
JSON_GET_URL = "https://jwst.nasa.gov/content/webbLaunch/flightCurrentState2.0.json?unique={}"
34+
JSON_GET_URL = (
35+
"https://jwst.nasa.gov/content/webbLaunch/flightCurrentState2.0.json?unique={}"
36+
)
3537

3638
# Whether to fetch live data or use cached
3739
TEST_RUN = True
@@ -99,11 +101,17 @@ def make_name_text(text, anchor_point, anchored_position, bg_color=LBL_BACKGROUN
99101
padding_right=4,
100102
padding_bottom=3,
101103
padding_top=3,
102-
line_spacing=1.0
104+
line_spacing=1.0,
103105
)
104106

105107

106-
def make_value_text(anchor_point, anchored_position, custom_font=True, bg_color=0x000000, font_color=0xFFFFF):
108+
def make_value_text(
109+
anchor_point,
110+
anchored_position,
111+
custom_font=True,
112+
bg_color=0x000000,
113+
font_color=0xFFFFF,
114+
):
107115
"""
108116
Create label object for showing data values.
109117
@@ -117,9 +125,17 @@ def make_value_text(anchor_point, anchored_position, custom_font=True, bg_color=
117125
else:
118126
_font = terminalio.FONT
119127
return bitmap_label.Label(
120-
_font, text="", anchor_point=anchor_point, anchored_position=anchored_position,
121-
line_spacing=1.0, padding_top=3, background_color=bg_color, color=font_color,
122-
padding_right=4, padding_left=4, padding_bottom=4
128+
_font,
129+
text="",
130+
anchor_point=anchor_point,
131+
anchored_position=anchored_position,
132+
line_spacing=1.0,
133+
padding_top=3,
134+
background_color=bg_color,
135+
color=font_color,
136+
padding_right=4,
137+
padding_left=4,
138+
padding_bottom=4,
123139
)
124140

125141

@@ -132,11 +148,17 @@ def make_value_text(anchor_point, anchored_position, custom_font=True, bg_color=
132148
# value text initializations
133149

134150
# top left. Hot side | Cold side temperature values
135-
top_left_value = make_value_text(anchor_point=(0, 0), anchored_position=(0, 6), bg_color=0xBBBBBB, font_color=0x000000)
151+
top_left_value = make_value_text(
152+
anchor_point=(0, 0),
153+
anchored_position=(0, 6),
154+
bg_color=0xBBBBBB,
155+
font_color=0x000000,
156+
)
136157

137158
# top right. Instrument temperature values
138159
top_right_value = make_value_text(
139-
anchor_point=(1.0, 0), anchored_position=(display.width - 6, 6),
160+
anchor_point=(1.0, 0),
161+
anchored_position=(display.width - 6, 6),
140162
)
141163

142164
# bottom left timestamp
@@ -159,7 +181,9 @@ def make_value_text(anchor_point, anchored_position, custom_font=True, bg_color=
159181
# center. Instrument temp labels
160182
inst_temp_labels = "NIRCam Bench\nNIRSpec Bench\nFGS Bench\nMIRI Bench\nFSM"
161183
top_center_name = make_name_text(
162-
text=inst_temp_labels, anchor_point=(1.0, 0.0), anchored_position=(top_right_value.x - 2, 6)
184+
text=inst_temp_labels,
185+
anchor_point=(1.0, 0.0),
186+
anchored_position=(top_right_value.x - 2, 6),
163187
)
164188

165189
main_group.append(middle_left_name)

0 commit comments

Comments
 (0)