Re: Exception running Markdown_Importer

2018-04-27 Thread Edward K. Ream
On Fri, Apr 27, 2018 at 9:56 AM, Rob  wrote:

> I restarted Leo w/ --no-cache option and I still get the error.
>

​Thanks.

Looks like you have just uncovered a new markdown bug.

md.find_parent is tricky. A new guard might be all that is required, but I
would like to dig deeper.

Are you willing to send me the .md file that causes the crash?

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 leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Exception running Markdown_Importer

2018-04-27 Thread Rob
I restarted Leo w/ --no-cache option and I still get the error.

Rob...

On Friday, April 27, 2018 at 10:08:52 AM UTC-4, Edward K. Ream wrote:
>
>
> ​Have you tried loading Leo with --no-cache​?  If that works, please clear 
> all the caches and try again.
>
> 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 leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Exception running Markdown_Importer

2018-04-27 Thread Edward K. Ream
On Fri, Apr 27, 2018 at 9:08 AM, Edward K. Ream  wrote:

On Fri, Apr 27, 2018 at 9:05 AM, Edward K. Ream  wrote:
>
>> On Fri, Apr 27, 2018 at 8:17 AM, Rob  wrote:
>>
>> As usual, I update my Leo instance every few days or so (devel branch ).
>>> After today's update and opening my standard set of files, I get this error:
>>>
>>
>> ​Strange.  Git reports that the last change to
>> plugins/importers/markdown.py (on any branch) was on
>> ​ ​
>> 2017-12-30 17:18:30​.
>>
>
> ​> was there perhaps some errors introduced in the external file somehow
> that makes the file unreadable? ​
>
>
> ​Have you tried loading Leo with --no-cache​?  If that works, please clear
> all the caches and try again.
>

​I have created #877 
for this.  Perhaps recent cache-related changes are to blame.  This issue
should be resolved for 5.7.2.

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 leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Exception running Markdown_Importer

2018-04-27 Thread Edward K. Ream
On Fri, Apr 27, 2018 at 9:05 AM, Edward K. Ream  wrote:

> On Fri, Apr 27, 2018 at 8:17 AM, Rob  wrote:
>
> As usual, I update my Leo instance every few days or so (devel branch ).
>> After today's update and opening my standard set of files, I get this error:
>>
>
> ​Strange.  Git reports that the last change to
> plugins/importers/markdown.py (on any branch) was on
> ​ ​
> 2017-12-30 17:18:30​.
>

​> was there perhaps some errors introduced in the external file somehow
that makes the file unreadable? ​


​Have you tried loading Leo with --no-cache​?  If that works, please clear
all the caches and try again.

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 leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Exception running Markdown_Importer

2018-04-27 Thread Edward K. Ream
On Fri, Apr 27, 2018 at 8:17 AM, Rob  wrote:

As usual, I update my Leo instance every few days or so (devel branch ).
> After today's update and opening my standard set of files, I get this error:
>

​Strange.  Git reports that the last change to
plugins/importers/markdown.py (on any branch) was on
2017-12-30 17:18:30​
.

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 leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Exception running Markdown_Importer

2018-04-27 Thread Rob
As usual, I update my Leo instance every few days or so (devel branch ). 
After today's update and opening my standard set of files, I get this error:

reading: @auto-md Software.md
Exception running Markdown_Importer
Traceback (most recent call last):


  File "D:\Synced\github repos\leo\leo\core\leoApp.py", line 1468, in 
scanner_for_at_auto_cb
return scanner.run(s, parent)


  File "D:\Synced\github repos\leo\leo\plugins\importers\linescanner.py", 
line 463, in run
self.generate_nodes(s, parent)


  File "D:\Synced\github repos\leo\leo\plugins\importers\linescanner.py", 
line 530, in generate_nodes
self.gen_lines(s, parent)


  File "D:\Synced\github repos\leo\leo\plugins\importers\markdown.py", line 
48, in gen_lines
self.make_node(level, name)


  File "D:\Synced\github repos\leo\leo\plugins\importers\markdown.py", line 
146, in make_node
self.find_parent(level=level, h=name)


  File "D:\Synced\github repos\leo\leo\plugins\importers\markdown.py", line 
85, in find_parent
return self.stack[level]


IndexError: list index out of range


read 21 files in 1.10 seconds
read outline in 1.14 seconds

Did something change in the importer, or was there perhaps some errors 
introduced in the external file somehow that makes the file unreadable?
 For context, my environment:

