i-have-a-dreambox.com | Dreambox - Support

Register Calendar Members List Team Members Galerie to Portal Go to the Main Page

Boardrules Frequently Asked Questions Statistik Statistik Search Pinwand Dreambox Blog Ihad/Gemini Fan-Shop
i-have-a-dreambox.com | Dreambox - Support » Developer Bereich (CVS, Openembedded) » Python » How to fix picload To DreamOS ?! » Hello Guest [Login|Register]
Last Post | First Unread Post Print Page | Add Thread to Favorites
Post New Thread Post Reply
Go to the bottom of this page How to fix picload To DreamOS ?!
Author
Post « Previous Thread | Next Thread »
fairbird
Newbie


Registration Date: 14.12.2009
Posts: 90
Which box: DM800; DM800se; DM920
External Storage: USB-Stick; HDD
Which Image: OE 2.5
Origin: Bahrain

How to fix picload To DreamOS ?! Reply to this Post Post Reply with Quote Edit/Delete Posts Report Post to a Moderator       Go to the top of this page

I have this code working on OE2.0 but with OE2.5 I have got this error (How to fix it please ?!)
code:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
    def showPic(self):
        from enigma import ePicLoad, gPixmapPtr
        picfile = self.picPath
        picobject = self['myPic']
        picobject.instance.setPixmap(gPixmapPtr())
        self.scale = AVSwitch().getFramebufferScale()
        self.picload = ePicLoad()
        size = picobject.instance.size()
        self.picload.setPara((size.width(),
         size.height(),
         self.scale[0],
         self.scale[0],
         False,
         1,
         '#80000000'))
        if self.picload.startDecode(picfile, 0, 0, False) == 0:
            ptr = self.picload.getData()
            if ptr != None:
                picobject.instance.setPixmap(ptr)
                picobject.show()
                del self.picload


code:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
  File "/usr/lib/enigma2/python/Components/ActionMap.py", line 63, in action
    res = self.actions[action]()
  File "/usr/lib/enigma2/python/Plugins/Extensions/ALAJRE/Addons/tasafoh.py", line 444, in keyOK
    self.session.open(PictureScreen_ALAJRE, 'True', page, page1, name, Nm, ks, '\xd8\xa7\xd9\x84\xd9\x85\xd8\xb5\xd8\xad\xd9\x81 \xd8\xa8\xd8\xb1\xd9\x88\xd8\xa7\xd9\x8a\xd8\xa9 \xd9\x88\xd8\xb1\xd8\xb4 \xd8\xb9\xd9\x86 \xd9\x86\xd8\xa7\xd9\x81\xd8\xb9')
  File "/usr/lib/enigma2/python/mytest.py", line 470, in open
    dlg = self.current_dialog = self.instantiateDialog(screen, *arguments, **kwargs)
  File "/usr/lib/enigma2/python/mytest.py", line 371, in instantiateDialog
    return self.doInstantiateDialog(screen, arguments, kwargs, self.desktop)
  File "/usr/lib/enigma2/python/mytest.py", line 413, in doInstantiateDialog
    dlg.applySkin()
  File "/usr/lib/enigma2/python/Components/GUISkin.py", line 116, in applySkin
    self.createGUIScreen(self.instance, self.desktop)
  File "/usr/lib/enigma2/python/Components/GUISkin.py", line 51, in createGUIScreen
    f()
  File "/usr/lib/enigma2/python/Plugins/Extensions/ALAJRE/Addons/tasafoh.py", line 166, in showPic
    if self.picload.startDecode(picfile, 0, 0, False) == 0:
NotImplementedError: Wrong number or type of arguments for overloaded function 'ePicLoad_startDecode'.
  Possible C/C++ prototypes are:
    ePicLoad::startDecode(char const *,bool)
    ePicLoad::startDecode(char const *)
28.01.2019 20:15 fairbird is offline Send an Email to fairbird Search for Posts by fairbird Add fairbird to your Buddy List
emanuel emanuel is a male
Dreambox Team


