Jump to content


Photo

Messagebox to open read file


  • Please log in to reply
13 replies to this topic

#1 mino60

  • Member
  • 24 posts

0
Neutral

Posted 7 February 2019 - 13:45

Hello

I created an enigma2 plugin in a part I would like to make a messagebox
the message opens a file that I download it on the Web


ok: self.Messagebox

def Messaagebox

f= file('/tmp/message', w)
self.session.open(Messagebox, message, + str(f) + ) Messagebox_type_INFO

Re: Messagebox to open read file #2 littlesat

  • PLi® Core member
  • 46,802 posts

+487
Excellent

Posted 7 February 2019 - 13:51

You should open the messagebox with callback... the callback function will be called (so you can continue) when the Message box closes..


WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: Messagebox to open read file #3 mino60

  • Member
  • 24 posts

0
Neutral

Posted 7 February 2019 - 14:29

The message appears on the screen but not the content of the download file just
/tmp/message

Re: Messagebox to open read file #4 betacentauri

  • PLi® Core member
  • 4,883 posts

+232
Excellent

Posted 7 February 2019 - 19:31

At best post complete code. We can’t guess how you download the message and how you read the file.
Xtrend ET-9200, ET-8000, ET-10000, OpenPliPC on Ubuntu 12.04

Re: Messagebox to open read file #5 mino60

  • Member
  • 24 posts

0
Neutral

Posted 8 February 2019 - 07:38

the download file with a shell script an html file

 

exemple:

monfichier=/tmp/monfichier

file monfichier:

*Only channels with a caid A801 are supported for now. Channels with no caid will need an additional configuration via the SoftCam.Key and will be supported in the next release.
 

 

    def MessageBox(self):
            Update = '/tmp/monfichier'      
            f = file('/tmp/monfichier', 'w')
            f.write(Update)
            f.close()
            self.session.open(MessageBox,_("Enigma2 update" + str(Update) + "Message test"), MessageBox.TYPE_INFO, timeout=20)
            



Re: Messagebox to open read file #6 littlesat

  • PLi® Core member
  • 46,802 posts

+487
Excellent

Posted 8 February 2019 - 08:03

Why download via a shellscript as python can also do it?.... we have several examples in our e2 code where we download from websites and indicate progression. When it is only for indicatieve it is finished you can better use notification instead of messagebox

Edited by littlesat, 8 February 2019 - 08:06.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: Messagebox to open read file #7 betacentauri

  • PLi® Core member
  • 4,883 posts

+232
Excellent

Posted 8 February 2019 - 10:25

Why open the file for writing? You want to read the file as far as I understood.
Xtrend ET-9200, ET-8000, ET-10000, OpenPliPC on Ubuntu 12.04

Re: Messagebox to open read file #8 mino60

  • Member
  • 24 posts

0
Neutral

Posted 8 February 2019 - 10:40

Why download via a shellscript as python can also do it?.... we have several examples in our e2 code where we download from websites and indicate progression. When it is only for indicatieve it is finished you can better use notification instead of messagebox

you can give an example because I can not find it in github e2 openpli

 

https://github.com/OpenPLi/enigma2



Re: Messagebox to open read file #9 mino60

  • Member
  • 24 posts

0
Neutral

Posted 8 February 2019 - 10:46

my problem the message that starts with * does not appear on the screen just

Enigma2 update/tmp/monfihier Message test



Re: Messagebox to open read file #10 mino60

  • Member
  • 24 posts

0
Neutral

Posted 8 February 2019 - 11:05

result of the message

 

  • dysAv2B.jpg


Re: Messagebox to open read file #11 littlesat

  • PLi® Core member
  • 46,802 posts

+487
Excellent

Posted 8 February 2019 - 11:28

You also tell the Message box that it should not show "Only channels with a caid A801 are supported for now. Channels with no caid will need an additional configuration via the SoftCam.Key and will be supported in the next release."...

You say it should show 

_("Enigma2 update" + str(Update) + "Message test"

and that is exactly what it is doing..


WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: Messagebox to open read file #12 betacentauri

  • PLi® Core member
  • 4,883 posts

+232
Excellent

Posted 8 February 2019 - 14:31

And that’s also what I wrote ;) You need to read the file and store the content in a variable which you then show via message box. (or I don’t understand what you want to do)
Xtrend ET-9200, ET-8000, ET-10000, OpenPliPC on Ubuntu 12.04

Re: Messagebox to open read file #13 mino60

  • Member
  • 24 posts

0
Neutral

Posted 8 February 2019 - 19:50

You also tell the Message box that it should not show "Only channels with a caid A801 are supported for now. Channels with no caid will need an additional configuration via the SoftCam.Key and will be supported in the next release."...

You say it should show 

_("Enigma2 update" + str(Update) + "Message test"

and that is exactly what it is doing..

my file on tmp (monfichier) and a variable the text changes every day

what I want is to display the text that starts with a star " *Only channels with a caid A801...."



Re: Messagebox to open read file #14 mino60

  • Member
  • 24 posts

0
Neutral

Posted 8 February 2019 - 20:00

And that’s also what I wrote ;) You need to read the file and store the content in a variable which you then show via message box. (or I don’t understand what you want to do)

that's exactly what I want if not I script can do that too but I prefer messagebox or a notification


Edited by mino60, 8 February 2019 - 20:01.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users