Skip to content

[Picon.py] Cosmetic readability changes#4338

Closed
AbuBaniaz wants to merge 1 commit into
OpenPLi:scarthgapfrom
AbuBaniaz:picon_cosmetic
Closed

[Picon.py] Cosmetic readability changes#4338
AbuBaniaz wants to merge 1 commit into
OpenPLi:scarthgapfrom
AbuBaniaz:picon_cosmetic

Conversation

@AbuBaniaz
Copy link
Copy Markdown
Contributor

Better shows the order of selection

Better shows the order of selection
@Huevos
Copy link
Copy Markdown
Contributor

Huevos commented May 18, 2026

More AI code.

@WanWizard
Copy link
Copy Markdown
Member

May be so, but I don't think improving readability is AI slop.

Or is there more in this PR than just improving readability?

@Huevos
Copy link
Copy Markdown
Contributor

Huevos commented May 18, 2026

Does it improve readability.

As I see it it adds a lot of bulk for no good reason.

This is the exact opposite type of code that Littlesat likes.

The current code uses simple oneliners where this adds intermediate variables to the namespace.

To me that makes this commit do the opposite of what the title suggests. It actually makes it harder to read. Adds 20 lines of unnecessary code. Increase the file length by 20%.

But you do what you think best, but certainly will not be added to our repo.

@Huevos
Copy link
Copy Markdown
Contributor

Huevos commented May 18, 2026

And by the way it changes the logic, so is going to break stuff.

@WanWizard
Copy link
Copy Markdown
Member

WanWizard commented May 18, 2026

It was a question, not a statement, as you know I'm not very proficient in Python.

but if it changes the logic, than that's a big NO in my book.

@Huevos
Copy link
Copy Markdown
Contributor

Huevos commented May 18, 2026

It removes this commit: OpenViX/enigma2@ebe467d

@WanWizard
Copy link
Copy Markdown
Member

@littlesat close?

@Huevos
Copy link
Copy Markdown
Contributor

Huevos commented May 18, 2026

The commit above was important. @DimitarCC found several cases where the original algorithm failed without it.

@AbuBaniaz
Copy link
Copy Markdown
Contributor Author

The order of the search logic is still:

Full service reference
SID, TSID, ONID and NAMESPACE with padding
SID, TSID, ONID and NAMESPACE with padding, ignoring namespace subnet differences
UTF8SNP name
UTF8SNP name with resolution suffix stripped
SNP name
SNP name with resolution suffix stripped

The change was submitted to make it more readable as to the order in which the picons are selected.

Somoene has consistently criticised Littlesat's one liners that remove readability. It is a bit rich to start using Littlesat's approach as a basis to obstruct changes.

@AbuBaniaz
Copy link
Copy Markdown
Contributor Author

The history of the changes prior to this commit that allegedly broken is here:
https://github.com/OpenViX/enigma2/commits/ebe467d8c93a107aa73e6bea0d0be52296d63ef7/lib/python/Components/Renderer/Picon.py

If someone wants to make the changes in a better way, please do. The file currently is not human readable.

@Huevos
Copy link
Copy Markdown
Contributor

Huevos commented May 18, 2026

The order of the search logic is still:

Full service reference
SID, TSID, ONID and NAMESPACE with padding
SID, TSID, ONID and NAMESPACE with padding, ignoring namespace subnet differences
UTF8SNP name
UTF8SNP name with resolution suffix stripped
SNP name
SNP name with resolution suffix stripped

The change was submitted to make it more readable as to the order in which the picons are selected.

Somoene has consistently criticised Littlesat's one liners that remove readability. It is a bit rich to start using Littlesat's approach as a basis to obstruct changes.

And that order changes the logic of the original. Which is what happens when AI plays with code.

@AbuBaniaz
Copy link
Copy Markdown
Contributor Author

I deliberately had the utf8snp names to be together in the file and snp names to be together. So there is a slight change in order. They are now in the the order in which I understood them to be. This minor order issue highlights the fact that the search order was never readable nor was it documented correctly.

From:

utf8_name
legacy_name
utf8_name with suffix stripped
legacy_name with suffix stripped

To:

utf8_name
utf8_stripped
legacy_name
legacy_stripped

@AbuBaniaz AbuBaniaz closed this May 18, 2026
@Huevos
Copy link
Copy Markdown
Contributor

Huevos commented May 18, 2026

I deliberately had the utf8snp names to be together in the file and snp names to be together. So there is a slight change in order. They are now in the the order in which I understood them to be. This minor order issue highlights the fact that the search order was never readable nor was it documented correctly.

From:

utf8_name
legacy_name
utf8_name with suffix stripped
legacy_name with suffix stripped

To:

utf8_name
utf8_stripped
legacy_name
legacy_stripped

And that order is wrong which @DimitarCC discovered 2 years ago during extensive testing.

@AbuBaniaz
Copy link
Copy Markdown
Contributor Author

That order is correct to me. If I am using utf8 names, why would I want it to be interjected by SNP.

I have closed the pull request, you can stop making things up.

@littlesat
Copy link
Copy Markdown
Member

Doing the picons by service name was always a bad idea. Therefor I also refuse it for a longer time. The only method that is correct and unique for now is by reference. To do it really right we need a good re-design or go for reference only.

@AbuBaniaz AbuBaniaz deleted the picon_cosmetic branch May 20, 2026 00:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants