From 12f467df4290c54dc81ad31a0de5c1581f010775 Mon Sep 17 00:00:00 2001 From: Vishal Pankaj Chandratreya <19171016+tfpf@users.noreply.github.com> Date: Sun, 7 Apr 2024 12:47:54 +0530 Subject: [PATCH] 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. --- README.md | 11 ++++++----- pyproject.toml | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 7dbd5e7..5a1c38f 100644 --- a/README.md +++ b/README.md @@ -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() @@ -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() diff --git a/pyproject.toml b/pyproject.toml index 77ec971..04e8406 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "ScrollableContainers" -version = "2.0.1" +version = "2.0.2" authors = [ { name = "Vishal Pankaj Chandratreya" }, ]