Skip to content

Commit 12f467d

Browse files
authored
Formatted the PyGTK code in README.md as Ruff would. (#6)
* Formatted the PyGTK code in `README.md` as Ruff would. * Except for the imports. * The way PyGTK has to be imported is inherently incompatible with the recommendation specified in PEP8 (the Python style guide). * Bumped version.
1 parent 4baf99b commit 12f467d

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,13 @@ Add widgets to the `area` attribute of a `ScrollableAreaQt5`/`ScrollableAreaQt6`
7373
In GTK, containers are widgets, so they can be aligned in other containers.
7474

7575
```Python
76-
import gi; gi.require_version('Gtk', '3.0')
77-
import gi.repository.Gtk as Gtk
7876
import itertools
7977

78+
import gi; gi.require_version("Gtk", "3.0")
79+
from gi.repository import Gtk
80+
8081
window = Gtk.Window()
81-
window.connect('destroy', Gtk.main_quit)
82+
window.connect("destroy", Gtk.main_quit)
8283
window.set_default_size(256, 128)
8384

8485
scrolled_window = Gtk.ScrolledWindow()
@@ -91,9 +92,9 @@ grid.set_column_spacing(20)
9192
scrolled_window.add(grid)
9293

9394
dim = 10
94-
for (i, j) in itertools.product(range(dim), repeat=2):
95+
for i, j in itertools.product(range(dim), repeat=2):
9596
label = Gtk.Label()
96-
label.set_label(f'Label\n({i}, {j})')
97+
label.set_label(f"Label\n({i}, {j})")
9798
grid.attach(label, j, i, 1, 1)
9899

99100
window.show_all()

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "ScrollableContainers"
7-
version = "2.0.1"
7+
version = "2.0.2"
88
authors = [
99
{ name = "Vishal Pankaj Chandratreya" },
1010
]

0 commit comments

Comments
 (0)