PDA

View Full Version : smallutils - plugin



oldfart
06-09-2012, 09:59 PM
I have (slightly) modified one of emanual's tutorials.
It presents a menu (you can add/change) the entries
it then calls a system command and outputs the results to the 'command' window.
the command window size is fixed by the skin you are using - don't know how to make it bigger - you can play!!

download the rar
create a directory called smallutils inside
/usr/lib/enigma2/python/Plugins/Extensions
put the 3 files in that directory
chmod 644
restart gui (this puts the plugin into the plugins menu)

modify the code as you want:-
to do that, you edit the plugin.py file
delete the two .pyo files in the /usr/lib/enigma2/python/Plugins/Extensions/smallutils directory
restart gui

oldfart
06-09-2012, 10:08 PM
this is the bit that creates the menu

list = []
list.append(("netstat", "com_one"))
list.append(("drive space", "com_two"))
list.append(("mount", "com_three"))
list.append(("free memory", "com_four"))
list.append((_("Exit"), "exit"))

with corresponding actions for the list entries:-

if returnValue is not None:
if returnValue is "com_one":
self.prompt("/bin/netstat -lant")

elif returnValue is "com_two":
self.prompt("/bin/df -h")

elif returnValue is "com_three":
self.prompt("/bin/mount")

elif returnValue is "com_four":
self.prompt("/usr/bin/free")

so if you select the second entry, 'value' is com_two
so now the returnValue is com_two and that piece of code is executed; and so on ...