Skip to content

Commit

Permalink
Pleasing black
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas-C committed Dec 10, 2024
1 parent cb760cd commit f445fa4
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 8 deletions.
3 changes: 2 additions & 1 deletion .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,8 @@
"research",
"bug",
"doc",
"ideas"
"ideas",
"maintenance"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ This library could only exist thanks to the dedication of many volunteers around
<td align="center" valign="top" width="14.28%"><a href="https://github.com/jmunoz94"><img src="https://avatars.githubusercontent.com/u/48921408?v=4?s=100" width="100px;" alt="Jesús Alberto Muñoz Mesa"/><br /><sub><b>Jesús Alberto Muñoz Mesa</b></sub></a><br /><a href="https://github.com/py-pdf/fpdf2/commits?author=jmunoz94" title="Tests">⚠️</a> <a href="https://github.com/py-pdf/fpdf2/commits?author=jmunoz94" title="Documentation">📖</a> <a href="#translation-jmunoz94" title="Translation">🌍</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://jdeep.me"><img src="https://avatars.githubusercontent.com/u/64089730?v=4?s=100" width="100px;" alt="Jaydeep Das"/><br /><sub><b>Jaydeep Das</b></sub></a><br /><a href="#question-JDeepD" title="Answering Questions">💬</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/seanpmulholland"><img src="https://avatars.githubusercontent.com/u/79894395?v=4?s=100" width="100px;" alt="Sean"/><br /><sub><b>Sean</b></sub></a><br /><a href="https://github.com/py-pdf/fpdf2/commits?author=seanpmulholland" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/andersonhc"><img src="https://avatars.githubusercontent.com/u/948125?v=4?s=100" width="100px;" alt="Anderson Herzogenrath da Costa"/><br /><sub><b>Anderson Herzogenrath da Costa</b></sub></a><br /><a href="#question-andersonhc" title="Answering Questions">💬</a> <a href="https://github.com/py-pdf/fpdf2/commits?author=andersonhc" title="Code">💻</a> <a href="#research-andersonhc" title="Research">🔬</a> <a href="https://github.com/py-pdf/fpdf2/issues?q=author%3Aandersonhc" title="Bug reports">🐛</a> <a href="https://github.com/py-pdf/fpdf2/commits?author=andersonhc" title="Documentation">📖</a> <a href="#ideas-andersonhc" title="Ideas, Planning, & Feedback">🤔</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/andersonhc"><img src="https://avatars.githubusercontent.com/u/948125?v=4?s=100" width="100px;" alt="Anderson Herzogenrath da Costa"/><br /><sub><b>Anderson Herzogenrath da Costa</b></sub></a><br /><a href="#question-andersonhc" title="Answering Questions">💬</a> <a href="https://github.com/py-pdf/fpdf2/commits?author=andersonhc" title="Code">💻</a> <a href="#research-andersonhc" title="Research">🔬</a> <a href="https://github.com/py-pdf/fpdf2/issues?q=author%3Aandersonhc" title="Bug reports">🐛</a> <a href="https://github.com/py-pdf/fpdf2/commits?author=andersonhc" title="Documentation">📖</a> <a href="#ideas-andersonhc" title="Ideas, Planning, & Feedback">🤔</a> <a href="#maintenance-Lucas-C" title="Maintenance">🚧</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/yiweelan"><img src="https://avatars.githubusercontent.com/u/117787188?v=4?s=100" width="100px;" alt="Yi Wei Lan"/><br /><sub><b>Yi Wei Lan</b></sub></a><br /><a href="https://github.com/py-pdf/fpdf2/commits?author=yiweelan" title="Tests">⚠️</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Bubbu0129"><img src="https://avatars.githubusercontent.com/u/93034081?v=4?s=100" width="100px;" alt="CpDong"/><br /><sub><b>CpDong</b></sub></a><br /><a href="https://github.com/py-pdf/fpdf2/commits?author=Bubbu0129" title="Code">💻</a> <a href="https://github.com/py-pdf/fpdf2/issues?q=author%3ABubbu0129" title="Bug reports">🐛</a> <a href="#translation-Bubbu0129" title="Translation">🌍</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/CY-Qiu"><img src="https://avatars.githubusercontent.com/u/23075447?v=4?s=100" width="100px;" alt="CY-Qiu"/><br /><sub><b>CY-Qiu</b></sub></a><br /><a href="https://github.com/py-pdf/fpdf2/issues?q=author%3ACY-Qiu" title="Bug reports">🐛</a></td>
Expand Down
6 changes: 4 additions & 2 deletions tutorial/csv2table.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
with open(sys.argv[1], encoding="utf-8") as csv_file:
reader = csv.reader(csv_file, delimiter=",")
for i, row in enumerate(reader):
# We color the row based on the hexadecimal code in the 2nd column:
style = FontFace(fill_color=color_from_hex_string(row[1])) if i > 0 else None
style = None
if i > 0:
# We color the row based on the hexadecimal code in the 2nd column:
style = FontFace(fill_color=color_from_hex_string(row[1]))
table.row(row, style=style)
pdf.output("from-csv.pdf")
6 changes: 4 additions & 2 deletions tutorial/ods2table.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
with pdf.table() as table:
for i, row in enumerate(sheet.getElementsByType(TableRow)):
row = [str(cell) for cell in row.getElementsByType(TableCell)]
# We color the row based on the hexadecimal code in the 2nd column:
style = FontFace(fill_color=color_from_hex_string(row[1])) if i > 0 else None
style = None
if i > 0:
# We color the row based on the hexadecimal code in the 2nd column:
style = FontFace(fill_color=color_from_hex_string(row[1]))
table.row(row, style=style)
pdf.output("from-ods.pdf")
6 changes: 4 additions & 2 deletions tutorial/xlsx2table.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
ws = wb.active
with pdf.table() as table:
for i, row in enumerate(ws.rows):
# We color the row based on the hexadecimal code in the 2nd column:
style = FontFace(fill_color=color_from_hex_string(row[1].value)) if i > 0 else None
style = None
if i > 0:
# We color the row based on the hexadecimal code in the 2nd column:
style = FontFace(fill_color=color_from_hex_string(row[1]))
table.row([cell.value for cell in row], style=style)
pdf.output("from-xlsx.pdf")

0 comments on commit f445fa4

Please sign in to comment.