Python plugins - begginer question

  • I started a play with Enigma 2 plugins (I'm begginer in Python/DM programing).


    First of all I've wrote some basic modules which were started in console by command:
    python file.py


    The fun is grate so I wanted something more.
    I've installed demo plugin and tried to change some lines to see what happen.


    I've got few problems with:


    1) First is that after changes I have to restart Dreambox to see changes in plugin behaviour- how to recompile the source without rebooting sequence which take a lot of time?


    2) In case of some syntax error in source the plugin is no available in Plugin Browser any more the only solution i found is to find error and make correction and reboot tuner. Is it possible to refresh Plugin Browser data without rebooting or execute plugin in other case?

    "Reasonable people adapt themselves to the world.
    Unreasonable people attempt to adapt the world to themselves.
    All progress, therefore, depends on unreasonable people"


    ============
    SubsDownloader

  • After the changes - please telnet :-


    init 4
    killall -9 enigma2
    enigma2>/tmp/enigma2.log 2>&1 &1


    Then enigma2 will restart and you will see the log (with any errors) in /tmp/enigma2.log


    Cheers, pcd.

  • 1) First is that after changes I have to restart Dreambox to see changes in plugin behaviour- how to recompile the source without rebooting sequence which take a lot of time?

    One trick that I have used is to force module reload every time your plugin is called.
    plugin.py will contain only the bare minimum:



    Then your actual plugin code will be in YourModule.py file.
    In this case you would have YourScreen defined there.
    All your editing would be in that file, and every time you start the plugin, the code in plugin.py reloads your module.
    If you don't want to crash the whole Enigma while testing something, you can wrap your code with try - except.

  • silelis: it is not necessary to reboot the dreambox, you can do an enigma2 restart (to have this in the shutdown menu you must have set the level in the config to 'Expert').

    Gruss
    Dre


    Boxen (im Einsatz): DM920, DM900, DMOne
    Developer Project Merlin - we are OpenSource

  • Hi cweiske. I am really interested by what you said. What do you mean by 'to develop the plugin on the PC with Enigma2 running on the PC' ?? Do you have like an emulator or something ??