Skip to content

Commit d2aad79

Browse files
committed
Apply black formatting to Python demos
1 parent c5af9a5 commit d2aad79

File tree

5 files changed

+24
-25
lines changed

5 files changed

+24
-25
lines changed

src/Library/demos/About Window/main.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def open_about_window(_widget):
1515
developer_name="Angela Avery",
1616
version="1.2.3",
1717
comments=_(
18-
"Typeset is an app that doesn’t exist and is used as an example content for About Window.",
18+
"Typeset is an app that doesn’t exist and is used as an example content for About Window.",
1919
),
2020
website="https://example.org",
2121
issue_url="https://example.org",
@@ -24,21 +24,21 @@ def open_about_window(_widget):
2424
license_type=Gtk.License.GPL_3_0_ONLY,
2525
developers=["Angela Avery <[email protected]>"],
2626
artists=["GNOME Design Team"],
27-
translator_credits=_("translator-credits")
27+
translator_credits=_("translator-credits"),
2828
)
2929

3030
dialog.add_link(
3131
_("Documentation"),
32-
"https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.4/class.AboutWindow.html"
32+
"https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1.4/class.AboutWindow.html",
3333
)
3434

3535
dialog.add_legal_section(
3636
_("Fonts"),
3737
None,
3838
Gtk.License.CUSTOM,
3939
_(
40-
"This application uses font data from <a href='https://example.org'>somewhere</a>."
41-
)
40+
"This application uses font data from <a href='https://example.org'>somewhere</a>."
41+
),
4242
)
4343

4444
dialog.add_acknowledgement_section(_("Special thanks to"), [_("My cat")])

src/Library/demos/Avatar/main.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,12 @@
2020

2121
button.connect("clicked", lambda *_: on_clicked())
2222

23+
2324
def on_selected(_dialog, result):
2425
file = _dialog.open_finish(result)
2526
texture = Gdk.Texture.new_from_file(file)
2627
avatar_image.set_custom_image(texture)
2728

29+
2830
def on_clicked():
2931
file = dialog.open(workbench.window, None, on_selected)

src/Library/demos/Button/main.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
def on_clicked(button):
1919
print(f"{button.get_name()} clicked")
2020

21+
2122
for id in button_ids:
2223
button = workbench.builder.get_object(id)
2324
button.connect("clicked", on_clicked)

src/Library/demos/Calendar/main.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,12 @@
55
# calendar.get_date() returns a GLib.DateTime object
66
# https://docs.gtk.org/glib/struct.DateTime.html
77

8-
calendar.connect("notify::day",
9-
lambda *_: print(calendar.get_date().format("%e"))
10-
)
8+
calendar.connect("notify::day", lambda *_: print(calendar.get_date().format("%e")))
119

12-
calendar.connect("notify::month",
13-
lambda *_:print(calendar.get_date().format("%B"))
14-
)
10+
calendar.connect("notify::month", lambda *_: print(calendar.get_date().format("%B")))
1511

16-
calendar.connect("notify::year",
17-
lambda *_: print(calendar.get_date().format("%Y"))
18-
)
12+
calendar.connect("notify::year", lambda *_: print(calendar.get_date().format("%Y")))
1913

20-
calendar.connect("day-selected",
21-
lambda *_: print(calendar.get_date().format_iso8601())
22-
)
14+
calendar.connect("day-selected", lambda *_: print(calendar.get_date().format_iso8601()))
2315

2416
calendar.mark_day(15)

src/Library/demos/Checkboxes/main.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,18 @@
33
checkbox_1 = workbench.builder.get_object("checkbox_1")
44
checkbox_2 = workbench.builder.get_object("checkbox_2")
55

6-
checkbox_1.connect("toggled", lambda *_:
7-
print("Notifications Enabled"
8-
if checkbox_1.get_active()
9-
else "Notifications Disabled")
6+
checkbox_1.connect(
7+
"toggled",
8+
lambda *_: print(
9+
"Notifications Enabled" if checkbox_1.get_active() else "Notifications Disabled"
10+
),
1011
)
1112

12-
checkbox_2.connect("toggled", lambda *_:
13-
print("Changes will be auto-saved"
14-
if checkbox_2.get_active()
15-
else "Changes will not be auto-saved")
13+
checkbox_2.connect(
14+
"toggled",
15+
lambda *_: print(
16+
"Changes will be auto-saved"
17+
if checkbox_2.get_active()
18+
else "Changes will not be auto-saved"
19+
),
1620
)

0 commit comments

Comments
 (0)