Beiträge von Sharkadder

    Ok i will try the new code,


    The reason i need to close all screens at once is because a user e-mailed me saying they'd like to close down the plugin from an "exit plugin" button after they have zapped to a channel using my WebsiteParser plugin...i did tell him it only takes an extra 2 seconds to press exit 5 or so times but you have to keep users happy.


    I will try your code and let you know the outcome reichi.


    Many thankk and danke

    I do not understand, i don't appear to have a callback function. When i launch TransponderChannels screen i do this code:

    Code
    self.session.open(TransponderChannels,transponderfoundlist,channelfoundlist)


    Shown above is the screen being opened with two parameters passed. When i close TransponderChannels from within the screen i do the code below which works fine:


    Code
    self.close()


    So i do not get why it is now asking for a callback as i shouldn't need to give it one if it closes ok from the screen itself.


    I have changed the close function in the global class so that it equals screens.close(False), the green screen here states that the first parameter should not be boolean, i then changed screens.close(TransponderChannels) and it says that it shouldn't take a type as a first parameter. I just don't see why it is not closing as i don't open the screen with a callback in the first place. Maybe you could explain another way which may work.


    Thanks,


    Mark

    Ok i tried your suggestion and it doesn't work. For some reason the program doesn't recognise other screens open, even when i define a class to remove programs in the global scope. Here is the code i have:


    The above code brings the following error in the crash log when i view it:


    Code
    File "/usr/lib/enigma2/python/Components/ActionMap.py", line 46, in action
      File "/usr/lib/enigma2/python/Plugins/Extensions/TheWebsiteParser/plugin.py", line 2768, in closeplugin
    	ClosePlugin()
      File "/usr/lib/enigma2/python/Plugins/Extensions/TheWebsiteParser/plugin.py", line 8448, in ClosePlugin
    	screens.close()
    TypeError: unbound method close() must be called with TransponderChannels instance as first argument (got nothing instead)
    (PyObject_CallObject(<bound method ActionMap.action of <Components.ActionMap.ActionMap instance at 0x1e75120>>,('ColorActions', 'blue')) failed)


    I have also tried to say self.session.close(MainMenu), that code goes through but the screen does not close unless you are on it.


    Do you know the right way i need to write this code to close all screens? The way you suggested is not working for me.


    Thanks,


    Mark

    Hi there,


    I know that i can close a screen using self.close() and the current session will close but what code do i use to close down a plugin all together?


    Example is i have a plugin that has many screens, i'd like the user to be able to exit the plugin from a screen other than the first one in the plugin to save them having to press exit many times.


    If anybody knows the code then that is apprechiated


    Many thanks,


    Mark

    Hello there,


    For a plugin i am creating i wish to include a zap to channel feature, i have got the majority of it sorted but i am having some problems with codes for western satellites after i create instance of ScanSetup file.


    the eastern satellites show like this (just the satellite degrees but without the . e.g. 192 instead of 19.2:


    astra1 19.2east = 192
    16.0east = 160
    hotbird 13.0east = 130


    However i have noticed the western ones have a different code, shown below is what i mean, i expected the western ones to be e.g. "-08" for 0.8west but it shows up as 3592 instead.


    8.0west = 3520
    5.0west = 3550
    0.8west = 3592


    Can somebody tell me how these codes are generated for western satellites and if indeed the eastern ones are simply the degree position without the dot? What can i do to the western ones to make them in a more readable format such as "-08" for 0.8west or will i just have to go around the western ones and work them out individually?


    The code i refer to is the code within ScanSetup file, obviously the default satellite is 19.2, when i change "orbpos" to say -08 for 0.8west it just comes up as 61west instead.



    Thanks


    Mark

    Hello there,


    Recently i have been trying to display some images on the screen within a menulist, i discovered that the images wouldn't display inside the menulist but any text i added would. I then tried putting a different image into the menulist and this image appeared to work fine.


    I then thought that my png image might have been in the wrong format, so i tried drawing it as a Pixmap on the screen and the image draws fine...so why does it not display inside a multicontententry menu list?


    Here is some code i have been working on:



    ok so basically i press the ok button and the image i wish to show inside the menulist along side the text saying "hello" is displayed inside the Pixmap "feedpic" but not inside the menulist. Can anybody figure out how i could also get this image displayed inside the menulist?


    Thanks

    Hi, i have created a small plugin on python but i am stuck on how i can send text from one page to another, i know that i need to use a session callback but i am not sure how to do it.


    How can i send the current index from a list called "mylist" and store it's value on another screen when i press the ok button?


    So far i have this:


    Code
    def ok(self):
    		itemnumber = self["mylist"].l.getSelectedIndex(self)
    		self.session.open(MyTestScreen2)


    So when i run that, i'd like a new session to open called MyTestScreen2 and the variable itemnumber to be passed to a label within that screen called mylistindex. How do i do this?


    I know i cannot put mylistindex.text = itemnumber because itemnumber is local to the previous session only.


    Thanks


    EDIT i managed to solve my problem by adding in an extra parameter when setting up a new window, i supply the window with an extra parameter and it displays the right value. People who are interested in passing data between windows in future might be interested to know this.


    I post my plugin once completed.

    ok it says in the crash log that no module is called subprocess, but when i run it on windows or linux it shows that they is a module called sub process. Do you think it could be to do with the version of python in which i am using? Here i use python 2.6, any idea why that code works on a pc but not dream? Is they a list of modules which work on dreambox anywhere?


    Anyways here is the relivent part to what the crashlog tells me:


    Code
    action ->  ColorActions blue
    Traceback (most recent call last):
      File "/usr/lib/enigma2/python/Components/ActionMap.py", line 46, in action
    	res = self.actions[action]()
      File "/usr/lib/enigma2/python/Plugins/Extensions/Testing/plugin.py", line 417, in ping
    	import subprocess
    ImportError: No module named subprocess

    ok i am struggling to get what is going on there with that container, i am assuming that econsole allows you to display a console window inside a container, is this correct? I then assume i type the commands i wish to use within this window and then they execute yes?


    I saw a testplugin of a file browser, i am assuming that i can look at this and change the code for the dir command for a ping command or something. This is just for my practice, it's so i can get used to how enigma2 works from general linux programming.

    Hi, i have written programs in python before but it seems that when i try running some on my DB 8000 it doesn't like some of the functions in which i am using. I tried to create a simple ping plugin for my own testing use and it works when i try it on winpython but when i put it onto the dreambox it comes up with a blue screen everytime i run that part of the plugin.


    Basically everytime the user presses the blue button the following is to be called:
    (the code below actually does get called)





    Ok excuse the bad indentation there, the file is properly indented but that is what is called when the blue button is pressed. If i remove that code from my plugin, the plugin will compile and load properly on the dreambox, so why does my ping code not work? Does the dreambox not like import subprocesses or something? If not how could i go about doing a basic ping example on a dreambox? I'll have to get used to knowing which functions work on a dreambox and which don't from my normal way of programming within the language.


    Thanks