How to fix picload To DreamOS ?!

  • I have this code working on OE2.0 but with OE2.5 I have got this error (How to fix it please ?!)


    • Offizieller Beitrag

    startDecode(char const *,bool)


    means pass as first argument a string: "bla.jpeg" an as second an bool argument: True/False

    no brain no pain! :495:
    Auf gar keinen Fall die GP-Wiki lesen!!
    sie könnte Deinen Kopf zu schwer für Deinen Hals machen :grinning_squinting_face:
    :sonne:458859-modellist-gif


    attachment.php?attachmentid=158292 Wir wollen uns für das Update bedanken!!
    attachment.php?attachmentid=204594

  • After change

    Code
    if self.picload.startDecode(picfile, 0, 0, False) == 0:


    to

    Code
    if self.picload.startDecode(char const *,bool) == 0:


    Got Error

    Code
    File "/usr/lib/enigma2/python/Plugins/Extensions/ALAJRE/Addons/tasafoh.py", line 657
        if self.picload.startDecode(char const *,bool) == 0:
                                             ^
    SyntaxError: invalid syntax
  • But now I have got Gstreamer error (can not play file mp3 online)
    In attach file python it you can see it ..



    on my image depend on openpli (OE2.0) works just fine as log shown ..

  • Hi friends ..
    Please how to solve this crash ?!

    Code
    Screen <class 'Plugins.Extensions.ALAJRE.Addons.Coran.CoranScreen_1'>(('https://equran.me/read-1.html', '1', '001'), {}): <type 'exceptions.TypeError'>
    Traceback (most recent call last):
      File "/usr/lib/enigma2/python/mytest.py", line 363, in create
        return screen(self, *arguments, **kwargs)
      File "/usr/lib/enigma2/python/Plugins/Extensions/ALAJRE/Addons/Coran.py", line 181, in __init__
        self.DownloadAyats(Lien)
      File "/usr/lib/enigma2/python/Plugins/Extensions/ALAJRE/Addons/Coran.py", line 207, in DownloadAyats
        Elaya = self['ProgramTv'].getCurrent()[0][0] + '"' + self['ProgramTv'].getCurrent()[0][3] + '"'
    TypeError: 'NoneType' object has no attribute '__getitem__'
    swig director exception (SWIG director method error.)


    The code is

  • You don't check if anything is returned by your regex. So, crashes like this can happen.

  • No, you need to check if the length of the list is ok. If you have an empty list, you must not process it.

  • As I wrote previously:
    re.findall will return a list which could be an empty list (len(list) == 0).


    With your code self.letter_list2 can be empty. This means you assign an empty list to self["ProgramTV"] which leads to your crash in Elaya = self['ProgramTv'].getCurrent()[0][0] + '"' + self['ProgramTv'].getCurrent()[0][3] + '"'
    because getCurrent() is None. Thus, you cannot access list elements.