OverlayHD Skin Development

Moderators: Gully, peteru

Post Reply
User avatar
peteru
Uber Wizard
Posts: 9737
Joined: Tue Jun 12, 2007 23:06
Location: Sydney, Australia
Contact:

OverlayHD Skin Development

Post by peteru » Thu Oct 01, 2015 20:55

IanSav wrote:The key used by OverlayHD is "config.OverlayHD.xxx=yyy".
Please don't do that. Read the documentation doc/PLUGINS. All plugin configuration must live under config.plugins. namespace. Also, the config names should be all lower case. Please rename your configuration values to config.plugins.skin.overlayhd.xxx

You really should push the source code for OverlayHD up to Bitbucket now. Both for GPLv2+ compliance and also so these mistakes can be spotted. If the fixes are trivial, you may even get someone else to improve your code and send you a pull-request. :D

"Beauty lies in the hands of the beer holder."
Blog.

IanSav
Uber Wizard
Posts: 16846
Joined: Tue May 29, 2007 15:00
Location: Melbourne, Australia

Re: OverlayHD Skin Colour Themes...

Post by IanSav » Thu Oct 01, 2015 21:47

Hi PeterU,

It is such a shame that all these changes couldn't have been pointed out during the private beta testing period. Changing it all now is going to negatively affect users! :(

The documentation appears to contain errors. Given your previous comments and the issues this created last time I didn't give it much credence. There is no specification regarding the case of the settings, only the root path.

Regards,
Ian.
Last edited by IanSav on Thu Oct 01, 2015 21:54, edited 1 time in total.

User avatar
peteru
Uber Wizard
Posts: 9737
Joined: Tue Jun 12, 2007 23:06
Location: Sydney, Australia
Contact:

Re: OverlayHD Skin Colour Themes...

Post by peteru » Thu Oct 01, 2015 21:51

Hard to do without source code being available. Until you posted the information earlier today, no one was aware of you doing this. On the other hand, the plugin documentation has been in place for years.

"Beauty lies in the hands of the beer holder."
Blog.

IanSav
Uber Wizard
Posts: 16846
Joined: Tue May 29, 2007 15:00
Location: Melbourne, Australia

Re: OverlayHD Skin Colour Themes...

Post by IanSav » Thu Oct 01, 2015 21:57

Hi PeterU,

Not that hard. Just look at the settings file!

Regards,
Ian.

User avatar
peteru
Uber Wizard
Posts: 9737
Joined: Tue Jun 12, 2007 23:06
Location: Sydney, Australia
Contact:

Re: OverlayHD Skin Colour Themes...

Post by peteru » Thu Oct 01, 2015 22:00

IanSav wrote:The documentation appears to contain errors. Given your previous comments and the issues this created last time I didn't give it much credence.
I'm not sure which previous comments or issues you are referring to, however if the documentation is lacking, let's fix it.

If there are typos or grammatical errors that are obvious, feel free to make corrections and submit a pull-request.

If there are contradictions or areas that are unclear, let's discuss those parts of documentation in the forums and once things have been clarified, you can update the documentation and again, issue a pull-request with the corrected version.

"Beauty lies in the hands of the beer holder."
Blog.

User avatar
peteru
Uber Wizard
Posts: 9737
Joined: Tue Jun 12, 2007 23:06
Location: Sydney, Australia
Contact:

Re: OverlayHD Skin Colour Themes...

Post by peteru » Thu Oct 01, 2015 22:05

IanSav wrote:Not that hard. Just look at the settings file!
First of all, why would I go examining my settings file after installing a skin?

Second of all, now that you made the suggestion, I did look at my settings file. There are no config values in there generated by the skin. I left everything at default so that I can experience the skin as intended by the designer.

"Beauty lies in the hands of the beer holder."
Blog.

IanSav
Uber Wizard
Posts: 16846
Joined: Tue May 29, 2007 15:00
Location: Melbourne, Australia

Re: OverlayHD Skin Colour Themes...

Post by IanSav » Fri Oct 02, 2015 12:28

