Many plugins will want to store transient data, i.e. data that should be persistent for local user but should not be put to .leo file (which annoys other users and causes unnecessary diffs).
Yes, I'm talking about expanded node annotations and frame positions. I'm also talking about "interesting nodes" database, and other plugin stuff that can make a candidate for uAs (but of the kind you do not want in the leo file). The technology I'm proposing is 'pickleshare' (yeah, I wrote it ;-). It's used in ipython to store its persistent data (bookmarks, %store'd variables like macros, aliases...). pickleshare is like 'shelve' module, but works for concurrent processes (so it doesn't break when multiple leo instances are accessing it concurrently). Like the name suggests, it stores pickles with dict-like access. In ipython, the global pickleshare database is available as _ip.db, if you want to play with it interactively. The pypi page has a short example: http://pypi.python.org/pypi/pickleshare It's just a simple module in single file, so as a dependency it's pretty harmless (unlike zodb) and can be put to leo extensions dir. I think they are planning to provide an sqlite implementation of shelve interface, but that's not there yet (perhaps only for python3?), but for leo's concurrent load (it's pretty much a single-user system ;-) pickleshare will definitely by "scalable" enough. The interface for leo would be pretty simple: c.db['interest_scores'] = [12,11111] mylist = c.db['interest_scores'] mylist.append('foobar') c.db['interest_scores'] = mylist c.db['myplugin/foo'] = { 1111 : 'hello' } This would manipulate the per-file database (stores under ~/.leo/path_hash_value). Conceivable would be also a global database under g.db (for storing e.g. recent files, some global settings). Note that these settings, like shadow files, would not be meant to be shared with others at all. They can also be useful as caches. I would do all the work for making this available, of course. -- Ville M. Vainio http://tinyurl.com/vainio --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "leo-editor" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/leo-editor?hl=en -~----------~----~----~----~------~----~------~--~---
