Hi,
Okay, here is a prototype of a Python API that could be used to manage the boxinfo data. I suggest that this become "Tools/BoxInfo.py". Currently there are 4 proposed methods "loadBoxInfo()", "getItem(key, default)", "setItem(key, value)" and "deleteItem(key)".
- loadBoxInfo() reloads the "/etc/enigma2/boxinfo" file. This is automatically done when the code first loads but the method can force a reload at any time.
- getItem(key, default) returns the current value of the item key if it exists or default if it doesn't.
- setItem(key, value) sets the key to value. Returns True if it worked or False if that key is immutable.
- deleteItem(key) deletes the key. Returns True if it worked or False if the key did not exist or is immutable.
The keys should be the text strings that we previously discussed in "boxinfo.txt" file.
This code could either replace the SystemInfo module or else compliment it.
What do people think?
Regards,
Ian.