Jump to content


Photo

ComponentsFromSkin


  • Please log in to reply
43 replies to this topic

#1 a.k.a. Uchkun

  • Senior Member
  • 94 posts

+26
Good

Posted 16 October 2014 - 12:15

ComponentsFromSkin

 

 

This tool for help those who will adapting skins for images Blekhol, OpenPLi and VTI. The plugin creates lists the components that are not exists in the images by default. Plugin works is very simple. Put file skin.xml from required skin to the folder tmp of your receiver, and go to the plugin window, select the desired image and press OK.
That's all.
It's In the tmp folder will created two files named converter and renderer, in which you can find a lists of the converters and renderers. In this lists will not be shown converters and renderers, which exists in the image by default.

For example

 

/tmp/converter

ExtraNumText
ExtendedServiceInfo
SmartInfo
Bitrate2
ExtremeInfo
CaidInfo2
QuickEcmInfo
ServiceName2
ServiceOrbitalPosition2
RefString
CoolConverter
EMCClockToText
EMCServicePosition
EMCEventName
EMCServiceTime
EMCMovieInfo

/tmp/renderer

Watches
VVolumeText
ScrollLabel
PiconUni
NextEvent2
Reference
CoolPicon
CoolPico
RollerCharLCD
EpgShortTitle

87acbfcb0242.jpg

314e8f1520fd.jpg

 

 

e5c18afeb086.jpg
 

 

314e8f1520fd.jpg

Attached Files



Re: ComponentsFromSkin #2 jpuigs

  • Senior Member
  • 1,143 posts

+32
Good

Posted 16 October 2014 - 21:52

Thanks.

May I suggest you an improvement ?

It's good to know which components are not by default, of course, but It would be even better to know if they are already present on own receiver.

In other words, to know (by reading the skin.xml file) which files are needed, and if we have already those files in our box.


Edited by jpuigs, 16 October 2014 - 21:54.

Enigma is getting old....

 

Spoiler

Re: ComponentsFromSkin #3 a.k.a. Uchkun

  • Senior Member
  • 94 posts

+26
Good

Posted 17 October 2014 - 05:08

It is not hard to do

Will create plus two files in the folder tmp, which would list the components that are not in your system

converterneed

rendererneed

Do you want it? Then tonight, I'll create the next version



Re: ComponentsFromSkin #4 jpuigs

  • Senior Member
  • 1,143 posts

+32
Good

Posted 17 October 2014 - 12:11

I did some tests yesterday night, but I have one problem.

I'm not a phyton expert, so I may have missed something.

 

I use Openpli, so I only modified the converter detection on option "2" to make tests.

But I have one file (PaxRefString) which appears twice:

 

/tmp/converter:

PaxRefString Not Found
YWeather OK
ServiceName2 OK
PaxRefString Not Found
CaidInfo2 OK
PaxCaidDisplay OK
CpuUsage OK
pliLayoutInfo OK

Here is what I've modified:

 

Instead of: (line 153)

if x not in dd:
       dd.append(x)

Changed to:

      if ((x + ' OK') or (x + ' Not Found')) not in dd:
           if fileExists("/usr/lib/enigma2/python/Components/Converter/" + x +".pyo"):
                  dd.append(x + " OK")
           else:
                  dd.append(x + " Not Found")

Enigma is getting old....

 

Spoiler

Re: ComponentsFromSkin #5 jpuigs

  • Senior Member
  • 1,143 posts

+32
Good

Posted 17 October 2014 - 12:20

More tests:

If I don't remove PaxRefString file (I removed to check 'Not Found' detection), then it works fine and appear once:

PaxRefString OK
YWeather OK
ServiceName2 OK
CaidInfo2 OK
PaxCaidDisplay OK
CpuUsage OK
pliLayoutInfo OK

Enigma is getting old....

 

Spoiler

Re: ComponentsFromSkin #6 a.k.a. Uchkun

  • Senior Member
  • 94 posts

+26
Good

Posted 17 October 2014 - 12:53





if fileExists("/usr/lib/enigma2/python/Components/Converter/" + x +".pyo"):

It is better to do it than through the fileExists, but with a method listdir from module os





os.listdir('/usr/lib/enigma2/python/Components/Converter/')

I have already implemented it.
Keep the following version of the plugin 1.3

 

In this version In the tmp folder will created two files named converter and renderer and plus two files named converterneed and rendererneed.

In this lists (converterneed and rendererneed) will be shown converters and renderers, which not exists in your image.

Attached Files


Edited by a.k.a. Uchkun, 17 October 2014 - 12:55.


Re: ComponentsFromSkin #7 a.k.a. Uchkun

  • Senior Member
  • 94 posts

+26
Good

Posted 17 October 2014 - 16:10

 

 

Changed to:



      if ((x + ' OK') or (x + ' Not Found')) not in dd:
           if fileExists("/usr/lib/enigma2/python/Components/Converter/" + x +".pyo"):
                  dd.append(x + " OK")
           else:
                  dd.append(x + " Not Found")

 

