View Single Post
Old 03-09-2011, 10:25 AM   #11
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,922
Karma: 22669820
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Assume the sequence of actions is always a tuple, a make a copy like this

actions = list(actions)

The fact that it is occasionally a list is a side effect of JSON not supporting tuples.

And when you commit it use

gprefs[whatever] = tuple(actions)

And dont worry about instantiating the plugin. If things need to change there, I'll fix them when you submit the code.
kovidgoyal is offline   Reply With Quote