Skip to content

Commit 3e2b0c1

Browse files
committed
remove redundant comments
1 parent 2a8257b commit 3e2b0c1

File tree

3 files changed

+1
-19
lines changed

3 files changed

+1
-19
lines changed

nbmail/compose/blocks.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,6 @@ def block_text(
202202
column(
203203
mjml_text(content=html, attributes={"align": align}),
204204
),
205-
# attributes={"padding": "0px"},
206205
)
207206

208207
return Block(mjml_section)
@@ -248,7 +247,6 @@ def block_title(
248247
attributes={"align": align},
249248
)
250249
),
251-
# attributes={"padding": "0px"},
252250
)
253251

254252
return Block(mjml_section)
@@ -285,7 +283,6 @@ def block_spacer(height: str = "20px") -> Block:
285283
column(
286284
mjml_spacer(attributes={"height": height}),
287285
),
288-
# attributes={"padding": "0px"},
289286
)
290287

291288
return Block(mjml_section)
@@ -354,32 +351,26 @@ def block_image(
354351
- Images from local files are converted to inline attachments with CID references
355352
during email processing by mjml_to_email().
356353
- If `float` is not "none", it takes precedence and overrides `align`.
357-
"""
358-
# Convert integer width to CSS string
354+
"""
359355
if isinstance(width, int):
360356
width_str = f"{width}px"
361357
else:
362358
width_str = width
363359

364-
# Determine alignment style based on float and align parameters
365360
align_style = ""
366361

367-
# Float takes precedence if not "none"
368362
if float != "none":
369363
align_style = f"float: {float};"
370364
else:
371-
# Use align parameter if float is "none"
372365
if align == "center":
373366
align_style = "display: block; margin: 0 auto;"
374367
elif align == "left":
375368
align_style = "display: block; margin: 0;"
376369
elif align == "right":
377370
align_style = "display: block; margin: 0 0 0 auto;"
378-
# "inline" has no special style
379371

380372
# Detect URL vs local file
381373
if _is_url(file):
382-
# For URLs, use as-is
383374
src = file
384375
else:
385376
# For local files, read as bytes for processing by _process_mjml_images

nbmail/compose/compose.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ def compose_email(
134134
)
135135
```
136136
"""
137-
# Convert sections (header, body, footer) to MJML lists
138137
header_mjml_list = _component_to_mjml_section(header)
139138
body_mjml_list = _component_to_mjml_section(body)
140139
footer_mjml_list = _component_to_mjml_section(footer)
@@ -144,13 +143,11 @@ def compose_email(
144143
title_block_mjml = block_title(title)._to_mjml()
145144
header_mjml_list = [title_block_mjml] + header_mjml_list
146145

147-
# Apply template wrapper if requested
148146
if template == "blastula":
149147
all_sections = _apply_blastula_template(
150148
header_mjml_list, body_mjml_list, footer_mjml_list
151149
)
152150
elif template == "none":
153-
# Combine all sections without template
154151
all_sections = header_mjml_list + body_mjml_list + footer_mjml_list
155152
else:
156153
raise ValueError(f"Unknown template: {template}. Use 'blastula' or 'none'.")
@@ -174,9 +171,6 @@ def compose_email(
174171
),
175172
)
176173

177-
# TODO: remove, this is for testing purposes
178-
# print(email_structure._to_mjml())
179-
180174
email_obj = mjml_to_email(email_structure)
181175

182176
return email_obj
@@ -211,7 +205,6 @@ def _component_to_mjml_section(
211205
return component._to_mjml_list()
212206

213207
elif isinstance(component, str):
214-
# Convert string to BlockList and then to MJML
215208
block_list = BlockList(component)
216209
return block_list._to_mjml_list()
217210

@@ -268,7 +261,6 @@ def apply_blastula_styles(sections: list[MJMLTag]) -> list[MJMLTag]:
268261
for section in body_sections
269262
]
270263

271-
# Wrap body with styling
272264
body_wrapper = wrapper(
273265
*styled_body,
274266
attributes={

nbmail/compose/inline_utils.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ def _read_local_file_as_data_uri(file: str) -> str:
144144
with open(file_path, "rb") as f:
145145
file_bytes = f.read()
146146

147-
# Encode to base64
148147
b64_string = base64.b64encode(file_bytes).decode("utf-8")
149148

150149
# Guess MIME type

0 commit comments

Comments
 (0)