Jump to content


Photo

(2) Little Plugin: select to convert exteplayer ..


  • Please log in to reply
11 replies to this topic

#1 pzanone

  • Senior Member
  • 202 posts

+10
Neutral

Posted 9 February 2017 - 20:30

Hi

my friend have a little problem :)

 

If select bouquet with Key Yellow (convert to.. Exteplayer3 -5002)

 

No Get ->  directory + nome_file_bouquet.tv

 
   
def crea_bouquet5002(self):

        idx = self["menu"].getSelectionIndex()

        if idx is None:

            return

        else:
       ???????????????????
 

This is a shot..

 

39lEWaJdT.jpg

 

 

any idea.. :(

 

only you need to run a bash command

 

For example:

    def crea_bouquet5002(self):
        idx = self["menu"].getSelectionIndex()
        if idx is None:
            return
        else:

            filename = self['menu'].getCurrentDirectory() + self['menu'].getFilename()

            name = filename
            
            BOUQUETNAME = 'userbouquet.%s.tv' % name
            #self.setTitle(_("Please wait"))
            self["statusbar"] = StaticText()
            self.iConsole = iConsole()
            self["statusbar"].text = _("Converting %s" % name)
            system("sed -i 's/^#SERVICE 4097/#SERVICE 5002/g' %s" %BOUQUETNAME)
            self['statusbar'].setText(_('Select Bouquet to convert..'))
            self.mbox = self.session.open(MessageBox, _('Converted bouquet...'), MessageBox.TYPE_INFO, timeout=5)

I have no idea how to retrieve the name of the selected list ..
how can I create a definition that can do it?

 

This is a problem..

filename = self['menu'].getCurrentDirectory() + self['menu'].getFilename()

Tanks for help



Re: (2) Little Plugin: select to convert exteplayer .. #2 pzanone

  • Senior Member
  • 202 posts

+10
Neutral

Posted 10 February 2017 - 12:07

this is a folder.. plugin

 

:mellow:

Attached Files



Re: (2) Little Plugin: select to convert exteplayer .. #3 mfaraj57

  • Senior Member
  • 1,605 posts

+286
Excellent

Posted 10 February 2017 - 12:11

You can use
Data=self['menu'].getCurrentSelection
Depend how you stored data in menu list
Try filename=data[0][0]+data[0][1]

Re: (2) Little Plugin: select to convert exteplayer .. #4 pzanone

  • Senior Member
  • 202 posts

+10
Neutral

Posted 10 February 2017 - 16:22

Tanks @mfaraj57

 

but I get an error and are still, unfortunately I do not go forward

< 10605.469>   File "/usr/lib/enigma2/python/Plugins/Extensions/BouquetConverter/plugin.py", line 252, in crea_bouquet5002
< 10605.479>     url=idx[0][0]+idx[0][1]
< 10605.480> TypeError: 'int' object has no attribute '__getitem__'

Def modded:

    def crea_bouquet5002(self):
        idx = self["menu"].getSelectionIndex()
        if idx is None:
            return
        else:
            idx=self['menu'].getSelectionIndex()
            url=idx[0][0]+idx[0][1]
            
            # Name = self['menu'].getCurrent()[0][0]
            # name = Name
            # url = self['menu'].getCurrent()[0][1]
            
            BOUQUETNAME = 'userbouquet.%s.tv' % url
            #self.setTitle(_("Please wait"))
            self["statusbar"] = StaticText()
            self.iConsole = iConsole()
            self["statusbar"].text = _("Converting %s" % url)

            system("sed -i 's/^#SERVICE 4097/#SERVICE 5002/g' %s" %BOUQUETNAME)
            system("sed -i 's/^#SERVICE 5001/#SERVICE 5002/g' %s" %BOUQUETNAME)
        
            self['statusbar'].setText(_('Select Bouquet to convert..'))
            self.mbox = self.session.open(MessageBox, _('Converted bouquet...'), MessageBox.TYPE_INFO, timeout=5)

folder updated attached

Attached Files



Re: (2) Little Plugin: select to convert exteplayer .. #5 mfaraj57

  • Senior Member
  • 1,605 posts

+286
Excellent

Posted 10 February 2017 - 16:47

This is wrong ,idx is not array

    idx=self['menu'].getSelectionIndex()
            url=idx[0][0]+idx[0][1]

should be


data=self['menu'].getCurrent()
print "data",data

url=data[0][0]+data[0][1]

Edited by mfaraj57, 10 February 2017 - 16:49.


Re: (2) Little Plugin: select to convert exteplayer .. #6 pzanone

  • Senior Member
  • 202 posts

+10
Neutral

Posted 10 February 2017 - 17:18

Ok

Now MessageInf is OK List Converted!

BUT.. unfortunately

 

no converted list ...

They select the list that begins with # service 4097:

I'm verified..

No list.tv modified ..no new date .. no #SERVICE 5002

:)

