After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 781321 - Port GNOME Tweak Tool to Python 3
Port GNOME Tweak Tool to Python 3
Status: RESOLVED FIXED
Product: gnome-tweak-tool
Classification: Applications
Component: general
3.24.x
Other Linux
: Normal normal
: ---
Assigned To: GNOME Tweak Tool maintainer(s)
GNOME Tweak Tool maintainer(s)
: 740219 771911 (view as bug list)
Depends on:
Blocks: 783228
 
 
Reported: 2017-04-14 16:55 UTC by Ikey Doherty
Modified: 2017-06-06 21:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Port GNOME Tweak Tool to Python 3 (15.32 KB, patch)
2017-04-14 16:58 UTC, Ikey Doherty
rejected Details | Review
Port GNOME Tweak Tool to Python 3 (15.38 KB, patch)
2017-04-14 17:06 UTC, Ikey Doherty
none Details | Review
Port GNOME Tweak Tool to Python 3 (16.20 KB, patch)
2017-04-25 12:11 UTC, Ikey Doherty
rejected Details | Review
Port GNOME Tweak Tool to Python 3 (15.95 KB, patch)
2017-04-25 12:19 UTC, Ikey Doherty
none Details | Review
Port GNOME Tweak Tool to Python 3 (16.21 KB, patch)
2017-05-31 18:29 UTC, Florian Müllner
committed Details | Review
gtksettings: Fix another 2 -> 3 issue (771 bytes, patch)
2017-05-31 22:53 UTC, Florian Müllner
committed Details | Review
windows: Port from 'cmp' to 'key' function (1.18 KB, patch)
2017-05-31 22:53 UTC, Florian Müllner
none Details | Review
windows: Port from 'cmp' to 'key' function (2.17 KB, patch)
2017-06-01 00:19 UTC, Jeremy Bicha
committed Details | Review
gtksettings: Create config directories as necessary (1.16 KB, patch)
2017-06-01 10:38 UTC, Florian Müllner
committed Details | Review

Description Ikey Doherty 2017-04-14 16:55:05 UTC
TL;DR port it to Python 3 so that distros don't need py2 gobject and py3 gobject.
I'm going to attach a couple of patches here as I already have this work done.
Just need a bugid to stick in my patches
Comment 1 Ikey Doherty 2017-04-14 16:58:56 UTC
Created attachment 349874 [details] [review]
Port GNOME Tweak Tool to Python 3

This patch is for the GNOME 3.24 release update (gnome-3-24 branch)
Comment 2 Ikey Doherty 2017-04-14 17:06:26 UTC
Created attachment 349875 [details] [review]
Port GNOME Tweak Tool to Python 3

Similar to the backport324 patch, this one is for git master
Comment 3 Ikey Doherty 2017-04-14 17:08:07 UTC
OK all patches added
Comment 4 Ikey Doherty 2017-04-17 03:48:02 UTC
OK please hold off on these for now a bug came up with the Python 3 conversion, when reading autostart files.
Comment 5 Ikey Doherty 2017-04-25 12:11:48 UTC
Created attachment 350391 [details] [review]
Port GNOME Tweak Tool to Python 3

Updated patch for GTT 3.24 which resolves the locale issues
Comment 6 Ikey Doherty 2017-04-25 12:19:33 UTC
Created attachment 350392 [details] [review]
Port GNOME Tweak Tool to Python 3

Replace older master-patch to port GTT git-master to Python 3
Comment 7 Ikey Doherty 2017-04-25 12:20:09 UTC
Uploaded 2 new patches, fixing the locale issue I ran into. Python 3 changed subprocess to default to returning bytes streams, which cannot be `.split(`
Comment 8 Jeremy Bicha 2017-05-22 15:34:14 UTC
Review of attachment 349874 [details] [review]:

This conversion is not appropriate for a stable bug-fix series.
Comment 9 Jeremy Bicha 2017-05-22 15:35:27 UTC
Review of attachment 350391 [details] [review]:

This isn't appropriate for the gnome-3-24 branch.
Comment 10 Ikey Doherty 2017-05-22 16:47:34 UTC
> This conversion is not appropriate for a stable bug-fix series.

No explanation provided.

> This isn't appropriate for the gnome-3-24 branch.

Again, no explanation provided. Defeats the purpose of "review".
Comment 11 Jeremy Bicha 2017-05-23 14:12:17 UTC
Ikey, I apologize for being too concise.

Switching from Python2 to Python3 is inappropriate for a GNOME stable release when the code is frozen except for minimal bug fixes. (Switching the programming language to a major new version is not a minimal bug fix.)

https://wiki.gnome.org/ThreePointTwentythree

I am not really the maintainer of Tweak Tool so I'm not really able to give you a full review, but I might try out your patch later and reply here.

