Hi again,
A friend was getting the following error:
Traceback (most recent call last):
File "/usr/lib/enigma2/python/Screens/Hotkey.py", line 315, in action
File "/usr/lib/enigma2/python/Screens/Hotkey.py", line 331, in hotkeyGlobal
File "/usr/lib/enigma2/python/Screens/Hotkey.py", line 76, in getHotkeyFunctionsList
TypeError: 'NoneType' object has no attribute '__getitem__'
(PyObject_CallObject(<bound method hotkeyActionMap.action of <Screens.Hotkey.hotkeyActionMap instance at 0x282bd50>>,('HotkeyActions', 'cross_up')) failed)
The problem was that plugin.name was None (i haven't spot the plugin causing that error yet, but i will). Problem solved by checking that path is not None:
--- Hotkey.py.orig
+++ Hotkey.py
@@ -72,7 +72,7 @@
pluginlist = plugins.getPlugins([PluginDescriptor.WHERE_PLUGINMENU ,PluginDescriptor.WHERE_EXTENSIONSMENU, PluginDescriptor.WHERE_EVENTINFO])
pluginlist.sort(key=lambda p: p.name)
for plugin in pluginlist:
- if plugin.name not in twinPlugins:
+ if plugin.name not in twinPlugins and plugin.path:
hotkeyFunctions.append((plugin.name, plugin.path[24:]))
twinPlugins.append(plugin.name)
hotkeyFunctions.append(("--", "--"))
Regarding the following SyntaxError...
Hi,
I was trying to make some changes in Hotkey.py and i am notice the following when starting enigma2 (after deleting Hotkey.pyo):
/usr/lib/enigma2/python/Screens/Hotkey.py:349: SyntaxWarning: import * only allowed at module level
def execHotkey(self, selected):
Ignore it?
Here is another way to import * without the SyntaxWarning.
--- Hotkey.py.orig
+++ Hotkey.py
@@ -362,10 +362,14 @@
exec "self." + selected[1] + "()"
elif selected[0] == "Module":
try:
- exec "from " + selected[1] + " import *"
+ exec "import " + selected[1]
+ for p in dir(selected[1]):
+ exec "from " + selected[1] + " import " + p
exec "self.session.open(" + ",".join(selected[2:]) + ")"
except:
print "[Hotkey] error during executing module %s, screen %s" % (selected[1], selected[2])
elif selected[0] == "Setup":
- from Screens.Setup import *
+ import Screens.Setup
+ for p in dir(Screens.Setup):
+ exec "from Screens.Setup import " + p
exec "self.session.open(Setup, \"" + selected[1] + "\")"
Finally (the most stupid question), how do i use Hotkey, where do i find it?
Edited by athoik, 25 September 2014 - 21:12.
Wavefield T90: 0.8W - 1.9E - 4.8E - 13E - 16E - 19.2E - 23.5E - 26E - 33E - 39E - 42E - 45E on EMP Centauri DiseqC 16/1
Unamed: 13E Quattro - 9E Quattro on IKUSI MS-0916