View Single Post
Old 02-24-2011, 03:38 AM   #1
meme
Sigil developer
meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.
 
Posts: 1,274
Karma: 1101600
Join Date: Jan 2011
Location: UK
Device: Kindle PW, K4 NT, K3, Kobo Touch
JSONConfig has no delete method

JSONConfig in utils/config.py allows set/get but not delete of a specific key. Is it possible to delete a key from a plugin's json file?

Normally I don't need this, but I'm renaming a key and the only way I found to 'remove' the old key is to set the old key value to Null.

This is sufficient, although it leaves old/unused data in the file, and it means an extra test is needed since the key exists but the data is Null (since get(store_name, DEFAULTS) will not set the key to DEFAULTS if the key exists but is a dict with Null).
meme is offline   Reply With Quote