Jump to content


Photo

Open satfinder in myplugin

satfinder plugin

  • Please log in to reply
8 replies to this topic

#1 momi133

  • Senior Member
  • 74 posts

0
Neutral

Posted 3 November 2019 - 20:05

Hi Dears

 

I want to open satfinder plugin in myplugin.

 

first method:

def upsatfinder(self):
	if fileExists("/usr/lib/enigma2/python/Plugins/SystemPlugins/Satfinder/plugin.py"):
		from Plugins.SystemPlugins.Satfinder.plugin import Satfinder 
		self.session.open(Satfinder)

But I want a second method to open Satfinder plugin by following function"def SatfinderMain(session, close=None, **kwargs)" in Satfinder plugin

 

How can I do that?

 

thanks

 

Following codes  belong to satfinder plugin. also attached file.

class Satfinder(ScanSetup, ServiceScan):
    """Inherits StaticText [key_red] and [key_green] properties from ScanSetup"""

    def __init__(self, session):
    .
    .
    .
def SatfinderCallback(close, answer):
	if close and answer:
		close(True)

def SatfinderMain(session, close=None, **kwargs):"""I want a second method to open Satfinder plugin by this function"""
	nims = nimmanager.nim_slots
	nimList = []
	for n in nims:
		if not any([n.isCompatible(x) for x in "DVB-S", "DVB-S2"]):
			continue
		if n.config_mode in ("loopthrough", "satposdepends", "nothing"):
			continue
		if n.isCompatible("DVB-S") and n.config_mode in ("advanced", "simple") and len(nimmanager.getSatListForNim(n.slot)) < 1:
			config.Nims[n.slot].configMode.value = "nothing"
			config.Nims[n.slot].configMode.save()
			continue
		nimList.append(n)

	if len(nimList) == 0:
		session.open(MessageBox, _("No Satellite Tuner is configured. Please check your tuner setup."), MessageBox.TYPE_ERROR)
	else:
		session.openWithCallback(boundFunction(SatfinderCallback, close), Satfinder)

def SatfinderStart(menuid, **kwargs):
	if menuid == "scan" and nimmanager.somethingConnected():
		return [(_("Signal finder"), SatfinderMain, "satfinder", None)]
	else:
		return []

def Plugins(**kwargs):
	if any([nimmanager.hasNimType(x) for x in "DVB-S", "DVB-T", "DVB-C", "ATSC"]):
		return PluginDescriptor(name=_("Signal finder"), description=_("Helps setting up your antenna"), where = PluginDescriptor.WHERE_MENU, needsRestart = False, fnc=SatfinderStart)
	else:
		return []

Attached Files


Edited by momi133, 3 November 2019 - 20:07.


Re: Open satfinder in myplugin #2 momi133

  • Senior Member
  • 74 posts

0
Neutral

Posted 6 November 2019 - 04:14

Is it possible???



Re: Open satfinder in myplugin #3 Dimitrij

  • PLi® Core member
  • 10,265 posts

+347
Excellent

Posted 6 November 2019 - 11:52

from Plugins.SystemPlugins.Satfinder.plugin import Satfinder, SatfinderMain
def SatfinderStart(menuid, **kwargs):
	if menuid == "scan" and nimmanager.somethingConnected():
		return [(_("Signal finder"), SatfinderMain, "satfinder", None)]
	else:
		return []
 
def Plugins(**kwargs):
	if any([nimmanager.hasNimType(x) for x in "DVB-S", "DVB-T", "DVB-C", "ATSC"]):
		return PluginDescriptor(name=_("myplugin"), description=_("Helps setting up your antenna"), where = PluginDescriptor.WHERE_MENU, needsRestart = False, fnc=SatfinderStart)
	else:
		return []

Edited by Dimitrij, 6 November 2019 - 11:54.

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


Re: Open satfinder in myplugin #4 Huevos

  • PLi® Contributor
  • 4,621 posts

+161
Excellent

Posted 7 November 2019 - 01:46

What do you mean open satfinder in your plugin?



Re: Open satfinder in myplugin #5 Abu Baniaz

  • PLi® Contributor
  • 2,494 posts

+64
Good

Posted 7 November 2019 - 04:46

Show in plugin menu I think

Sent from my Moto G (5S) using Forum Fiend v1.3.3.

Edited by Abu Baniaz, 7 November 2019 - 04:46.


Re: Open satfinder in myplugin #6 momi133

  • Senior Member
  • 74 posts

0
Neutral

Posted 7 November 2019 - 19:13

from Plugins.SystemPlugins.Satfinder.plugin import Satfinder, SatfinderMain
def SatfinderStart(menuid, **kwargs):
	if menuid == "scan" and nimmanager.somethingConnected():
		return [(_("Signal finder"), SatfinderMain, "satfinder", None)]
	else:
		return []
 
def Plugins(**kwargs):
	if any([nimmanager.hasNimType(x) for x in "DVB-S", "DVB-T", "DVB-C", "ATSC"]):
		return PluginDescriptor(name=_("myplugin"), description=_("Helps setting up your antenna"), where = PluginDescriptor.WHERE_MENU, needsRestart = False, fnc=SatfinderStart)
	else:
		return []

 

this codes show that myplugin will be not open and satfinder will be open.  my plugin shows a list  of sat freqs,

 

 

What do you mean open satfinder in your plugin?

 

my plugin shows a list of sat freqs, user select a desired freq and when ok is pressed, satfinder plugin will be up.

 

thanks.


Edited by momi133, 7 November 2019 - 19:14.


Re: Open satfinder in myplugin #7 Huevos

  • PLi® Contributor
  • 4,621 posts

+161
Excellent

Posted 9 November 2019 - 22:39

Why didn't you just write a subclass of satfinder?



Re: Open satfinder in myplugin #8 momi133

  • Senior Member
  • 74 posts

0
Neutral

Posted 10 November 2019 - 22:10

Why didn't you just write a subclass of satfinder?

 you mean that i write a subclass of satfinder in my plugin?



Re: Open satfinder in myplugin #9 Huevos

  • PLi® Contributor
  • 4,621 posts

+161
Excellent

Posted 11 November 2019 - 20:17

Yes, it is easy, and just open the subclass with the correct transponder active.





Also tagged with one or more of these keywords: satfinder, plugin

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users