Your mistake here

if ((x + ' OK') or (x + ' Not Found')) not in dd:

It's correct

if ((x + ' OK') and (x + ' Not Found')) not in dd:


Re: ComponentsFromSkin #8 jpuigs

  • Senior Member
  • 1,143 posts

+32
Good

Posted 17 October 2014 - 21:10

With this last one, names repeted several times.


Enigma is getting old....

 

Spoiler

Re: ComponentsFromSkin #9 jpuigs

  • Senior Member
  • 1,143 posts

+32
Good

Posted 17 October 2014 - 21:18

I got it !!!

root@et8000:/var/volatile/tmp# cat componentsfromskin

------ Converters ------
CaidInfo2 - Not Found!
CpuUsage - OK
PaxCaidDisplay - OK
PaxRefString - Not Found!
pliLayoutInfo - OK
ServiceName2 - OK
YWeather - OK

------ Renderers ------
MetrixHDSYSTemp - OK
PicCript2 - OK
PicEmu2 - OK
PiconUni - OK
SjekNextList - Not Found!
VolumeText - OK

root@et8000:/var/volatile/tmp#

Everything merged into one file !

I copy option from value 2 (Openpli)

		elif config.plugins.componentsfromskin.imagemode.value == '2':
			defconv = [
				'ChannelNumbers', 'Combine', 'ConfigEntryTest',
				'ConditionalShowHide', 'ConfigEntryTest', 'CryptoInfo',
				'EventName', 'EventTime', 'FrontendInfo',
				'genre', 'MenuEntryCompare', 'MovieInfo',
				'PliExtraInfo', 'Poll', 'ClockToText',
				'ProgressToText', 'RdsInfo', 'SensorToText',
				'RemainingToText', 'ServiceInfo', 'ServiceName',
				'ServiceOrbitalPosition', 'ServicePosition', 'ServiceTime',
				'StaticMultiList', 'StaticText', 'Streaming',
				'StringList', 'StringListSelection', 'TemplatedMultiContent',
				'TextCase', 'TunerInfo', 'ValueBitTest',
				'ValueRange', 'ValueToPixmap',
				]
			defren = [
				'Label', 'Canvas', 'ChannelNumber',
				'FixedLabel', 'FrontpanelLed', 'Listbox',
				'NextEpgInfo', 'Picon', 'Pig',
				'Pixmap', 'PositionGauge', 'Progress',
				'VideoSize', 'Renderer',
				]
			try:
				c = parse("/tmp/skin.xml")
				nd = c.getElementsByTagName('convert')
				nod = c.getElementsByTagName('widget')
				for item in nd:
					d.append(item.getAttribute('type'))
				for x in d:
					if x not in defconv:
						if x not in dd:
							dd.append(x)
							if x not in conv:
								if x not in convneed:
									convneed.append(x)
# mod				
                                for xa in dd:
                                        xaa = dd.index(xa)
                                        dd.remove(xa)
                                        dd.insert(xaa,xa + " - OK")				
                                for xb in convneed:
                                	xbb = dd.index(xb+ " - OK")
                                        dd.remove(xb+ " - OK")
                                        dd.insert(xbb,xb + " - Not Found!")
#end mod
				for it in nod:
					p.append(it.getAttribute('render'))
				for y in p:
					y = y.encode("UTF-8")
					if y not in defren:
						if y not in pp:
							if not y == '':
								pp.append(y)
								if y not in ren:
									if y not in renneed:
										renneed.append(y)
# mod
                                for ya in pp:
                                        yaa = pp.index(ya)
                                        pp.remove(ya)
                                        pp.insert(yaa,ya + " - OK")	
                                for yb in renneed:
                                	ybb = pp.index(yb+ " - OK")
                                        pp.remove(yb+ " - OK")
                                        pp.insert(ybb,yb + " - Not Found!")
                                        
#end mod										
			except:
				pass
			dde = sorted(dd,key=lambda j: j.lower())	
			e = '\n'.join(dde)
			f = e + '\n'
			fi = open("/tmp/componentsfromskin",'w')
                        g = '------ Converters ------\n' + f
			ppe = sorted(pp,key=lambda k: k.lower())
                        ee = '\n'.join(ppe)
			ff = ee + '\n\n'
			gg = '\n------ Renderers ------\n' + ff
			hh = str(g + gg)
			fi.write(hh)
			fi.close()
			self.session.open(MessageBox, _("List of converters and renders, applied in the skin, but absent on the image OpenPli4 by default, successfully created in the folder tmp!"), MessageBox.TYPE_INFO, timeout = 6)



Enigma is getting old....

 

Spoiler

Re: ComponentsFromSkin #10 jpuigs

  • Senior Member
  • 1,143 posts

+32
Good

Posted 17 October 2014 - 21:21

I've tried to have it on screen with a messagebox, but  I don't know how to move messagebox location from screen center.

self.session.open(MessageBox, _(hh), MessageBox.TYPE_INFO, timeout = 6)

