This work completes the recent work re importing tabbed files.  There was a 
cascade of work involved:

1. Leo now sports a new import-tabbed-files command.  It prompts for one or 
more files that use tabs (or blanks) to specify outline structure.  It 
imports lines from the files as children of a single node.

2. The File menu used to contain just an "Import Files..." command. This 
has now been demoted to an "Import..." submenu, containing several other 
commands.

The import-files command can still be used on (almost?) any kind of file, 
but imo it's important to add the other import commands to the menu as 
advertizing. Otherwise, it's hard to know, *from the menu*, that Leo can 
import FreeMind, MindMap, MORE and tab-delimited files, as well as Zim 
folders, whatever they are ;-)

Yes, <Alt-X>import-<tab> will show you all the available import commands, 
but newbies may not know that.

Yes, this increases the number of visible commands in the various menus, 
but I think the new submenu hides enough detail.  In fact, the new submenu 
seems more standard and clearer.  YMMV, but you aren't going to change my 
mind.

3. I added the import-MORE-files command and improved/corrected its logic.  
It now handles MORE-like file whose outline structure is indicated by 
leading *blanks* as well as tabs, as in the original MORE file format. 
Sure, nobody is likely ever to use this code, but I wanted to test it...

4. leo.core.leoImport now contains a TabImporter class, used by the 
import-tabbed-files command.  Scripts can use it as well.  The @button 
import-tab-files node in scripts.leo could now be simplified as follows:

separate = True # True: put all lines in separate nodes.
path = r'c:/test/tab_file_test.txt'
import leo.core.leoImport as leoImport
importer = leoImport.TabImporter(c, separate=separate)
importer.import_files([path])

In fact, however, the @button node in scripts.leo contains the old code as 
well...

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 https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Reply via email to