jamesbowman / spidriver

SPI driver public repo
https://spidriver.com/
BSD 3-Clause "New" or "Revised" License
178 stars 56 forks source link

gui.py: Fixup to avoid deprecated warnings #29

Closed cc-michaelu closed 2 years ago

cc-michaelu commented 2 years ago

Currently when the gui.py sample is run the following warnings are logged to the console:

gui.py:51: PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. Please specify keyword(s) for "label" or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations
  r = Gtk.Button(name)
gui.py:45: PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. Please specify keyword(s) for "label" or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations
  r = Gtk.CheckButton(name)

This PR resolves the warnings by passing the label using Python keyword arguments (as the warning suggests).

cc-michaelu commented 2 years ago

Fix button code for CS/A/B to use correct PythonGtk method.

cc-michaelu commented 2 years ago

@jamesbowman , do you think this PR should be merged? Or should I close it?

jamesbowman commented 2 years ago

Yes, this PR make sense, thanks. Sorry I missed it. J.