Enigma is getting old....

 

Spoiler

Re: ComponentsFromSkin #11 a.k.a. Uchkun

  • Senior Member
  • 94 posts

+26
Good

Posted 18 October 2014 - 04:54

 

I've tried to have it on screen with a messagebox, but  I don't know how to move messagebox location from screen center.



self.session.open(MessageBox, _(hh), MessageBox.TYPE_INFO, timeout = 6)

 

 

This is system Screen MessageBox, just change Screen "Messagebox" position in the skin (skin.xml), but other system messages will be moved too.

Therefore it is better create separate window (Screen) for this message in the plugin...



Re: ComponentsFromSkin #12 a.k.a. Uchkun

  • Senior Member
  • 94 posts

+26
Good

Posted 18 October 2014 - 05:00

 

I got it !!!

 

Congratulations!

Is it your first Mod?

 

If you want put your mod on public, I do not mind, this is opensource plugin.

But you must indicating the author, and the plugin must remain opensource and not be used commercially



Re: ComponentsFromSkin #13 a.k.a. Uchkun

  • Senior Member
  • 94 posts

+26
Good

Posted 18 October 2014 - 05:15

 

I've tried to have it on screen with a messagebox, but  I don't know how to move messagebox location from screen center.



self.session.open(MessageBox, _(hh), MessageBox.TYPE_INFO, timeout = 6)

 

 

You can find attributes for "MessageBox" in the component-screen MessageBox here:

/usr/lib/enigma2/python/python/Screens/MessageBox.py

 

And look method __init__

 ........text, type = TYPE_YESNO, timeout = -1, close_on_any_key = False, default = True, enable_input = True, msgBoxID = None


Re: ComponentsFromSkin #14 jpuigs

  • Senior Member
  • 1,143 posts

+32
Good

Posted 18 October 2014 - 12:06

 

 

 

Congratulations!

Is it your first Mod?

 

If you want put your mod on public, I do not mind, this is opensource plugin.

But you must indicating the author, and the plugin must remain opensource and not be used commercially

 

 

No, my intention is not to publish it.

The plugin is yours, and I just have written a personal mod I've made.

You can use it for future versions if you consider it usefull.


Enigma is getting old....

 

Spoiler

Re: ComponentsFromSkin #15 Erik Slagter

  • PLi® Core member
  • 46,951 posts

+541
Excellent

Posted 19 October 2014 - 17:58

Does the license allow for a closed modification?


* Wavefrontier T90 with 28E/23E/19E/13E via SCR switches 2 x 2 x 6 user bands
I don't read PM -> if you have something to ask or to report, do it in the forum so others can benefit. I don't take freelance jobs.
Ik lees geen PM -> als je iets te vragen of te melden hebt, doe het op het forum, zodat anderen er ook wat aan hebben.


Re: ComponentsFromSkin #16 a.k.a. Uchkun

  • Senior Member
  • 94 posts

+26
Good

Posted 20 October 2014 - 12:05

Does the license allow for a closed modification?

 

 

For a closed not.

Please note that I write, 

 

 

 

..............and the plugin must remain opensource............



Re: ComponentsFromSkin #17 jpuigs

  • Senior Member
  • 1,143 posts

+32
Good

Posted 20 October 2014 - 13:20

... and what does it mean not allowed "Closed modification" ?

 

Does it mean that If I modify it, I have to publish the entire plugin.py file ?


Edited by jpuigs, 20 October 2014 - 13:21.

Enigma is getting old....

 

Spoiler

Re: ComponentsFromSkin #18 Erik Slagter

  • PLi® Core member
  • 46,951 posts

+541
Excellent

Posted 20 October 2014 - 13:23

Whether it's legal or not, I think it's very selfish to not publish code that one adds to an existing piece of source code.


* Wavefrontier T90 with 28E/23E/19E/13E via SCR switches 2 x 2 x 6 user bands
I don't read PM -> if you have something to ask or to report, do it in the forum so others can benefit. I don't take freelance jobs.
Ik lees geen PM -> als je iets te vragen of te melden hebt, doe het op het forum, zodat anderen er ook wat aan hebben.


Re: ComponentsFromSkin #19 jpuigs

  • Senior Member
  • 1,143 posts

+32
Good

Posted 20 October 2014 - 14:06

Yes, but I've published what I changed in the code....


Enigma is getting old....

 

Spoiler

Re: ComponentsFromSkin #20 Erik Slagter

  • PLi® Core member
  • 46,951 posts

+541
Excellent

Posted 20 October 2014 - 14:21

Now I see, I have misunderstood, no problems.


* Wavefrontier T90 with 28E/23E/19E/13E via SCR switches 2 x 2 x 6 user bands
I don't read PM -> if you have something to ask or to report, do it in the forum so others can benefit. I don't take freelance jobs.
Ik lees geen PM -> als je iets te vragen of te melden hebt, doe het op het forum, zodat anderen er ook wat aan hebben.



1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users