Hi,

If all is going well the on-line repository should be updating now. The SourceTree client has been a bit of a pig and taken lots of time (days) to sort out but I think I have rebuilt the config correctly this time, I hope! :?

Unfortunately, this has detracted from the task of actually updating the skin. If I have ButBucket under control I will go back to completing the next update. I still want to have something ready for today. I have implemented the config change as requested above. I have also come up with a small command script to convert the old OverlayHD settings to the new format.

Given these recent posts have nothing to do with the topic could these please be split off to a new thread "OverlayHD Development..."

Regards,
Ian.

IanSav
Uber Wizard
Posts: 16846
Joined: Tue May 29, 2007 15:00
Location: Melbourne, Australia

Re: OverlayHD Skin Colour Themes...

Post by IanSav » Fri Oct 02, 2015 12:37

Hi,

Okay, it looks like the contents are there. Can someone please tell me if I have completed the task correctly.

Regards,
Ian.

User avatar
peteru
Uber Wizard
Posts: 9737
Joined: Tue Jun 12, 2007 23:06
Location: Sydney, Australia
Contact:

Re: OverlayHD Skin Colour Themes...

Post by peteru » Fri Oct 02, 2015 15:44

The OverlayHD repository on Bitbucket looks fine at a first glance. I have not had a chance to actually look at the code yet, but I'll get to it...

"Beauty lies in the hands of the beer holder."
Blog.

IanSav
Uber Wizard
Posts: 16846
Joined: Tue May 29, 2007 15:00
Location: Melbourne, Australia

Re: OverlayHD Skin Development

Post by IanSav » Fri Oct 02, 2015 15:50

Hi PeterU,

If you find any repository type issues I may need some help with SourceTree to get it resolved. :) With the help of a friend and lots of wasted effort and time I finally got to where it is now. (The problem was that the clone and sync were not connecting with the source cache on my NAS.)

Regards,
Ian.

User avatar
peteru
Uber Wizard
Posts: 9737
Joined: Tue Jun 12, 2007 23:06
Location: Sydney, Australia
Contact:

Re: OverlayHD Skin Development

Post by peteru » Fri Oct 02, 2015 16:26

I'm having a quick squiz at the code now. I'll post my comments as I go...

First a general comment about code style and conventions. As you probably noticed, the enigma2 source code is a mess. Which is a shame, because the Python programming community has quite a good set of guidelines for these things. These guidelines are known as PEP8. There are even tools to check your code and suggest improvements. Both prl and myself tend to run our code through the PEP8 checking tools to help us. If you haven't already done so, I suggest that you do the same. Of course, you should also have a read of PEP8.

In terms of conventions, there are different naming schemes for classes, variables and functions. These conventions usually cover things such as verb/noun usage and capitalisation. It may be the case that the Python conventions are different to those you may be used to in other programming languages.

As an example, PEP8 suggests that "Modules should have short, all-lowercase names." Since the OverlayHD plugin is a Python module, it should have been all lower case. Similarly, "Class names should normally use the CapWords convention." and "Function names should be lowercase, with words separated by underscores as necessary to improve readability." Now, with enigma2 source code, this could become a bit of a problem, because the base classes will most likely use "mixedCase". I think that's mainly because a lot of the Python code is built on top of the C++ libraries, which use those conventions. It's up to you whether you are happy with either mixing two conventions (which would help you detect whether you are dealing with an enigma2 function vs your own) or whether you will stick with the enigma2 convention all the way (which gives you consistency in your code).

It's probably too late to change OverlayHD now, but it's something to keep in mind for the future.

Debug output "print" statements are fine for development and beta code (or code that often gets unexpected results), but as the plugin matures you should comment out the remaining debug "print" statements so that the logs are not too noisy. Even better, you may wish to replace simple "print" statements with conditional versions so that you can turn debug logging on/off with a variable.

You do not need to use setValue() and getValue() on config. entries. You can just say config.blah.value = 5

In buildColour(), are you sure about this?

Code: Select all

