Migrate kwin animation speed to kdeglobals
ClosedPublic

Authored by davidedmundson on Sep 19 2019, 1:47 PM.

Details

Test Plan

Tested output piping test lines into the script with different settings
Removed from my kdeglobals
Invoked script. New value appeared

(note that if you manually test multiple times locally you have to cleanup the $version info from
both kdeglobals and kwinrc or the migration will be skipped)

Diff Detail

Repository
R108 KWin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
davidedmundson created this revision.Sep 19 2019, 1:47 PM
Restricted Application added a project: KWin. · View Herald TranscriptSep 19 2019, 1:47 PM
Restricted Application added a subscriber: kwin. · View Herald Transcript
davidedmundson requested review of this revision.Sep 19 2019, 1:47 PM
zzag accepted this revision.Sep 19 2019, 3:41 PM
zzag added a subscriber: zzag.
zzag added inline comments.
kconf_update/kwin-5.18-move-animspeed.py
6

Naming nitpick: speed_map

14–15

A Python 2 developer detected. No whitespace between print and (.

This revision is now accepted and ready to land.Sep 19 2019, 3:41 PM
This revision was automatically updated to reflect the committed changes.
fvogt reopened this revision.Sep 27 2019, 7:20 AM
fvogt added a subscriber: fvogt.
fvogt added inline comments.
kconf_update/kwin-5.18-move-animspeed.py
1

/bin/env doesn't exist pre /usr-merge.

Does this really have to be python2?

IMO using /usr/bin/python3 would be the best option or converting it to a shell script

This revision is now accepted and ready to land.Sep 27 2019, 7:20 AM
zzag added inline comments.Sep 27 2019, 7:50 AM
kconf_update/kwin-5.18-move-animspeed.py
1

Does this really have to be python2?

python doesn't necessarily means python2, e.g. Python 3 is default on Arch Linux.

IMO using /usr/bin/python3 would be the best option

Does it really matter though?

lbeltrame added inline comments.
kconf_update/kwin-5.18-move-animspeed.py
1

Does it really matter though?

It does when Python2 is going EOL in a few months and that most distributions that aren't LTS are trying to limit its presence in default installs.

fvogt added inline comments.Sep 27 2019, 7:57 AM
kconf_update/kwin-5.18-move-animspeed.py
1

python doesn't necessarily means python2, e.g. Python 3 is default on Arch Linux.

Yes, but in other cases it does mean python2. The PEP about that will probably never be implemented everywhere (and is IMO also wrong, a script has to state whether it's 2 or 3 compatible).

Does it really matter though?

Yes. Currently without patching kwin5 would not be installable as /bin/env doesn't exist leading to dependency issues.
Ignoring that, it would be the only package in a default installation pulling in python 2 again, which is a regression.

davidedmundson added inline comments.Sep 27 2019, 9:27 AM
kconf_update/kwin-5.18-move-animspeed.py
1

It does not need python2.
It's written and tested against python3.

My understanding was that /bin/env was the "correct" way to choose python in weird distros.

I ideally want to avoid having some cmake stuff and then reconfiguring this script. If hardcoding /usr/bin/python3 works for distros, that's more than fine with me.

fvogt added inline comments.Sep 27 2019, 9:43 AM
kconf_update/kwin-5.18-move-animspeed.py
1

My understanding was that /bin/env was the "correct" way to choose python in weird distros.

With /usr/bin/env yes, but what "python" means depends on the distro. For some it doesn't exist, for some it's py2 and for some it's py3...
Also see https://www.python.org/dev/peps/pep-0394/#for-python-script-publishers.

If hardcoding /usr/bin/python3 works for distros, that's more than fine with me.

I can't think of a situation where this would fail. /usr/bin/env python3 maybe if someone wants to use python3 from /usr/local or ~/bin.

davidedmundson added inline comments.Sep 27 2019, 1:51 PM
kconf_update/kwin-5.18-move-animspeed.py
1

done