On Fri, Dec 3, 2021 at 9:09 AM vitalije <[email protected]> wrote:

> I would like to explain a little more how my code works.

Thanks.  I have begun my study. I'll ask questions as needed.

Substantial work would be required to fold your script into the overall
infrastructure created by the base Importer class. I would be happy to let
you take it from here, but I'm also willing to help.  What would you like
to do?

Note that the devel branch contains all my recent work. I plan no more
importer work.

*Attached script*

I started my study of your script by converting the script to an outline.
See the attached .leo file.

I made minor changes to make my study easier. Here is a summary of the
top-level changes:

- Clear the log first, so that pyflakes warnings remain visible.
- Import the Importer class from leo.plugins.linescanner.
- Pass the file's contents and name to import_one_level.
  This will make it easier to simulate unit tests.
- Select and expand the resulting outline during the redraw.

*Revised functions*

- ensure_root writes to the last top-level node, creating it if necessary.
The headline is always 'Imported Files...'.

- rename includes the first significant line of p.b in p.h. The start of
p.h is either "Docstring" or "Organizer".

- import_one_level has a new signature and uses the Importer class to check
the import.
  The test of difflib.py reports "same 2", meaning that the import is
perfect after ignoring blank lines.

That's all for now.

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 view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/CAMF8tS2md-%3D%2BWXRmV%3Du7FfAPaZoyo6Cfyf%3DQBXN2Mj8oEy7QJA%40mail.gmail.com.

Attachment: VitalijeScript3.leo
Description: Binary data

Reply via email to