return gRGB(colorNames[colour.getValue()].argb() | trans)
I suspect you may want to mask out the old alpha value and replace it with the new one, rather than just set additional bits.

"Beauty lies in the hands of the beer holder."
Blog.

User avatar
peteru
Uber Wizard
Posts: 9737
Joined: Tue Jun 12, 2007 23:06
Location: Sydney, Australia
Contact:

Re: OverlayHD Skin Development

Post by peteru » Fri Oct 02, 2015 16:29

IanSav wrote:If you find any repository type issues I may need some help with SourceTree to get it resolved.
I don't use SourceTree, so won't be able to help with that particular piece of software. I just use plain git from command line as well as the bundled "git gui" and "gitk" that ship with standard git distribution. However, if you have any git specific questions, feel free to post. It's likely that the same principles will apply in most software.

"Beauty lies in the hands of the beer holder."
Blog.

prl
Wizard God
Posts: 32705
Joined: Tue Sep 04, 2007 13:49
Location: Canberra; Black Mountain Tower transmitters

Re: OverlayHD Skin Development

Post by prl » Fri Oct 02, 2015 17:09

peteru wrote:... As an example, PEP8 suggests that "Modules should have short, all-lowercase names." Since the OverlayHD plugin is a Python module, it should have been all lower case. ...
The actual practice in almost all enigma2 fixed code in the easy-ui-4 repository, Plugins in the easy-ui-4 (including the IceTV plugin) and plugins in the enigma2-plugins repository is to use CamelCase in module names apart from plugin.py and __init__.py in plugins.

I'm aware of the problems that can cause in case-insensitive filesystems like NTFS and HFS+ case-insensitive. It doesn't cause any actual problems with HFS+ for those repositories.
Peter
T4 HDMI
U4, T4, T3, T2, V2 test/development machines
Sony BDV-9200W HT system
LG OLED55C9PTA 55" OLED TV

IanSav
Uber Wizard
Posts: 16846
Joined: Tue May 29, 2007 15:00
Location: Melbourne, Australia

Re: OverlayHD Skin Development

Post by IanSav » Fri Oct 02, 2015 17:34

Hi PeterU,
peteru wrote:First a general comment about code style and conventions. As you probably noticed, the enigma2 source code is a mess. Which is a shame, because the Python programming community has quite a good set of guidelines for these things. These guidelines are known as PEP8. There are even tools to check your code and suggest improvements. Both prl and myself tend to run our code through the PEP8 checking tools to help us. If you haven't already done so, I suggest that you do the same. Of course, you should also have a read of PEP8.
Ages ago I looked into PEP8 and didn't find something for Windows XP nor was it particularly "light" reading. Most of it was/is lost given my "beginner" or "noob" status with Python. At the moment I am trying to use self discipline to maintain clean and consistently formatted code.
peteru wrote:In terms of conventions, there are different naming schemes for classes, variables and functions. These conventions usually cover things such as verb/noun usage and capitalisation. It may be the case that the Python conventions are different to those you may be used to in other programming languages.

As an example, PEP8 suggests that "Modules should have short, all-lowercase names." Since the OverlayHD plugin is a Python module, it should have been all lower case. Similarly, "Class names should normally use the CapWords convention." and "Function names should be lowercase, with words separated by underscores as necessary to improve readability." Now, with enigma2 source code, this could become a bit of a problem, because the base classes will most likely use "mixedCase". I think that's mainly because a lot of the Python code is built on top of the C++ libraries, which use those conventions. It's up to you whether you are happy with either mixing two conventions (which would help you detect whether you are dealing with an enigma2 function vs your own) or whether you will stick with the enigma2 convention all the way (which gives you consistency in your code).

It's probably too late to change OverlayHD now, but it's something to keep in mind for the future.
I have adapted my own coding style to match the sort of code I was finding in Enigma2. I think it is safer to stay with what I am doing here rather than tempt fate with ballsing up the whole thing.
peteru wrote:Debug output "print" statements are fine for development and beta code (or code that often gets unexpected results), but as the plugin matures you should comment out the remaining debug "print" statements so that the logs are not too noisy. Even better, you may wish to replace simple "print" statements with conditional versions so that you can turn debug logging on/off with a variable.
I have deliberately kept the logging to a minimum. I would prefer to keep the few lines that are printed as they confirm what is going on. Without this debugging issues on user's machines could be problematic.

