Hi Edward, Thanks for these explanations.
I agree, the script is not meant to preserve outline structure, only corrects blank lines after importing @clean files. Unfortunately I don't really know how to change my workflow in order to avoid importing @clean files. Currently I cannot use @file nodes, I have to use @clean nodes, so I have to import them. As I stated before there is a minor issue with c.recursiveImport. It uses an other algorithm to import @clean files, importing from "File->Import File..." menu has no the same issue. I think a better option for c.recursiveImport would be to use the same algorithm as "File->Import File...". Regards, Zoltan On Friday, March 18, 2016 at 3:21:40 AM UTC+2, Edward K. Ream wrote: > > On Thursday, March 3, 2016 at 4:12:49 AM UTC-6, Edward K. Ream wrote: >> >> On Thu, Mar 3, 2016 at 2:59 AM, Zoltan Benedek <[email protected] >> <javascript:>> wrote: >> >>> >>> >>> https://github.com/benzolius/leo-scripts/blob/master/correct_empty_lines.py >>> >>> Corrects blank lines according to PEP8 (at least between main blocks: >>> classes, functions and between methods), even if it had wrong blank lines >>> before importing into Leo. >>> >> >> A great idea. I'll add a command to do this. It's on the list. >> > > I still think this is a good idea, but everyone should understand that > *importing* an @clean file is a bad idea. > > For example, refresh-from-disk will create an outline from any @clean > file, but you lose all the headlines and outline structure of the original > file. > > Instead, you should copy and paste the @clean node from one outline to > another. This preserves everything (except gnx's in the .leo file). > paste-retaining-clones would even preserve gnx's, iirc. > > I have been cutting and pasting @clean trees recently because there are > files in leo/external that mirror scripts whose main git repo is > elsewhere. Yes, git could actually include a subsidiary repo in > leo/external, but I don't want to go there. > > > > *Summary*1. copy and paste is the *only* way to preserve headlines and > outline structure when "importing" @clean nodes. > > 2. *After* you have pasted an @clean tree, (or before, for that matter), > running the suggested script would be useful. But this script is in no way > a substitute for preserving outline structure with copy/paste. > > Clear? > > 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.
