Convert Navbar Plugin to Phyton3

There are 9 replies in this Thread which was already clicked 2,027 times. The last Post () by DJ eXo.

  • Hello dear community,


    In a project we are trying to conventionize a plugin designed for Phyton2 to Phyton3. We are so far that the plugin appears in the extension list, but there are still 3 errors when starting it.


    It is the Navibar plugin. A fancy plugin selection bar or selection list. The images are from the original Py2 plugin. I attach the current status as a file attachment.


    Py3 modded: navibar.tar.xz.tar

    Py2 original: Navibar original Py2.zip


    screenshot (1).pngNavibar_4.jpgNavibar_1.jpg


    I am grateful for any help!

    Edited once, last by DJ eXo ().

  • A few quick tips.

    python 3
    print statements need to be wrapped in brackets. Check all print statements in the python files.

    print blah
    becomes
    print(blah)

    The indentations are all over the show. A mixture of tabs and spaces. This will fail.
    Don't use tabs anymore. Use 4 spaces for a tabbed indents
    Use a text editor like notepad++ to replace all tabs with 4 spaces. Then check all the indentation are lined up correctly.

    Remove commented out code

    Remove unused imports.
    i.e
    from Components.AVSwitch import AVSwitch
    avswitch has been depreciated in most modern oe-alliance images.
    You don't use it in the code anyway

    always have a space after a # comment.
    #wrong
    # right

    Check only 1 blank line between def functions

    You can also use chatgpt to assist you nowadays.
    Although you are character limited in chatgpt, . About 450 lines of code. so you have to do it in sections or groups of functions.

    i.e
    "Can you format this code to pep8"

    "the following code snippets I am going to post are for enigma2 plugin. The code needs to be compatible with python 2.7 and python 3.*. Can you check the code. I will post them in sections."

    blah blah blah





    ** A person who feels appreciated will always do more than what is expected **

    • Official Post

    I was trying the plugin and I noticed that it didn't work on pli image, so after a few crashes I fixed it.

    The only problem, but I didn't investigate, is that I don't see the icons, only the info bar and the frame that moves in addition to the descriptions.


    old code

    Code
                args = inspect.getargs(p.__call__)[0]
                if not len(args) != 1 or len(args) == 2 and isinstance(InfoBar.instance, InfoBarChannelSelection):
                    lx.append(((boundFunction(self.getPluginName, p.name), boundFunction(
                        self.runPlugin, p), lambda: True), None, p.name))


    i have fixed with this code.

  • Good work!


    The image problem does not only affect the icons, various menu icons are also not displayed.


    In addition, the description of the first plugin in the bar is missing after starting the plugin, it only appears after switching back and forth once. In the Phyton2 version, the description is correctly displayed directly.


    Who can help?

Your resource for Enigma2 softcam plugins

Discover essential Enigma2 softcam plugins. Access downloads and support for tools that manage channel decryption and conditional access. Find downloads, configuration guides, and community support for the latest conditional access and emulation tools.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!