images/avatars/avatar-17351.gif

Registration Date: 17.10.2004
Posts: 6,960
Which box: DM7080HD; DM8000
External Storage: USB-Stick; CF-Card; SD-Card; HDD
Which accessories: Hase, Internet
Which Image: OE 2.5
Welcher Bildschirm: BENQ GW2750
Origin: upper Bavaria

RE: How to fix picload To DreamOS ?! Reply to this Post Post Reply with Quote Edit/Delete Posts Report Post to a Moderator       Go to the top of this page

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!
Auf gar keinen Fall die Statistik lesen!!
sie könnte Deinen Kopf zu schwer für Deinen Hals machen großes Grinsen

Plugins --> Sonne

Wir wollen uns für das Update bedanken!!


28.01.2019 20:21 emanuel is offline Send an Email to emanuel Homepage of emanuel Search for Posts by emanuel Add emanuel to your Buddy List
fairbird
Newbie


Registration Date: 14.12.2009
Posts: 90
Which box: DM800; DM800se; DM920
External Storage: USB-Stick; HDD
Which Image: OE 2.5
Origin: Bahrain

Thread Starter Thread Started by fairbird
Reply to this Post Post Reply with Quote Edit/Delete Posts Report Post to a Moderator       Go to the top of this page

After change
code:
1:
if self.picload.startDecode(picfile, 0, 0, False) == 0:

to
code:
1:
if self.picload.startDecode(char const *,bool) == 0:

Got Error
code:
1:
2:
3:
4:
5:
  File "/usr/lib/enigma2/python/Plugins/Extensions/ALAJRE/Addons/tasafoh.py", line 657
    if self.picload.startDecode(char const *,bool) == 0:
                                         ^
SyntaxError: invalid syntax
28.01.2019 20:41 fairbird is offline Send an Email to fairbird Search for Posts by fairbird Add fairbird to your Buddy List
Dre Dre is a male
V.I.P.


images/avatars/avatar-8101.jpg

Registration Date: 05.11.2004
Posts: 1,375
Which box: DM800; DM7000; DM7020; DM7020HD; DM7025; DM8000
External Storage: USB-Stick
Which Image: Merlin
Welcher Bildschirm: 37PF9731/10
Origin: Schwiiz

Reply to this Post Post Reply with Quote Edit/Delete Posts Report Post to a Moderator       Go to the top of this page

https://dreambox.de/board/index.php?thre...in-paar-fragen/

I think this answers everything

__________________
Gruss Dre

Developer Project Merlin
28.01.2019 20:56 Dre is online Send an Email to Dre Search for Posts by Dre Add Dre to your Buddy List
fairbird
Newbie


Registration Date: 14.12.2009
Posts: 90
Which box: DM800; DM800se; DM920
External Storage: USB-Stick; HDD
Which Image: OE 2.5
Origin: Bahrain

Thread Starter Thread Started by fairbird
Reply to this Post Post Reply with Quote Edit/Delete Posts Report Post to a Moderator       Go to the top of this page

Thank you D.best
I solve it by remove (0, 0,)
28.01.2019 21:18 fairbird is offline Send an Email to fairbird Search for Posts by fairbird Add fairbird to your Buddy List
fairbird
Newbie


Registration Date: 14.12.2009
Posts: 90
Which box: DM800; DM800se; DM920
External Storage: USB-Stick; HDD
Which Image: OE 2.5
Origin: Bahrain

Thread Starter Thread Started by fairbird
Reply to this Post Post Reply with Quote Edit/Delete Posts Report Post to a Moderator       Go to the top of this page

But now I have got Gstreamer error (can not play file mp3 online)
In attach file python it you can see it ..

code:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
Gstreamer error: Could not resolve server name. (3) from source
I/  [InfoBar.setPlaybackState] :: connecting... Streaming error: Could not resolve server name. 1548709298.07
W/  [InfoBar._checkReconnect] :: False / 0
[eDBusInterface::Private::sendEvent 0
resolved to PLAY -1
I/  [PlayerImpl.stopPolling] :: <no detail>
I/  [PlayerImpl.stopPolling] :: <no detail>
I/  [UPnPPlayer.stopPolling] :: <no detail>
I/  [UPnPPlayer.stopPolling] :: <no detail>
Gstreamer error: Could not resolve server name. (3) from source
I/  [InfoBar.setPlaybackState] :: connecting... Streaming error: Could not resolve server name. 1548709298.08
W/  [InfoBar._checkReconnect] :: 0 / 0
resolved to PLAY -1
I/  [PlayerImpl.stopPolling] :: <no detail>
I/  [PlayerImpl.stopPolling] :: <no detail>
I/  [UPnPPlayer.stopPolling] :: <no detail>
I/  [UPnPPlayer.stopPolling] :: <no detail>
Gstreamer error: Internal data flow error. (1) from source
Gstreamer error: Stream contains not enough data. (4) from typefindelement4
I/  [InfoBar.setPlaybackState] :: connecting... Couldn't find media type 1548709298.08
release cached channel (timer timeout)
[eDVBCAService] remove channel 0x17ea8c8
[eDVBCAService] write leave transponder to '/tmp/camd.socket' ok


on my image depend on openpli (OE2.0) works just fine as log shown ..
code:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
[ActionMap] Keymap 'OkCancelActions' -> Action = 'ok'
playing 4097:0:0:0:0:0:0:0:0:0:http%3a//audio3.islamweb.net/quran/mesarawi/rawh_yaqoob/001.mp3
[eDVBCAService] free slot 0 demux 0 for service 1:0:1:8:1BC0:2BE:1040000:0:0:0:
[eDVBCAService] free service 1:0:1:8:1BC0:2BE:1040000:0:0:0:
[eDVBResourceManager] start release channel timer
[eTSMPEGDecoder] decoder state: play, vpid=ffffffff, apid=ffffffff
[eDVBPCR0] DEMUX_STOP ok
[eDVBPCR0] destroy
[eDVBVideo0] DEMUX_STOP  ok
[eDVBVideo0] VIDEO_STOP ok
[eDVBVideo0] destroy
[eDVBAudio0] AUDIO_STOP ok
[eDVBAudio0] DEMUX_STOP ok
[eDVBAudio0] AUDIO_CONTINUE ok
[eDVBAudio0] destroy
cleaning up
TuxTxt cache cleared
[servicelist] search for service in userbouquets
[servicelist] service not found in any userbouquets
GstPlayer::GstPlayer initializing with options:
 audio_id                       = not set
 audio_sink                     = not set
 buffer_duration                = 0s
 buffer_size                    = 8192KB
 download_buffer_path           = not set
 ring_buffer_maxsize            = not set
 subtitles_enabled              = 1
 video_sink                     = not set
eServiceApp::isCurrentlySeekable
eServiceApp::isCurrentlySeekable
eServiceApp::isCurrentlySeekable
resolved to PLAY
eServiceApp::unpause
eServiceApp::isCurrentlySeekable
resolved to PLAY
eServiceApp::unpause
eServiceApp::isCurrentlySeekable
eServiceApp::isCurrentlySeekable
resolved to PLAY
eServiceApp::unpause
new service started! trying to download cuts!
download failed, no cuesheet interface
RemovePopup, id = ZapError
eServiceApp::isCurrentlySeekable
eServiceApp::fillSubservices - failed to retrieve subservices, not supported url
PlayerBackend::gotMessage - tStart
PlayerApp::processStart: gstplayer_gst-1.0 "http://audio3.islamweb.net/quran/mesarawi/rawh_yaqoob/001.mp3" -d 0 -s 8192 -e 
11520
11520
[ePicLoad] setPara max-X=300 max-Y=300 aspect_ratio=1.000000 cache=0 resize=0 bg=#FF000000 auto_orient=0
[ePicLoad] <format not supported>
[SKIN] Parsing embedded skin <embedded-in-'SCreenPlayerCoran'>
[Skin] Processing screen: <embedded-in-'SCreenPlayerCoran'>
warning, skin is missing element channel_icon in <class 'Plugins.Extensions.ALAJRE.outils.Player.SCreenPlayerCoran'>
warning, skin is missing element channel_uri in <class 'Plugins.Extensions.ALAJRE.outils.Player.SCreenPlayerCoran'>
GstPlayer::handleJsonOutput - unhandled key "GSTPLAYER_EXTENDED"
[ePicLoad] setPara max-X=350 max-Y=350 aspect_ratio=1.000000 cache=0 resize=1 bg=#FF000000 auto_orient=0
[ePicLoad] <format not supported>
[Skin] Processing screen: SimpleSummary
PlayerBackend::recvStart - status = 0
PlayerBackend::gotMessage - start
eServiceApp::gotExtPlayerMessage - start
PlayerBackend::recvAudioTrackSelected - status = 0, trackId = 0
PlayerBackend::recvStopped - retval = 0
PlayerBackend::thread_finished
PlayerBackend::gotMessage - stop
eServiceApp::gotExtPlayerMessage - stop
eServiceApp::isCurrentlySeekable
resolved to PLAY
eServiceApp::unpause
eServiceApp::signalEventUpdatedInfo
eServiceApp::getNumberOfTracks
WaitThread - waiting for 500ms
WaitThread - in time


Attachment:
unknown Player.py (18.28 KB, 4 downloads)

This post has been edited 1 time(s), it was last edited by fairbird: 28.01.2019 22:32.

28.01.2019 22:04 fairbird is offline Send an Email to fairbird Search for Posts by fairbird Add fairbird to your Buddy List
fairbird
Newbie


Registration Date: 14.12.2009
Posts: 90
Which box: DM800; DM800se; DM920
External Storage: USB-Stick; HDD
Which Image: OE 2.5
Origin: Bahrain

Thread Starter Thread Started by fairbird
Reply to this Post Post Reply with Quote Edit/Delete Posts Report Post to a Moderator       Go to the top of this page

Hi friends ..
Please how to solve this crash ?!
code:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
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
code:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
    def DownloadAyats(self, main_url):
        self.letter_list2 = []
        self.ProgramTv = []
        request = urllib2.Request(main_url, None, Agent)
        data = urllib2.urlopen(request).read()
        if data:
            ayats = re.findall('<li class="LineAya"> <a href="(.*?)" title="(.*?)">(.*?)</a>', data)
            Info1 = re.findall('<i class="fas fa-circle-notch"></i>(.*?)</li>', data)
            for a in Info1:
                self.infossourats += a + '\n'

            self.kkl = len(ayats)
            for i in range(self.kkl):
                try:
                    self.letter_list2.append(show_listiptv(ayats[i][1], ayats[i][0], ayats[i][2], str(i + 1), ''))
                except IndexError:
                    pass

            self['ProgramTv'].l.setList(self.letter_list2)
            self['ProgramTv'].l.setItemHeight(150)
            self.N_Ayats = len(self.letter_list2)
            Elaya = self['ProgramTv'].getCurrent()[0][0] + '"' + self['ProgramTv'].getCurrent()[0][3] + '"'
            self['infoss'].setText('\n' + Elaya)
            self['Box'].setText(self.infossourats)
            self.DownloadCalendar('http://v22v.net/services/calendar.html')
        else:
            self['Box'].setText('HTTP Error')
08.04.2019 21:08 fairbird is offline Send an Email to fairbird Search for Posts by fairbird Add fairbird to your Buddy List
Dre Dre is a male
V.I.P.


images/avatars/avatar-8101.jpg

Registration Date: 05.11.2004
Posts: 1,375
Which box: DM800; DM7000; DM7020; DM7020HD; DM7025; DM8000
External Storage: USB-Stick
Which Image: Merlin
Welcher Bildschirm: 37PF9731/10
Origin: Schwiiz

Reply to this Post Post Reply with Quote Edit/Delete Posts Report Post to a Moderator       Go to the top of this page

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

__________________
Gruss Dre

Developer Project Merlin
08.04.2019 21:25 Dre is online Send an Email to Dre Search for Posts by Dre Add Dre to your Buddy List
fairbird
Newbie


Registration Date: 14.12.2009
Posts: 90
Which box: DM800; DM800se; DM920
External Storage: USB-Stick; HDD
Which Image: OE 2.5
Origin: Bahrain

Thread Starter Thread Started by fairbird
Reply to this Post Post Reply with Quote Edit/Delete Posts Report Post to a Moderator       Go to the top of this page

If I add
code:
1:
2:
3:
4:
5:
try:

except IndexError:
                    pass

Do you think will be solve it ?!

This post has been edited 1 time(s), it was last edited by fairbird: 08.04.2019 21:33.

08.04.2019 21:33 fairbird is offline Send an Email to fairbird Search for Posts by fairbird Add fairbird to your Buddy List
Dre Dre is a male
V.I.P.


images/avatars/avatar-8101.jpg

Registration Date: 05.11.2004
Posts: 1,375
Which box: DM800; DM7000; DM7020; DM7020HD; DM7025; DM8000
External Storage: USB-Stick
Which Image: Merlin
Welcher Bildschirm: 37PF9731/10
Origin: Schwiiz

Reply to this Post Post Reply with Quote Edit/Delete Posts Report Post to a Moderator       Go to the top of this page

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

__________________
Gruss Dre

Developer Project Merlin
08.04.2019 22:05 Dre is online Send an Email to Dre Search for Posts by Dre Add Dre to your Buddy List
fairbird
Newbie


Registration Date: 14.12.2009
Posts: 90
Which box: DM800; DM800se; DM920
External Storage: USB-Stick; HDD
Which Image: OE 2.5
Origin: Bahrain

Thread Starter Thread Started by fairbird
Reply to this Post Post Reply with Quote Edit/Delete Posts Report Post to a Moderator       Go to the top of this page

In attach file if you can read it and give some advice ..

Thank you

Attachment:
zip Coran.zip (6 KB, 6 downloads)
08.04.2019 22:56 fairbird is offline Send an Email to fairbird Search for Posts by fairbird Add fairbird to your Buddy List
Dre Dre is a male
V.I.P.


images/avatars/avatar-8101.jpg

Registration Date: 05.11.2004
Posts: 1,375
Which box: DM800; DM7000; DM7020; DM7020HD; DM7025; DM8000
External Storage: USB-Stick
Which Image: Merlin
Welcher Bildschirm: 37PF9731/10
Origin: Schwiiz

Reply to this Post Post Reply with Quote Edit/Delete Posts Report Post to a Moderator       Go to the top of this page

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.

__________________
Gruss Dre

Developer Project Merlin
09.04.2019 18:37 Dre is online Send an Email to Dre Search for Posts by Dre Add Dre to your Buddy List
fairbird
Newbie


Registration Date: 14.12.2009
Posts: 90
Which box: DM800; DM800se; DM920
External Storage: USB-Stick; HDD
Which Image: OE 2.5
Origin: Bahrain

Thread Starter Thread Started by fairbird
Reply to this Post Post Reply with Quote Edit/Delete Posts Report Post to a Moderator       Go to the top of this page

Thank you ..
Understood ...
09.04.2019 19:49 fairbird is offline Send an Email to fairbird Search for Posts by fairbird Add fairbird to your Buddy List
Tree Structure | Board Structure
Jump to:
Post New Thread Post Reply
i-have-a-dreambox.com | Dreambox - Support » Developer Bereich (CVS, Openembedded) » Python » How to fix picload To DreamOS ?!

Privacy policy | Team | Suchen | Hilfe


Powered by Burning Board 2.3.6 © 2001-2003 WoltLab GbR