Skip to content

Commit

Permalink
Formatted the PyGTK code in README.md as Ruff would. (#6)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
tfpf authored Apr 7, 2024
1 parent 4baf99b commit 12f467d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,13 @@ Add widgets to the `area` attribute of a `ScrollableAreaQt5`/`ScrollableAreaQt6`
In GTK, containers are widgets, so they can be aligned in other containers.

```Python
import gi; gi.require_version('Gtk', '3.0')
import gi.repository.Gtk as Gtk
import itertools

import gi; gi.require_version("Gtk", "3.0")
from gi.repository import Gtk

window = Gtk.Window()
window.connect('destroy', Gtk.main_quit)
window.connect("destroy", Gtk.main_quit)
window.set_default_size(256, 128)

scrolled_window = Gtk.ScrolledWindow()
Expand All @@ -91,9 +92,9 @@ grid.set_column_spacing(20)
scrolled_window.add(grid)

dim = 10
for (i, j) in itertools.product(range(dim), repeat=2):
for i, j in itertools.product(range(dim), repeat=2):
label = Gtk.Label()
label.set_label(f'Label\n({i}, {j})')
label.set_label(f"Label\n({i}, {j})")
grid.attach(label, j, i, 1, 1)

window.show_all()
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "ScrollableContainers"
version = "2.0.1"
version = "2.0.2"
authors = [
{ name = "Vishal Pankaj Chandratreya" },
]
Expand Down

0 comments on commit 12f467d

Please sign in to comment.