To alleviate some of your concern the messages have been shortened to reduce the output even more. Under normal use there is only a single line printed when the system starts that confirms that OverlayHD has loaded and updated the skin. The only other output occurs while the user is interacting with the Skin Manager.
peteru wrote:You do not need to use setValue() and getValue() on config. entries. You can just say config.blah.value = 5
I seem to remember Prl suggesting that the .getValue() / .getValue() functions were better to use. Should I switch back to the .value version?
peteru wrote:In buildColour(), are you sure about this?

Code: Select all

return gRGB(colorNames[colour.getValue()].argb() | trans)
I suspect you may want to mask out the old alpha value and replace it with the new one, rather than just set additional bits.
There is no old alpha value. The colours stored in the settings file are plain colours with no alpha value. Alpha values are stored separately.

Apart from the comments already made how does the code look. It is my first effort at new code (not reworking issues / bugs in existing code).

Regards,
Ian.

IanSav
Uber Wizard
Posts: 16846
Joined: Tue May 29, 2007 15:00
Location: Melbourne, Australia

Re: OverlayHD Skin Development

Post by IanSav » Fri Oct 02, 2015 17:34

Hi PeterU,
peteru wrote:
IanSav wrote:If you find any repository type issues I may need some help with SourceTree to get it resolved.
I don't use SourceTree, so won't be able to help with that particular piece of software. I just use plain git from command line as well as the bundled "git gui" and "gitk" that ship with standard git distribution. However, if you have any git specific questions, feel free to post. It's likely that the same principles will apply in most software.
If you didn't find any repository issues then there should be nothing for me to fix. :)

Regards,
Ian.

IanSav
Uber Wizard
Posts: 16846
Joined: Tue May 29, 2007 15:00
Location: Melbourne, Australia

Re: OverlayHD Skin Development

Post by IanSav » Fri Oct 02, 2015 17:48

Hi PeterU,

With regard to the amount of logging being output, I think you will need to look at other code that is dumping LOTS of data in the logs. The volume of messages relating to HbbTV, GeneralMenu, file clean ups, tuner set up etc. Is far more significant that generated by OverlayHD. ;) (Edit: It looks like GeneralMenu is a bit better behaved after Prl's cleanup but it is still chatty. :))

It would also be helpful if all the messages correctly Identify which module which is producing the output. I have become accustomed to the "ModuleName]" prefix. :)

Regards,
Ian.

prl
Wizard God
Posts: 32705
Joined: Tue Sep 04, 2007 13:49
Location: Canberra; Black Mountain Tower transmitters

Re: OverlayHD Skin Development

Post by prl » Fri Oct 02, 2015 17:53

IanSav wrote:...
peteru wrote:You do not need to use setValue() and getValue() on config. entries. You can just say config.blah.value = 5
I seem to remember Prl suggesting that the .getValue() / .getValue() functions were better to use. Should I switch back to the .value version?
...
If I did, it may have been early on when I wasn't fully aware of the interface to config. Some of the code still uses getValue()Setbalue, but I agree with peteru that using the .value property is cleaner.
Peter
T4 HDMI
U4, T4, T3, T2, V2 test/development machines
Sony BDV-9200W HT system
LG OLED55C9PTA 55" OLED TV

IanSav
Uber Wizard
Posts: 16846
Joined: Tue May 29, 2007 15:00
Location: Melbourne, Australia

Re: OverlayHD Skin Development

Post by IanSav » Fri Oct 02, 2015 19:02

Hi Prl,

Read just in time.

I am about to start building the image for the OverlayHD update right now. I will add this suggestion and give it a quick test before finishing the update. Thank you for the confirmation.

Regards,
Ian.

Post Reply

Return to “Skins”