Beiträge von Claudio72

    From my test this quoted text is OK

    I've added the blue button to "Execute" something, I'm trying to get the current value related to the position in the menu:


    I would like only to print the selected item value:


    def execute(self):
    selected = self["config"].getCurrent()
    self.session.open(MessageBox, (_("Blue Key Pressed %s") % selected), MessageBox.TYPE_INFO)


    it give me an error:


    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/StayUP/plugin.py", line 48, in execute
    self.session.open(MessageBox, (_("Blue Key Pressed %s") % selected), MessageBox.TYPE_INFO)
    TypeError: not all arguments converted during string formatting
    (PyObject_CallObject(<bound method ActionMap.action of <Components.ActionMap.ActionMap instance at 0x2f18c738>>,('ColorActions', 'blue')) failed)

    Ok,
    - I was able to transform the multi entry into an array using the list[]
    - I was able to use the ConfigSelection to change yes/no into a list of custom values


    for the ConfigSelection, I've a question:


    config.plugins.StayUP.PiconType = ConfigSelection(
    [("1ST Argument value", 1ST Argument text"),
    ("2ND Argument value", "2ND Argument text")
    ], "1ST Argument value")


    What's the first and the second arguments means? Is Value and Text as I've in my example? The last 1ST Argument value is the default value?


    I've another important question, how can I register a TIMER entry to run a particular function in the plugin?
    I see in your RS plugin that you use the "ConfigClock(default=time())" function. But, how to you control what's has to be run in that particular time()?

    Thanks!!!


    I have two questions.


    1)StayUPConfigFunction(ConfigListScreen, Screen)
    those two arguments means:
    ConfigListScreen - this is the way we fill the screen
    Screen - the screen itself


    2)May I go back to "WHERE_PLUGINMENU"? or there is a specific reason you choosed the Extension Menu?





    p.s.: I've also asked for documentation in the DM8000 VIP CLUB without success :grinning_squinting_face: , right now you're my only resource.
    (http://www.dm8000-vip.de/forum…age=Thread&threadID=2414&)

    main py


    <cut>
    from StayUPConfigModule import StayUPConfigFunction
    <cut>
    list.append((_("Configure"), "config"))
    <cut>
    if returnValue is "config":
    self.session.open(StayUPConfigFunction)
    <cut>





    root@dm800:/usr/lib/enigma2/python/Plugins/Extensions/StayUP# more StayUPConfigModule.py
    #
    from Components.ActionMap import ActionMap
    from Components.config import config, ConfigText, ConfigYesNo, ConfigClock, ConfigSubsection, getConfigListEntry
    from Components.ConfigList import ConfigListScreen
    from Components.Label import Label
    from time import time


    ##############################################################################


    config.plugins.StayUP = ConfigSubsection()
    config.plugins.StayUP.onoff = ConfigYesNo(default=True)


    ##############################################################################


    class StayUPConfigFunction(ConfigListScreen):
    skin = """
    <screen position="80,170" size="560,270" title="RS Downloader">
    <ePixmap pixmap="skin_default/buttons/red.png" position="0,0" size="140,40" transparent="1" alphatest="on" />
    <ePixmap pixmap="skin_default/buttons/green.png" position="140,0" size="140,40" transparent="1" alphatest="on" />
    <ePixmap pixmap="skin_default/buttons/yellow.png" position="280,0" size="140,40" transparent="1" alphatest="on" />
    <ePixmap pixmap="skin_default/buttons/blue.png" position="420,0" size="140,40" transparent="1" alphatest="on" />
    <widget name="key_green" position="140,0" zPosition="1" size="140,40" font="Regular;20" valign="center" halign="center" backgroundColor="#1f771f" transparent=1" />
    <widget name="config" position="0,45" size="560,220" scrollbarMode="showOnDemand" />
    </screen>"""


    def __init__(self, session):
    self.skin = StayUPConfigFunction.skin
    self.session = session
    ConfigListScreen.__init__(self, session)


    self["key_green"] = Label(_("Save"))


    list = []
    list.append(getConfigListEntry(_("Enable Plugin:"), config.plugins.StayUP.onoff))
    ConfigListScreen.__init__(self, list)


    self["actions"] = ActionMap(["OkCancelActions", "ColorActions"], {"green": self.save, "cancel": self.exit}, -1)


    def save(self):
    for x in self["config"].list:
    x[1].save()
    self.close()


    def exit(self):
    for x in self["config"].list:
    x[1].cancel()
    self.close()


    root@dm800:/usr/lib/enigma2/python/Plugins/Extensions/StayUP#

    This is the error I get:


    Screen Plugins.Extensions.StayUP.StayUPConfigModule.StayUPConfigFunction((), {}): <type 'exceptions.AttributeError'>
    Traceback (most recent call last):
    File "/usr/lib/enigma2/python/mytest.py", line 222, in create
    return screen(self, *arguments, **kwargs)
    File "/usr/lib/enigma2/python/Plugins/Extensions/StayUP/StayUPConfigModule.py", line 27, in __init__
    ConfigListScreen.__init__(self, session)
    File "/usr/lib/enigma2/python/Components/ConfigList.py", line 129, in __init__
    }, -1) # to prevent left/right overriding the listbox
    AttributeError: StayUPConfigFunction instance has no attribute '__setitem__'
    open /dev/dbox/fp0 for wakeup timer clear failed!(No such file or directory)
    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/StayUP/plugin.py", line 65, in go
    self.session.open(StayUPConfigFunction)
    File "/usr/lib/enigma2/python/mytest.py", line 296, in open
    dlg.isTmp = True
    AttributeError: 'NoneType' object has no attribute 'isTmp'
    (PyObject_CallObject(<bound method ActionMap.action of <Components.ActionMap.ActionMap instance at 0x2f1b4b98>>,('WizardActions', 'ok')) failed)

    I really have trouble now,


    I'm trying to follow your RSS plugin.


    I have created a second py to launch the configuration screen, but I can't figure out this step:


    class RSConfig(ConfigListScreen, TitleScreen):"


    why 2 parameters? why the second one?



    could you also please explain the meaning of the statement


    TitleScreen.__init__(self, session)


    or


    ConfigListScreen.__init__(self, list)



    anyway, if you can point me to a documentation it would be wonderfull

    Ok, let's talk about the mosaic plugin


    config_limits = (3, 30)
    this is a variable, I think 3 and 30 are 2 values of this config_limits(some kind of an array large 2) are they representing a range value?


    config.plugins.Mosaic = ConfigSubsection()
    what's this? some kind of a structural call? config.plugins.Mosaic is the name you have choose to identify your configurations? ConfigSubsection() is an Enigma2 function...?


    config.plugins.Mosaic.countdown = ConfigInteger(default=5, limits=config_limits)
    This is an integer, default value is 5, the range is specified by config_limits, OK?


    config.plugins.Mosaic.countdown.save()
    This is the statement to save the countdown value, OK?




    MANY THANKS!!!

    Thanks for your answer.
    I've started yesterday from that example and I'm trying something more complicated.


    Do you have an example on how it's the simplest way to write a config file?
    Suppose I have on the screen a single line, with the left/right remote control button I choose between some fixed values.
    Once decided the right values, I would like to write the entry into a config file.



    I'm trying some reverse engineering on WebInterface Plugin, but it's really complicated, I can't see any file opening or wathever, it looks like all embedded into something I can't recognize...
    Somehow it looks like the configuration is managed by this "ConfigList.py" module. but how? and how to communicate with this module?


    At least It would be wonderfull to get a real Complete Documentation

    Hello all,
    Is there a way to launch phyton script that require enigma2 libraries from outside enigma2 realm.
    Maybe from the web interface? or with a particular TIMER entry?


    I have to run a script that invoke a epg.reloadEpg(), if I run it as a Standard Extension Plugin it works fine, of course if I run it manually from the command line, it give me:


    rroot@dm800:/usr/lib/enigma2/python/Plugins/Extensions/StayUP# python plugin.py



    Traceback (most recent call last):
    File "plugin.py", line 1, in <module>
    from enigma import *
    ImportError: No module named enigma


    thanks in advance,
    Claudio72