Leo 5.7.2 devel, build 20180423091843, Mon, Apr 23, 2018  9:18:43 AM
Git repo info: branch = devel, commit = 462b46ba77b9
Python 3.4.3, PyQt version 5.4.1
Windows 8 AMD64 (build 6.2.9200) 
isPython3: True
caching enabled

Rob...

-- 
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 leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Exception running Markdown_Importer

2016-12-16 Thread Edward K. Ream
On Tue, Dec 13, 2016 at 7:25 AM, Edward K. Ream  wrote:

​> ​
The problem is likely the following regex:
​ ​
[snip]​

Fixed, I think, at rev bd90f4d.​

​As noted in the checkin log, ​actual @auto-md files import @@section names
correctly, but some dashed problem with the unit testing logic is requiring
a kludge.  Maybe no big deal...

Please test the new code and report any problems.  Thanks.

EKR

-- 
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 leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Exception running Markdown_Importer

2016-12-13 Thread Edward K. Ream
On Mon, Dec 12, 2016 at 2:50 PM, Largo84  wrote:

> No, the refresh from disk was for a @auto-md node. The ``@@`` was in a
> child node headline.
>

​Thanks for the clarification.​


​The problem is likely the following regex:

md_hash_pattern = re.compile(r'^(#+)\s*(\w+)(.*)\n')

in the is_hash method. It requires a *word *following 1 or more '#'
characters.  That's too strict, it seems.  Instead, it should just eat
everything except trailing whitespace.

Playing around with pythex , it appears that the
following might work:

md_hash_pattern = re.compile(r'^(#+)\s*(.+)\s*\n')

You can try this yourself if you like.  I probably won't get to it today.

EKR

-- 
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 leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Exception running Markdown_Importer

2016-12-12 Thread Largo84
No, the refresh from disk was for a @auto-md node. The ``@@`` was in a 
child node headline. Sorry if that wasn't clear.

Rob..

On Monday, December 12, 2016 at 10:04:53 AM UTC-5, Edward K. Ream wrote:
>
>
>
> On Fri, Dec 9, 2016 at 12:41 PM, Largo84  
> wrote:
>
>> Terry, I added an addendum to my original post that I think indicates 
>> what caused the problem, the use of ``@@`` in the node headline. Not sure 
>> if that's a bug or a feature:-)
>>
>
> ​When I awoke this morning I thought of this.  Are you saying that you did 
> a refresh-from-disk with an @@auto x.rst node selected?
>
> That would explain the improper calculation of level.  It wouldn't explain 
> why refresh-from-disk was allowed ;-)
>
> EKR
>

-- 
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 leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Exception running Markdown_Importer

2016-12-12 Thread Edward K. Ream
On Fri, Dec 9, 2016 at 12:41 PM, Largo84  wrote:

> Terry, I added an addendum to my original post that I think indicates what
> caused the problem, the use of ``@@`` in the node headline. Not sure if
> that's a bug or a feature:-)
>

​When I awoke this morning I thought of this.  Are you saying that you did
a refresh-from-disk with an @@auto x.rst node selected?

That would explain the improper calculation of level.  It wouldn't explain
why refresh-from-disk was allowed ;-)

EKR

-- 
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 leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Exception running Markdown_Importer

2016-12-12 Thread Largo84
Try this for yourself and see what happens:

Scenario 1 (@@ Section as first child node)
1) Create a new new empty node say, @auto-md Some File.md 
2) Create a new child node say, @@ Section 1 (body text optional)
3) Save the file to create the external file. Viewed in external editor, 
the layout is as expected.
4) Refresh from disk.

The read code creates a !Declarations node with the following body text:
#@@ Section1
Body text

Scenario 2 (@@ Section *not* the first child node)
1) Same as above except the @@ Section is a subsequent node (or child node).
2) Save and refresh from disk.
3) Now the parent node node contains:
``#@@ Section 1`` as body text, not the node header as expected.

If your setup doesn't duplicate this behavior, I will send you a small 
sample file.

Rob.

On Sunday, December 11, 2016 at 4:32:08 AM UTC-5, Edward K. Ream wrote:
>
> On Fri, Dec 9, 2016 at 12:41 PM, Largo84  
> wrote:
>
>> Terry, I added an addendum to my original post that I think indicates 
>> what caused the problem, the use of ``@@`` in the node headline. Not sure 
>> if that's a bug or a feature:-)
>> ​
>>
>
> ​Greetings from Northern Mississippi :-)
>
> If you have ever written the .md file ​from Leo, the markdown writer will 
> use hash ('#') markup for all sections.  And even if not, @@ should never 
> affect underlining, which is limited to "=" or "-" characters.
>
> My guess is that level is zero, so maybe the actual markup isn't the real 
> issue. Please send me the file, so I can see exactly what is happening.
>
> EKR
>

-- 
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 leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Exception running Markdown_Importer

2016-12-11 Thread Edward K. Ream
On Fri, Dec 9, 2016 at 12:41 PM, Largo84  wrote:

> Terry, I added an addendum to my original post that I think indicates what
> caused the problem, the use of ``@@`` in the node headline. Not sure if
> that's a bug or a feature:-)
> ​
>

​Greetings from Northern Mississippi :-)

If you have ever written the .md file ​from Leo, the markdown writer will
use hash ('#') markup for all sections.  And even if not, @@ should never
affect underlining, which is limited to "=" or "-" characters.

My guess is that level is zero, so maybe the actual markup isn't the real
issue. Please send me the file, so I can see exactly what is happening.

EKR

-- 
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 leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Exception running Markdown_Importer

2016-12-09 Thread Largo84
Terry, I added an addendum to my original post that I think indicates what 
caused the problem, the use of ``@@`` in the node headline. Not sure if 
that's a bug or a feature:-)

Rob..


> so you must be using a construct that I'm not using.
>
> Cheers -Terry
>
> --
>
>

-- 
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 leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: Exception running Markdown_Importer

2016-12-09 Thread 'Terry Brown' via leo-editor
Just an observation, I'm using markdown quite a bit at the moment and not 
seeing that problem with
Leo 5.4, build 20161208140632, Thu, Dec 08, 2016  2:06:32 PM
Git repo info: branch = master, commit = 91bb3a5c8ef7Python 2.7.5, PyQt version 
4.8.5Windows 7 AMD64 (build 6.1.7601) SP1
so you must be using a construct that I'm not using.
Cheers -Terry
 
  From: Largo84 <larg...@gmail.com>
 To: leo-editor <leo-editor@googlegroups.com> 
 Sent: Friday, December 9, 2016 8:11 AM
 Subject: Exception running Markdown_Importer
   
Just got this one this morning on one file:
Exception running Markdown_ImporterTraceback (most recent call last):  File 
"D:\Synced\github repos\leo\leo\core\leoImport.py", line 915, in 
scanner_for_at_auto_cb    return scanner.run(s, parent, prepass=prepass)  File 
"D:\Synced\github repos\leo\leo\plugins\importers\linescanner.py", line 449, in 
run    self.generate_nodes(s, parent)  File "D:\Synced\github 
repos\leo\leo\plugins\importers\linescanner.py", line 513, in generate_nodes    
self.gen_lines(s, parent)  File "D:\Synced\github 
repos\leo\leo\plugins\importers\markdown.py", line 50, in gen_lines    
self.make_node(level, name)  File "D:\Synced\github 
repos\leo\leo\plugins\importers\markdown.py", line 146, in make_node    
self.find_parent(level=level, h=name)  File "D:\Synced\github 
repos\leo\leo\plugins\importers\markdown.py", line 89, in find_parent    return 
self.stack[level]IndexError: list index out of range
Anything else you need?Rob..-- 
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 leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


   
 

-- 
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 leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Exception running Markdown_Importer

2016-12-09 Thread Largo84
Just got this one this morning on one file:

Exception running Markdown_Importer
Traceback (most recent call last):
  File "D:\Synced\github repos\leo\leo\core\leoImport.py", line 915, in 
scanner_for_at_auto_cb
return scanner.run(s, parent, prepass=prepass)
  File "D:\Synced\github repos\leo\leo\plugins\importers\linescanner.py", 
line 449, in run
self.generate_nodes(s, parent)
  File "D:\Synced\github repos\leo\leo\plugins\importers\linescanner.py", 
line 513, in generate_nodes
self.gen_lines(s, parent)
  File "D:\Synced\github repos\leo\leo\plugins\importers\markdown.py", line 
50, in gen_lines
self.make_node(level, name)
  File "D:\Synced\github repos\leo\leo\plugins\importers\markdown.py", line 
146, in make_node
self.find_parent(level=level, h=name)
  File "D:\Synced\github repos\leo\leo\plugins\importers\markdown.py", line 
89, in find_parent
return self.stack[level]
IndexError: list index out of range

Anything else you need?
Rob..

-- 
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 leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.