On Wednesday, July 19, 2017 at 8:58:31 AM UTC-5, vitalije wrote:

> For last few days I was experimenting with writing external files 
(at-file trees) and parsing those files to recreate tree. I have started 
this exploration looking for a better way to use new v.lines property. This 
is short report of what I have found so far.

This is truly great stuff.  The code uses regex and generators elegantly.

I have attached at-file-experiments2.leo with some minor changes.

> New code is not full replacement for leoAtFile.py. It just knows how to 
read python files generated with at-file code. However, I believe it won't 
be too hard to add missing features.

That's exciting.

> My intention is not to criticize your code in leoAtFile or to compete 
with you.

Improving the code will make Leo stronger and more flexible. I am thrilled 
that you are interested in improving the code.

Generators did not exist in Python when I first started.  And only last 
year (with the new import code) have I begun to use regex patterns.  The 
old pattern matching code is embarrassingly complicated.

*Notes*

- The easy way to clear the log is c.frame.log.clearLog().
- This statement failed for me: 
report_loc('/home/vitalije/.leo/scriptFile.py')

Here is the log when I ran this script in leoPy.leo, my local copy of 
LeoPyRef.leo (in master):

ekr.20031218072017.2608 @file leoApp.py 
c:\leo.repo\leo-editor\leo\core\leoApp.py
ekr.20141012064706.18389 @file leoAst.py 
c:\leo.repo\leo-editor\leo\core\leoAst.py
ekr.20150323150718.1 @file leoAtFile.py 
c:\leo.repo\leo-editor\leo\core\leoAtFile.py
ekr.20161026193447.1 @file leoBackground.py 
c:\leo.repo\leo-editor\leo\core\leoBackground.py
ekr.20150521115018.1 @file leoBeautify.py 
c:\leo.repo\leo-editor\leo\core\leoBeautify.py
ekr.20070227091955.1 @file leoBridge.py 
c:\leo.repo\leo-editor\leo\core\leoBridge.py
ekr.20100208065621.5894 @file leoCache.py 
c:\leo.repo\leo-editor\leo\core\leoCache.py
ekr.20070317085508.1 @file leoChapters.py 
c:\leo.repo\leo-editor\leo\core\leoChapters.py
ekr.20150605175037.1 @file leoCheck.py 
c:\leo.repo\leo-editor\leo\core\leoCheck.py
ekr.20140827092102.18574 @file leoColorizer.py 
c:\leo.repo\leo-editor\leo\core\leoColorizer.py
ekr.20031218072017.2810 @file leoCommands.py 
c:\leo.repo\leo-editor\leo\core\leoCommands.py
ekr.20130925160837.11429 @file leoConfig.py 
c:\leo.repo\leo-editor\leo\core\leoConfig.py
ekr.20130302121602.10208 @file leoDebugger.py 
c:\leo.repo\leo-editor\leo\core\leoDebugger.py
ekr.20160306114544.1 @file leoExternalFiles.py 
c:\leo.repo\leo-editor\leo\core\leoExternalFiles.py
ekr.20031218072017.3018 @file leoFileCommands.py 
c:\leo.repo\leo-editor\leo\core\leoFileCommands.py
ekr.20031218072017.3093 @file leoGlobals.py 
c:\leo.repo\leo-editor\leo\core\leoGlobals.py
ekr.20150514154159.1 @file leoHistory.py 
c:\leo.repo\leo-editor\leo\core\leoHistory.py
ekr.20031218072017.3206 @file leoImport.py 
c:\leo.repo\leo-editor\leo\core\leoImport.py
ekr.20120401063816.10072 @file leoIPython.py 
c:\leo.repo\leo-editor\leo\core\leoIPython.py
ekr.20031218072017.3320 @file leoNodes.py 
c:\leo.repo\leo-editor\leo\core\leoNodes.py
ekr.20140821055201.18331 @file leoPersistence.py 
c:\leo.repo\leo-editor\leo\core\leoPersistence.py
ekr.20031218072017.3439 @file leoPlugins.py 
c:\leo.repo\leo-editor\leo\core\leoPlugins.py
ekr.20150419124739.1 @file leoPrinting.py 
c:\leo.repo\leo-editor\leo\core\leoPrinting.py
ekr.20061024060248.1 @file leoPymacs.py 
c:\leo.repo\leo-editor\leo\core\leoPymacs.py
ekr.20140810053602.18074 @file leoQt.py c:\leo.repo\leo-editor\leo\core\leoQt.py
ekr.20140526082700.18440 @file leoRope.py 
c:\leo.repo\leo-editor\leo\core\leoRope.py
ekr.20090502071837.3 @file leoRst.py c:\leo.repo\leo-editor\leo\core\leoRst.py
ekr.20120420054855.14241 @file leoSessions.py 
c:\leo.repo\leo-editor\leo\core\leoSessions.py
ekr.20080708094444.1 @file leoShadow.py 
c:\leo.repo\leo-editor\leo\core\leoShadow.py
ekr.20031218072017.3446 @file leoTangle.py 
c:\leo.repo\leo-editor\leo\core\leoTangle.py
ekr.20031218072017.3603 @file leoUndo.py 
c:\leo.repo\leo-editor\leo\core\leoUndo.py
ekr.20131109170017.16504 @file leoVim.py 
c:\leo.repo\leo-editor\leo\core\leoVim.py
there were some errors. see log
leoAtFile.py code:4227  comments:910  empty:79
can not open /home/vitalije/.leo/scriptFile.py
scriptFile.py code:0  comments:0  empty:0
ok
truncating headline to one line
saved: leoPy.leo

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.

Attachment: at-file-experiments2.leo
Description: Binary data

Reply via email to