Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 8312751

Browse files
Merge pull request avinashkranjan#2692 from avinashkranjan/deepsource-transform-673134f9
format code with autopep8
2 parents 389f6c8 + 595ce32 commit 8312751

File tree

1 file changed

+25
-24
lines changed

1 file changed

+25
-24
lines changed

‎Payment_Receipt/payment.py‎

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,53 +6,54 @@
66

77
# data which we are going to display as tables
88
DATA = [
9-
[ "Date" , "Name", "Subscription", "Price (Rs.)" ],
10-
[
11-
"08/08/2023",
12-
"Full Stack Development with React & Node JS - Live",
13-
"Lifetime",
14-
"10,999.00/-",
15-
],
16-
[ "08/08/2023", "Data Structures and Algorithms: Live Session", "6 months", "9,999.00/-"],
17-
[ "Sub Total", "", "", "20,9998.00/-"],
18-
[ "Discount", "", "", "-3,000.00/-"],
19-
[ "Total", "", "", "17,998.00/-"],
9+
["Date", "Name", "Subscription", "Price (Rs.)"],
10+
[
11+
"08/08/2023",
12+
"Full Stack Development with React & Node JS - Live",
13+
"Lifetime",
14+
"10,999.00/-",
15+
],
16+
["08/08/2023", "Data Structures and Algorithms: Live Session",
17+
"6 months", "9,999.00/-"],
18+
["Sub Total", "", "", "20,9998.00/-"],
19+
["Discount", "", "", "-3,000.00/-"],
20+
["Total", "", "", "17,998.00/-"],
2021
]
2122

2223
# creating a Base Document Template of page size A4
23-
pdf = SimpleDocTemplate("receipt.pdf", pagesize=A4)
24+
pdf = SimpleDocTemplate("receipt.pdf", pagesize=A4)
2425

2526
# standard stylesheet defined within reportlab itself
2627
styles = getSampleStyleSheet()
2728

2829
# fetching the style of Top level heading (Heading1)
29-
title_style = styles["Heading1"]
30+
title_style = styles["Heading1"]
3031

3132
# 0: left, 1: center, 2: right
3233
title_style.alignment = 1
3334

3435
# creating the paragraph with
3536
# the heading text and passing the styles of it
36-
title = Paragraph("Your Payment Receipt", title_style)
37+
title = Paragraph("Your Payment Receipt", title_style)
3738

3839
# creates a Table Style object and in it,
3940
# defines the styles row wise
4041
# the tuples which look like coordinates
4142
# are nothing but rows and columns
4243
style = TableStyle(
43-
[
44-
( "BOX", (0, 0), (-1, -1), 1, colors.black),
45-
( "GRID", (0, 0), (4, 4), 1, colors.black),
46-
( "BACKGROUND", (0, 0), (3, 0), colors.gray),
47-
( "TEXTCOLOR", (0, 0), (-1, 0), colors.whitesmoke),
48-
( "ALIGN", (0, 0), (-1, -1), "CENTER"),
49-
( "BACKGROUND", (0, 1 ) , (-1, -1), colors.beige),
50-
]
44+
[
45+
("BOX", (0, 0), (-1, -1), 1, colors.black),
46+
("GRID", (0, 0), (4, 4), 1, colors.black),
47+
("BACKGROUND", (0, 0), (3, 0), colors.gray),
48+
("TEXTCOLOR", (0, 0), (-1, 0), colors.whitesmoke),
49+
("ALIGN", (0, 0), (-1, -1), "CENTER"),
50+
("BACKGROUND", (0, 1), (-1, -1), colors.beige),
51+
]
5152
)
5253

5354
# creates a table object and passes the style to it
54-
table = Table(DATA, style=style)
55+
table = Table(DATA, style=style)
5556

5657
# final step which builds the
5758
# actual pdf putting together all the elements
58-
pdf.build([title, table])
59+
pdf.build([title, table])

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /