Re: The new markdown importer is ready for real testing

2016-11-26 Thread 'Terry Brown' via leo-editor
On Sat, 26 Nov 2016 09:36:34 -0800 (PST) "Edward K. Ream" wrote: > Rev cc5b28b3 completes all planned work on the markdown importer, > including some subtle cases. Please report any problems immediately. Not sure if this work was related to my md bug report, but I'll try

Re: A new pattern for me: `s.isspace()` instead of `not s.strip()`

2016-11-26 Thread rengel
In short, we are getting to matters of style. Imo, this: > >> return [self.lstrip_line(z) for z in lines] >> >> is slightly preferable to: >> >> return ['\n' if z.isspace() else z.lstrip() for z in lines] >> >> > Furthermore, i.clean_blank_lines() uses i.lstrip_line(): > > def

The new markdown importer is ready for real testing

2016-11-26 Thread Edward K. Ream
Rev cc5b28b3 completes all planned work on the markdown importer, including some subtle cases. Please report any problems immediately. The new test-driven development work flow is working very well in typical cases. A few rough edges remain, but they did not affect me today. I estimate that

Re: A new pattern for me: `s.isspace()` instead of `not s.strip()`

2016-11-26 Thread Edward K. Ream
On Saturday, November 26, 2016 at 8:04:20 AM UTC-6, Edward K. Ream wrote: > > In short, we are getting to matters of style. Imo, this: > > return [self.lstrip_line(z) for z in lines] > > is slightly preferable to: > > return ['\n' if z.isspace() else z.lstrip() for z in lines] > >

Re: A new pattern for me: `s.isspace()` instead of `not s.strip()`

2016-11-26 Thread Edward K. Ream
​​ On Sat, Nov 26, 2016 at 5:40 AM, Edward K. Ream wrote: > On Friday, November 25, 2016 at 7:59:56 AM UTC-6, rengel wrote: > >> Why use two functions, when one suffices? >> >> def strip_lws(s): >>return '\n'.join([z.lstrip() for z in s.splitlines(False)]) >> > ​>

A 21+ hour day working on the markdown importer

2016-11-26 Thread Edward K. Ream
Up at 2am. Down at 11:30pm, with a long walk for a break. *tl;dr:* read the summary This is a long status report. Feel free to ignore. However, it does discuss an important change, visible to users, of how Leo handle's markdown outlines. And it does discuss some unit testing issues that may

Re: A new pattern for me: `s.isspace()` instead of `not s.strip()`

2016-11-26 Thread Edward K. Ream
On Saturday, November 26, 2016 at 5:40:22 AM UTC-6, Edward K. Ream wrote: > Provided all tests pass, it's probably safe to define g.splitLines as: def splitLines(s): assert g.isString(s), (repr(s), g.callers()) return s.splitLines() Oops. The last line must be s.splitlines(True).

Re: A new pattern for me: `s.isspace()` instead of `not s.strip()`

2016-11-26 Thread Edward K. Ream
On Friday, November 25, 2016 at 7:59:56 AM UTC-6, rengel wrote: > Why use two functions, when one suffices? > > def strip_lws(s): >return '\n'.join([z.lstrip() for z in s.splitlines(False)]) > Beautiful. I'm going to make this change today. The Importer class uses i.lstrip_line() in one