i very newbby for this..

 

I just can not figure out where to take the path of the file
I also tried it with a custom MenuList but .. nothing

    def crea_bouquet5002(self):
        idx = self["menu"].getSelectionIndex()
        if idx is None:
            return
        else:
            # idx=self['menu'].getSelectionIndex()
            # url=idx[0][0]+idx[0][1]
            
            data=self['menu'].getCurrent()
            print "data",data
            url = data[0][0]+data[0][1]
   
            BOUQUETNAME = 'userbouquet.%s.tv' % url
            #self.setTitle(_("Please wait"))
            self["statusbar"] = StaticText()
            self.iConsole = iConsole()
            self["statusbar"].text = _("Converting %s" % url)

            system("sed -i 's/^#SERVICE 4097/#SERVICE 5002/g' %s" %BOUQUETNAME)
            system("sed -i 's/^#SERVICE 5001/#SERVICE 5002/g' %s" %BOUQUETNAME)
        
            self['statusbar'].setText(_('Select Bouquet to convert..'))
            self.mbox = self.session.open(MessageBox, _('Converted bouquet...'), MessageBox.TYPE_INFO, timeout=5)

Tanks for this help..


Edited by pzanone, 10 February 2017 - 17:19.


Re: (2) Little Plugin: select to convert exteplayer .. #7 pzanone

  • Senior Member
  • 202 posts

+10
Neutral

Posted 11 February 2017 - 12:59

Hi Guy

Now error is..


< 38691.089> action ->  ColorActions yellow
< 38691.115> data p
< 38691.135> Traceback (most recent call last):
< 38691.135>   File "/usr/lib/enigma2/python/Components/ActionMap.py", line 48, in action
< 38691.171>   File "/usr/lib/enigma2/python/Plugins/Extensions/BouquetConverter/plugin.py", line 262, in crea_bouquet5002
< 38691.180>     url = data[0][0]+data[0][1]
< 38691.187> IndexError: string index out of range
    def crea_bouquet5002(self):
        idx = self["menu"].getSelectionIndex()
        if idx is None:
            return
        else:
            # idx=self['menu'].getSelectionIndex()
            # url=idx[0][0]+idx[0][1]
            
            data = self['menu'].getCurrent()[0][0]
            #data=self['menu'].getCurrent()
            print "data",data
            
            url = data[0][0]+data[0][1]
   
            BOUQUETNAME = 'userbouquet.%s.tv' % url
            #self.setTitle(_("Please wait"))
            self["statusbar"] = StaticText()
            self.iConsole = iConsole()
            self["statusbar"].text = _("Converting %s" % url)

            system("sed -i 's/^#SERVICE 4097/#SERVICE 5002/g' %s" %BOUQUETNAME)
            system("sed -i 's/^#SERVICE 5001/#SERVICE 5002/g' %s" %BOUQUETNAME)
        
            self['statusbar'].setText(_('Select Bouquet to convert..'))
            self.mbox = self.session.open(MessageBox, _('Converted bouquet...'), MessageBox.TYPE_INFO, timeout=5)

......

 

 

 



Re: (2) Little Plugin: select to convert exteplayer .. #8 Dimitrij

  • PLi® Core member
  • 9,970 posts

+335
Excellent

Posted 11 February 2017 - 15:13

data = self['menu'].getCurrent()
if data and len(data) > 1:

GigaBlue UHD Quad 4K /Lunix3-4K/Solo 4K


Re: (2) Little Plugin: select to convert exteplayer .. #9 pzanone

  • Senior Member
  • 202 posts

+10
Neutral

Posted 11 February 2017 - 16:41

Tanks

Ok

now no error..

 

InfoMessage ok...

but list not converted..

 

............coming soon

 

tanks for patients



Re: (2) Little Plugin: select to convert exteplayer .. #10 pzanone

  • Senior Member
  • 202 posts

+10
Neutral

Posted 11 February 2017 - 17:20

attached..

 

does not resolve the path to the selected list in /etc/enigma2/ 

 

:blink:

 

 

Attached Files



Re: (2) Little Plugin: select to convert exteplayer .. #11 Dimitrij

  • PLi® Core member
  • 9,970 posts

+335
Excellent

Posted 11 February 2017 - 18:49

http://2boom-plugins...m3ubouquet.html

               name = data[0][1]
   
                BOUQUETNAME = '/etc/enigma2/%s' % name

GigaBlue UHD Quad 4K /Lunix3-4K/Solo 4K


Re: (2) Little Plugin: select to convert exteplayer .. #12 pzanone

  • Senior Member
  • 202 posts

+10
Neutral

Posted 11 February 2017 - 19:27

Res

 

/etc/enigma2/userbouquet.e.tv

The file list name is "userbouquet.test.tv"

 

Only "e" res .. why?

 

Tanks
 


Edited by pzanone, 11 February 2017 - 19:28.



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users