I'm trying to import a python source code file into leo via "Main menu-
>File->Import->Import To @file".

For a minimal example consider that the file contains this code:

--- cut here ---
class MyClass:

    def method1(self):

        pass

    m1 = method1()

    def method2(self):

        pass

    m2 = method2()

--- cut here ---

Please try importing this and see what happens.
The "class MyClass" node has the following body:
--- cut here ---
class MyClass:
    @others
    m2 = method2()

--- cut here ---

and two child nodes (one for each method).
They look like this:

--- cut here ---
head:
method1

body:

def method1(self):

    pass

--- cut here ---
head:
method2

body:
m1 = method1()

def method2(self):

    pass

--- cut here ---

As you can see, the line "m1 = method1()" landed into the second
child.
I want it to land into the first one, because it's related to it.
The line "m2 = method2()" landed into the body of the class node.
I want it to land into the body of the second method, because it's
related to it.

Now, after importing the python code, I change the @file directive to
@shadow.
I can make the needed changes manually to achieve my goal.
The changes will stay persistent (to leo restarts) as long as there
will be "shadows" in .leo_shadow directories.
As soon as these directories disappear (for any reason: they get
deleted, the source code tree is replicated in another place without
them), the @shadow tree gets refreshed automatically, and I loose the
correct layout again.
I would be happy to change the things manually after import, assuming
there's a way to achieve persistency without depending on the content
of .leo_shadow directories (if that is possible somehow), so I would
need to do the manual changes only once.

I'm confident that I can't use @thin, because the source code files
need to be modified outside leo by other people, thus they must not
contain sentinels.

-- 
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.

Reply via email to