I did ask rtcm to take a look at this bug. It's on his To Do list.
Comment 12 Ikey Doherty 2017-05-24 03:35:45 UTC
With that said, the main ticket items are:

 - Conceptually - are the bugfixes sound? i.e. the !shell crash
 - Can it be applied to master/future gtk4
Comment 13 Jeremy Bicha 2017-05-24 03:54:40 UTC
The next stable version of GNOME is 3.26. New major GNOME releases happen every 6 months and there are no plans at this time for a GNOME 4.

https://wiki.gnome.org/ThreePointTwentyfive

So to answer your second question, yes, this would be nice to have in the next stable release. All I did earlier was to reject your GNOME 3.24 patch. The one against master is still open. I apologize if this was a bit confusing and if I was unclear.

I really do appreciate your working on this patch since I'd like to see this conversion in time for Ubuntu 17.10 later this year too! :)
Comment 14 Jeremy Bicha 2017-05-26 19:35:55 UTC
Review of attachment 350392 [details] [review]:

You missed one print statement. Otherwise, your patch seems to work here!

  • File "gtweak/tweaks/tweak_group_shell_extensions.py", line 187
    print result
SyntaxError: Missing parentheses in call to 'print'

Comment 15 Jeremy Bicha 2017-05-27 15:32:52 UTC
In the Windows panel, the Titlebar Buttons toggle switches for Minimize and Maximize don't work:

Traceback (most recent call last):
  • File "/usr/lib/python3/dist-packages/gtweak/widgets.py", line 535 in _on_toggled
    self.set_active(sw.get_active())
  • File "/usr/lib/python3/dist-packages/gtweak/tweaks/tweak_group_windows.py", line 60 in set_active
    rsplit.sort(cmp=sort_buttons)
TypeError: 'cmp' is an invalid keyword argument for this function
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/gtweak/widgets.py", line 535, in _on_toggled
    self.set_active(sw.get_active())
  File "/usr/lib/python3/dist-packages/gtweak/tweaks/tweak_group_windows.py", line 52, in set_active
    rsplit.remove(self.value)
ValueError: list.remove(x): x not in list
Comment 16 Jeremy Bicha 2017-05-27 15:41:38 UTC
The Global Dark Theme switch also isn't working.
Comment 17 Jeremy Bicha 2017-05-29 00:50:01 UTC
*** Bug 771911 has been marked as a duplicate of this bug. ***
Comment 18 Jeremy Bicha 2017-05-30 02:46:21 UTC
*** Bug 740219 has been marked as a duplicate of this bug. ***
Comment 19 Florian Müllner 2017-05-31 18:29:43 UTC
Created attachment 352963 [details] [review]
Port GNOME Tweak Tool to Python 3

I've updated the patch to changes on master for bug 783228. I didn't touch anything else, so comment #15 and #16 should still apply ...
Comment 20 Florian Müllner 2017-05-31 22:53:06 UTC
Created attachment 352973 [details] [review]
gtksettings: Fix another 2 -> 3 issue
Comment 21 Florian Müllner 2017-05-31 22:53:16 UTC
Created attachment 352974 [details] [review]
windows: Port from 'cmp' to 'key' function
Comment 22 Florian Müllner 2017-05-31 22:54:08 UTC
The last two patches fix the dark- and maximize/minimize switches, feel free to squash ...
Comment 23 Jeremy Bicha 2017-06-01 00:19:26 UTC
Created attachment 352977 [details] [review]
windows: Port from 'cmp' to 'key' function

Florian, here's an improved version of this patch to also handle window buttons on the left and keep the 'appmenu' key (needed if a user turns off Application Menu in the Top Bar panel).

Also, I remove other values (like 'spacer') that Tweak Tool doesn't support right now, but which would break the sort function if present
Comment 24 Florian Müllner 2017-06-01 10:38:20 UTC
Created attachment 352995 [details] [review]
gtksettings: Create config directories as necessary

Another bit for squashing
Comment 25 Jeremy Bicha 2017-06-06 19:24:10 UTC
Review of attachment 352963 [details] [review]:

Thanks!

Florian, Ikey doesn't have git commit rights yet, so can you push this?
Comment 26 Jeremy Bicha 2017-06-06 19:24:43 UTC
Review of attachment 352973 [details] [review]:

ok
Comment 27 Jeremy Bicha 2017-06-06 19:24:55 UTC
Review of attachment 352995 [details] [review]:

This was already pushed.
Comment 28 Florian Müllner 2017-06-06 21:18:32 UTC
Attachment 352963 [details] pushed as 4216c7a - Port GNOME Tweak Tool to Python 3

(In reply to Jeremy Bicha from comment #27)
> Review of attachment 352995 [details] [review] [review]:
> 
> This was already pushed.

The python2 version, not this one :-)