rbn42 / panon

An Audio Visualizer Widget in KDE Plasma
GNU General Public License v3.0
192 stars 30 forks source link

Implemented Get Hot New Stuff #18

Closed flying-sheep closed 4 years ago

flying-sheep commented 4 years ago

The only thing I didn’t try to get working is to refresh the shader list after the GHNS dialog closes. An alternative would be to poll it as long as the config dialog is open.

The shaders are now in the new “Panon Shaders” category: https://store.kde.org/browse/cat/624/order/latest/. Did you migrate all of them?

grafik

Fixes #15

flying-sheep commented 4 years ago

Most of the changes are actually improvements of the python code:

  1. range(len(...)) is an antipattern. Use zip, enumerate or other itertools instead whenever possible
  2. os.path is obsolete. pathlib.Path makes for much nicer code
  3. if type(...) == SomeClass is discouraged. Use isinstance instead
  4. The shader_name += ' ' thing was hacky. Represent information at least as tuples, better NamedTuples or @dataclasses. I circumvented this by just searching shaders in all directories instead of storing the information where they came from.
rbn42 commented 4 years ago

Awesome Implementation!

Did you migrate all of them?

No, someone else did this for me I guess.

The only thing I didn’t try to get working is to refresh the shader list after the GHNS dialog closes. An alternative would be to poll it as long as the config dialog is open.

Well, I hope there is an event triggered by the dialog.

The shader_name += ' ' thing was hacky. Represent information at least as tuples, better NamedTuples or @dataclasses. I circumvented this by just searching shaders in all directories instead of storing the information where they came from.

Indeed, I will replace it with a better format.

And thanks for advice on python code, never heard pathlib before.

flying-sheep commented 4 years ago

thank you :smile: