Jump to content


Photo

Enigma2 plugins development in VS Code with Docker


  • Please log in to reply
8 replies to this topic

#1 technic

  • Senior Member
  • 81 posts

+9
Neutral

Posted 2 May 2019 - 21:55

Hi everyone,

I made up a small HOWTO and example repository about developing simple enigma2 plugins with visual studio code and docker container.

See it here: https://github.com/t...enigma2_example

Questions and pull requests are welcome!



Re: Enigma2 plugins development in VS Code with Docker #2 rabinovic

  • New Member
  • 3 posts

0
Neutral

Posted 26 April 2020 - 19:22

Hi,
I recently found your instructions on how to run enigma2 plugin with docker and vscode.
I got everything working. But when debugging, the debugger suddenly hangs without any messages. Have you encountered such behavior ever? Sorry for my english.

Gesendet von meinem MHA-L29 mit Tapatalk

Re: Enigma2 plugins development in VS Code with Docker #3 technic

  • Senior Member
  • 81 posts

+9
Neutral

Posted 27 April 2020 - 10:12

Hi, I didn't have such errors. However, I am not debugging that often.

 

Does enigma2 also hangs at this moment? Did you inspect all errors from output tab (all outputs) as well as enigma stdout and debugger output tab?



Re: Enigma2 plugins development in VS Code with Docker #4 rabinovic

  • New Member
  • 3 posts

0
Neutral

Posted 3 May 2020 - 11:58

Hi, actually I'm playing with e2iplayer. So when I enter a host, the debugger hangs without any messages. Without the debugger there is no problem. By the way what is the keyboard key for menu?

Gesendet von meinem MHA-L29 mit Tapatalk

Re: Enigma2 plugins development in VS Code with Docker #5 technic

  • Senior Member
  • 81 posts

+9
Neutral

Posted 3 May 2020 - 15:05

Menu is space. e2iplayer spawns lots of helper processes from some other binaries, maybe this makes an issue. Try with an example plugin.



Re: Enigma2 plugins development in VS Code with Docker #6 rabinovic

  • New Member
  • 3 posts

0
Neutral

Posted 25 March 2021 - 08:58

Hi, your last commit fixed this problem. Thanks

Gesendet von meinem MHA-L29 mit Tapatalk

Re: Enigma2 plugins development in VS Code with Docker #7 technic

  • Senior Member
  • 81 posts

+9
Neutral

Posted 25 March 2021 - 10:45

Hi, your last commit fixed this problem. Thanks

Great



Re: Enigma2 plugins development in VS Code with Docker #8 Opvolger

  • Member
  • 9 posts

0
Neutral

Posted 3 April 2021 - 13:47

First of all, I want to thank you for the neat explanation of setting up Docker with enigma2. That in itself works well. I see that my breakpoint is working with loading. Unfortunately when I click on F4 to select my plugin I get the following stack trace:

Traceback (most recent call last):
  File "/usr/lib/enigma2/python/Components/ActionMap.py", line 49, in action
    res = self.actions[action]()
  File "/usr/lib/enigma2/python/Screens/InfoBarGenerics.py", line 2193, in showExtensionSelection
    self.session.openWithCallback(self.extensionCallback, ChoiceBox, title=_("Please choose an extension..."), list=list, keys=keys, skin_name="ExtensionsList", reorderConfig="extension_order", windowTitle=_("Extensions menu"))
  File "/usr/lib/enigma2/python/mytest.py", line 289, in openWithCallback
    dlg = self.open(screen, *arguments, **kwargs)
  File "/usr/lib/enigma2/python/mytest.py", line 299, in open
    dlg = self.current_dialog = self.instantiateDialog(screen, *arguments, **kwargs)
  File "/usr/lib/enigma2/python/mytest.py", line 242, in instantiateDialog
    return self.doInstantiateDialog(screen, arguments, kwargs, self.desktop)
  File "/usr/lib/enigma2/python/mytest.py", line 266, in doInstantiateDialog
    dlg.applySkin()
  File "/usr/lib/enigma2/python/Components/GUISkin.py", line 154, in applySkin
    self.createGUIScreen(self.instance, self.desktop)
  File "/usr/lib/enigma2/python/Components/GUISkin.py", line 55, in createGUIScreen
    exec f in globals(), locals()
  File "skin applet", line 1, in <module>
  File "/usr/lib/enigma2/python/Screens/ChoiceBox.py", line 119, in autoResize
    wsizex = x_width(textsize[0]) + x_offset() + 10 + scrollbar
  File "/usr/lib/enigma2/python/Screens/ChoiceBox.py", line 105, in x_width
    return max(max([getListLineTextWidth(line[0][0]) for line in self["list"].list]), textsize)
ValueError: max() arg is an empty sequence
[ePyObject] (CallObject(<bound method HelpableActionMap.action of <Components.ActionMap.HelpableActionMap instance at 0x7f16d4234640>>,('InfobarExtensions', 'extensions')) failed)
[gRC] main thread is non-idle! display spinner!
The terminal process "docker 'exec', '-it', '-e', 'ENIGMA_DEBUG_LVL=5', 'enigma2', '/usr/bin/enigma2', '/opt/mytest-ptvsd.py'" terminated with exit code: 137. 
and a greenscreen of dead..... in VNC.
 
 
my hack for now: 
118                 offset = self["list"].l.getItemSize().height() * count
119                 wsizex = 512 #x_width(textsize[0]) + x_offset() + 10 + scrollbar
120                 #precount description size
121                 descrsize = self["description"].getSize()
122                 self["description"].instance.resize(enigma.eSize(*(wsizex - 20, descrsize[1] if descrsize[1] > 0 else 0)))
123                 # then get true description height
124                 descriptionHeight = 50 #getMaxDescriptionHeight()
125                 wsizey = textsize[1] + offset + descriptionHeight

But I can develop my addon now.... many thnx for that.


Edited by Opvolger, 3 April 2021 - 14:43.


Re: Enigma2 plugins development in VS Code with Docker #9 technic

  • Senior Member
  • 81 posts

+9
Neutral

Posted 3 April 2021 - 14:27

@Opvolger. If you want to have plugin under F4 button use the following example code

from Plugins.Plugin import PluginDescriptor
from Screens.MessageBox import MessageBox


def start(session):
    session.open(MessageBox, "Hello World!")


def Plugins(path, **kwargs):
    return [
        PluginDescriptor(name="Example", where=PluginDescriptor.WHERE_EXTENSIONSMENU, fnc=start)
    ]

It's a bug in enigma2 that it crashes when extensions list is empty. Maybe I have to update it.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users