Yesterday I started work on leoPersistence.py. It is a re-imagining of
leoViews.py. This post discusses this new module in detail.
As of recent revs, the code in leoPersistence.py is connected to Leo via
the c.leoPersistence ivar. The c.leoViews ivar no longer exists, though
leoViews.py is still part of the repo. All but one new unit test covering
leo.core.leoPersistence now pass. The unit tests for leoViews.py have been
disabled.
Terminology. A **foreign** file is a file created by @auto, @org-mode or
@vim-outline. The latter two do not exist yet, but they will asap.
@org-mode or @vim-outline fully describe outline structure but do not (of
course) directly support gnx's or uA's. The leoPersistence module promises
to allow Leo to reliably associate gnx's (and thus uA's) will all such
files.
Now to the actual description of leoPersistence.py. As mentioned earlier,
it is based on leoViews.py, but it attempts *no* reordering or renaming of
incoming nodes. As a result, none of the horrendously complex code in
leoViews.py exists in leoPersistence.py. This is a *big* step forward.
Leo will store the needed in a tree (in the Leo outline) as follows, from
the docstring of the PersistenceDataController class:
QQQ
- @persistence
- @data <headline of foreign node>
- @gnxs
body text: pairs of lines: gnx:<gnx><newline>unl:<unl>
- @uas
@ua <gnx>
body text: the pickled uA
QQQ
The only real difficulty is associating the unl's saved in @gnx's with the
"incoming" nodes, that is, the nodes read by @auto, @org-mode or
@vim-outline. This will done using pd.find_absolute_unl_node or
pd.find_position_for_relative_unl. Work is needed on these: more in
another thread.
In any case, the idea is straightforward: search each unl for a
corresponding node in the incoming outline. If found, set the node's gnx,
then use the gnx to set the uA and clone links. I expect only a few days
work will be needed complete the code.
Edward
--
You received this message because you are subscribed to the Google Groups
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.