VR3 Working With Both Qt6 and Qt5, But ...

2021-04-12 Thread tbp1...@gmail.com
I was able to get VR3 working with Qt6, but I had to switch to using a 
QTextBrowser instead of a QWebEngine, since Qt6 doesn't yet have a 
QWebEngine class.  These changes work with Qt5 as well, but the result 
isn't satisfactory because the QTextBrowser isn't using the css stylesheet 
for display.  When I export to the browser, the rendering is correct, but 
not in the Leo panel.

I'm wondering if this isn't about stylesheets being in separate files and 
the QTextBrowser not finding them.  One difference is that with the 
QWebEngine, we had

w.setHtml(s, url_base)

but with the QTextBrowser, that method does not take a url_base parameter.  
Since stylesheet paths are relative paths, without the url_base, maybe the 
QTextBrowser can't find them.

Does someone know how to handle this situation?

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/846afa8f-d2a8-48a1-a2ee-7457312973a6n%40googlegroups.com.


Re: ekr-qt branch Leo Won't Start When pyqt6 installed

2021-04-12 Thread tbp1...@gmail.com
It would, but this is simpler and doesn't require one to keep various venvs 
straight.  I tend to forget which is for what and what state they are in.

On Monday, April 12, 2021 at 7:17:37 PM UTC-4 gates...@gmail.com wrote:

> Sounds like a situation that virtualenv would solve.
>
> On Apr 12, 2021, at 6:00 PM, tbp1...@gmail.com  wrote:
>
> 
>
> Here is how I configured my installation to let me either use or not use 
> pyqt6. Obviously it's a Windows computer:
>
> 1. Create new directory.  I used %USERPROFILE%\.python\site-packages
> 2. Cut all the installed pyqt6 directories from the standard 
> Lib\site-packages directory.
> 3. Paste the pyqy6 directories into the new .python\site-packages 
> directory.
>
> To run without pyqt6, I just launch Leo as usual.  To run using pyqt6, I 
> set the PYTHONPATH environmental variable:
>
> set PYTHONPATH=%USERPROFILE%\.python\site-packages
>
> Now Leo will launch using pyqt6.
>
> If you have copied all the pyqt6 install directories also, then pip will 
> find them and be able to properly list pyqt6 as well as the pyqt5  that is 
> in the standard location.
> On Monday, April 12, 2021 at 5:24:50 PM UTC-4 tbp1...@gmail.com wrote:
>
>> Typo:
>> NoFrame = QtWidgets.QFrame.Shape.NoFrame if isQt6 else self.noFrame
>>
>> should be
>>
>> NoFrame = QtWidgets.QFrame.Shape.NoFrame if isQt6 else self.NoFrame 
>>
>> With this correction, it runs when only qt5 is available.
>> On Monday, April 12, 2021 at 2:59:44 PM UTC-4 tbp1...@gmail.com wrote:
>>
>>> I got qt_text to work - at least on the surface - with these changes:
>>>
>>> Sunken = QtWidgets.QFrame.Shadow.Sunken if isQt6 else 
>>> self.Sunken
>>>
>>> Raised = QtWidgets.QFrame.Shadow.Raised if isQt6 else 
>>> self.StyledPanel
>>> NoFrame = QtWidgets.QFrame.Shape.NoFrame if isQt6 else 
>>> self.noFrame
>>> self.setFrameStyle(Raised | Sunken)
>>> self.edit = e  # A QTextEdit
>>> e.setFrameStyle(NoFrame)
>>>
>>> Then I also needed to change in update():
>>>
>>>#width = self.fm.width(str(max(1000, 
>>> self.highest_line))) + self.w_adjust
>>> if isQt6:
>>> width = self.fm.boundingRect(str(max(1000, 
>>> self.highest_line))).width()
>>> else:
>>> width = self.fm.width(str(max(1000, self.highest_line))) + 
>>> self.w_adjust
>>> if self.width() != width:
>>> self.setFixedWidth(width)
>>>
>>> With these changes. Leo opens outlines without crashing.  I notice that 
>>> the gutter numbers have too much padding-left, so they are cut off on the 
>>> right.  I don't know where that is set, so I didn't do anything about it.
>>>
>>> If you want, I can push these changes to my branch and do a PR.  It's 
>>> probably easier for you to jsut copy them into yours.  Just let me know if 
>>> you want the PR.
>>>
>>> Next up: VR3 won't load because
>>>
>>> viewrendered3.py requires QtWebKitWidgets.QWebView
>>> pip install PyQtWebEngine
>>>
>>> But how to get this without stepping on the one for qt5?  Hmmm.
>>>
>>> On Monday, April 12, 2021 at 1:57:39 PM UTC-4 tbp1...@gmail.com wrote:
>>>
 It failed because 
 LeoLineTextWidget' object has no attribute 'StyledPanel

 as expected ...
 On Monday, April 12, 2021 at 1:03:57 PM UTC-4 Edward K. Ream wrote:

> On Monday, April 12, 2021 at 11:55:03 AM UTC-5 tbp1...@gmail.com 
> wrote:
>
> Without testing it I don't think that will work. 
>>
>
> From https://doc.qt.io/qt-6/qframe.html#details "The frame style is 
> specified by a frame shape 
>  and a shadow style 
>  that is used to 
> visually separate the frame from surrounding widgets. These properties 
> can 
> be set together using the setFrameStyle 
> () function..."
>
> The only way to know for sure is to test it. The qt6 documentation has 
> proved unreliable in the past.
>
> 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+...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/leo-editor/3f9f3c39-678b-4b22-b1a2-183ab0e04cb9n%40googlegroups.com
>  
> 
> .
>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/0cd522ce-746e-4ac8-bdb4-d907428e3487n%40googlegroups.com.


Re: ekr-qt branch Leo Won't Start When pyqt6 installed

2021-04-12 Thread Jacob Peck
Sounds like a situation that virtualenv would solve.

> On Apr 12, 2021, at 6:00 PM, tbp1...@gmail.com  wrote:
> 
> 
> Here is how I configured my installation to let me either use or not use 
> pyqt6. Obviously it's a Windows computer:
> 
> 1. Create new directory.  I used %USERPROFILE%\.python\site-packages
> 2. Cut all the installed pyqt6 directories from the standard 
> Lib\site-packages directory.
> 3. Paste the pyqy6 directories into the new .python\site-packages directory.
> 
> To run without pyqt6, I just launch Leo as usual.  To run using pyqt6, I set 
> the PYTHONPATH environmental variable:
> 
> set PYTHONPATH=%USERPROFILE%\.python\site-packages
> 
> Now Leo will launch using pyqt6.
> 
> If you have copied all the pyqt6 install directories also, then pip will find 
> them and be able to properly list pyqt6 as well as the pyqt5  that is in the 
> standard location.
>> On Monday, April 12, 2021 at 5:24:50 PM UTC-4 tbp1...@gmail.com wrote:
>> Typo:
>> NoFrame = QtWidgets.QFrame.Shape.NoFrame if isQt6 else self.noFrame
>> 
>> should be
>> 
>> NoFrame = QtWidgets.QFrame.Shape.NoFrame if isQt6 else self.NoFrame 
>> 
>> With this correction, it runs when only qt5 is available.
>>> On Monday, April 12, 2021 at 2:59:44 PM UTC-4 tbp1...@gmail.com wrote:
>>> I got qt_text to work - at least on the surface - with these changes:
>>> 
>>> Sunken = QtWidgets.QFrame.Shadow.Sunken if isQt6 else 
>>> self.Sunken
>>> 
>>> Raised = QtWidgets.QFrame.Shadow.Raised if isQt6 else 
>>> self.StyledPanel
>>> NoFrame = QtWidgets.QFrame.Shape.NoFrame if isQt6 else self.noFrame
>>> self.setFrameStyle(Raised | Sunken)
>>> self.edit = e  # A QTextEdit
>>> e.setFrameStyle(NoFrame)
>>> 
>>> Then I also needed to change in update():
>>> 
>>>#width = self.fm.width(str(max(1000, 
>>> self.highest_line))) + self.w_adjust
>>> if isQt6:
>>> width = self.fm.boundingRect(str(max(1000, 
>>> self.highest_line))).width()
>>> else:
>>> width = self.fm.width(str(max(1000, self.highest_line))) + 
>>> self.w_adjust
>>> if self.width() != width:
>>> self.setFixedWidth(width)
>>> 
>>> With these changes. Leo opens outlines without crashing.  I notice that the 
>>> gutter numbers have too much padding-left, so they are cut off on the 
>>> right.  I don't know where that is set, so I didn't do anything about it.
>>> 
>>> If you want, I can push these changes to my branch and do a PR.  It's 
>>> probably easier for you to jsut copy them into yours.  Just let me know if 
>>> you want the PR.
>>> 
>>> Next up: VR3 won't load because
>>> 
>>> viewrendered3.py requires QtWebKitWidgets.QWebView
>>> pip install PyQtWebEngine
>>> 
>>> But how to get this without stepping on the one for qt5?  Hmmm.
>>> 
 On Monday, April 12, 2021 at 1:57:39 PM UTC-4 tbp1...@gmail.com wrote:
 It failed because 
 LeoLineTextWidget' object has no attribute 'StyledPanel
 
 as expected ...
> On Monday, April 12, 2021 at 1:03:57 PM UTC-4 Edward K. Ream wrote:
>> On Monday, April 12, 2021 at 11:55:03 AM UTC-5 tbp1...@gmail.com wrote:
>> 
> 
>> Without testing it I don't think that will work.
> 
> From https://doc.qt.io/qt-6/qframe.html#details "The frame style is 
> specified by a frame shape and a shadow style that is used to visually 
> separate the frame from surrounding widgets. These properties can be set 
> together using the setFrameStyle() function..."
> 
> The only way to know for sure is to test it. The qt6 documentation has 
> proved unreliable in the past.
> 
> 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 view this discussion on the web visit 
> https://groups.google.com/d/msgid/leo-editor/3f9f3c39-678b-4b22-b1a2-183ab0e04cb9n%40googlegroups.com.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/33180E0E-4858-43D8-8D60-EF229CE0EF4A%40gmail.com.


Re: ekr-qt branch Leo Won't Start When pyqt6 installed

2021-04-12 Thread tbp1...@gmail.com
Here is how I configured my installation to let me either use or not use 
pyqt6. Obviously it's a Windows computer:

1. Create new directory.  I used %USERPROFILE%\.python\site-packages
2. Cut all the installed pyqt6 directories from the standard 
Lib\site-packages directory.
3. Paste the pyqy6 directories into the new .python\site-packages directory.

To run without pyqt6, I just launch Leo as usual.  To run using pyqt6, I 
set the PYTHONPATH environmental variable:

set PYTHONPATH=%USERPROFILE%\.python\site-packages

Now Leo will launch using pyqt6.

If you have copied all the pyqt6 install directories also, then pip will 
find them and be able to properly list pyqt6 as well as the pyqt5  that is 
in the standard location.
On Monday, April 12, 2021 at 5:24:50 PM UTC-4 tbp1...@gmail.com wrote:

> Typo:
> NoFrame = QtWidgets.QFrame.Shape.NoFrame if isQt6 else self.noFrame
>
> should be
>
> NoFrame = QtWidgets.QFrame.Shape.NoFrame if isQt6 else self.NoFrame 
>
> With this correction, it runs when only qt5 is available.
> On Monday, April 12, 2021 at 2:59:44 PM UTC-4 tbp1...@gmail.com wrote:
>
>> I got qt_text to work - at least on the surface - with these changes:
>>
>> Sunken = QtWidgets.QFrame.Shadow.Sunken if isQt6 else 
>> self.Sunken
>>
>> Raised = QtWidgets.QFrame.Shadow.Raised if isQt6 else 
>> self.StyledPanel
>> NoFrame = QtWidgets.QFrame.Shape.NoFrame if isQt6 else 
>> self.noFrame
>> self.setFrameStyle(Raised | Sunken)
>> self.edit = e  # A QTextEdit
>> e.setFrameStyle(NoFrame)
>>
>> Then I also needed to change in update():
>>
>>#width = self.fm.width(str(max(1000, 
>> self.highest_line))) + self.w_adjust
>> if isQt6:
>> width = self.fm.boundingRect(str(max(1000, 
>> self.highest_line))).width()
>> else:
>> width = self.fm.width(str(max(1000, self.highest_line))) + 
>> self.w_adjust
>> if self.width() != width:
>> self.setFixedWidth(width)
>>
>> With these changes. Leo opens outlines without crashing.  I notice that 
>> the gutter numbers have too much padding-left, so they are cut off on the 
>> right.  I don't know where that is set, so I didn't do anything about it.
>>
>> If you want, I can push these changes to my branch and do a PR.  It's 
>> probably easier for you to jsut copy them into yours.  Just let me know if 
>> you want the PR.
>>
>> Next up: VR3 won't load because
>>
>> viewrendered3.py requires QtWebKitWidgets.QWebView
>> pip install PyQtWebEngine
>>
>> But how to get this without stepping on the one for qt5?  Hmmm.
>>
>> On Monday, April 12, 2021 at 1:57:39 PM UTC-4 tbp1...@gmail.com wrote:
>>
>>> It failed because 
>>> LeoLineTextWidget' object has no attribute 'StyledPanel
>>>
>>> as expected ...
>>> On Monday, April 12, 2021 at 1:03:57 PM UTC-4 Edward K. Ream wrote:
>>>
 On Monday, April 12, 2021 at 11:55:03 AM UTC-5 tbp1...@gmail.com wrote:

 Without testing it I don't think that will work. 
>

 From https://doc.qt.io/qt-6/qframe.html#details "The frame style is 
 specified by a frame shape 
  and a shadow style 
  that is used to 
 visually separate the frame from surrounding widgets. These properties can 
 be set together using the setFrameStyle 
 () function..."

 The only way to know for sure is to test it. The qt6 documentation has 
 proved unreliable in the past.

 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 view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/3f9f3c39-678b-4b22-b1a2-183ab0e04cb9n%40googlegroups.com.


Re: ekr-qt branch Leo Won't Start When pyqt6 installed

2021-04-12 Thread tbp1...@gmail.com
Typo:
NoFrame = QtWidgets.QFrame.Shape.NoFrame if isQt6 else self.noFrame

should be

NoFrame = QtWidgets.QFrame.Shape.NoFrame if isQt6 else self.NoFrame 

With this correction, it runs when only qt5 is available.
On Monday, April 12, 2021 at 2:59:44 PM UTC-4 tbp1...@gmail.com wrote:

> I got qt_text to work - at least on the surface - with these changes:
>
> Sunken = QtWidgets.QFrame.Shadow.Sunken if isQt6 else 
> self.Sunken
>
> Raised = QtWidgets.QFrame.Shadow.Raised if isQt6 else 
> self.StyledPanel
> NoFrame = QtWidgets.QFrame.Shape.NoFrame if isQt6 else self.noFrame
> self.setFrameStyle(Raised | Sunken)
> self.edit = e  # A QTextEdit
> e.setFrameStyle(NoFrame)
>
> Then I also needed to change in update():
>
>#width = self.fm.width(str(max(1000, 
> self.highest_line))) + self.w_adjust
> if isQt6:
> width = self.fm.boundingRect(str(max(1000, 
> self.highest_line))).width()
> else:
> width = self.fm.width(str(max(1000, self.highest_line))) + 
> self.w_adjust
> if self.width() != width:
> self.setFixedWidth(width)
>
> With these changes. Leo opens outlines without crashing.  I notice that 
> the gutter numbers have too much padding-left, so they are cut off on the 
> right.  I don't know where that is set, so I didn't do anything about it.
>
> If you want, I can push these changes to my branch and do a PR.  It's 
> probably easier for you to jsut copy them into yours.  Just let me know if 
> you want the PR.
>
> Next up: VR3 won't load because
>
> viewrendered3.py requires QtWebKitWidgets.QWebView
> pip install PyQtWebEngine
>
> But how to get this without stepping on the one for qt5?  Hmmm.
>
> On Monday, April 12, 2021 at 1:57:39 PM UTC-4 tbp1...@gmail.com wrote:
>
>> It failed because 
>> LeoLineTextWidget' object has no attribute 'StyledPanel
>>
>> as expected ...
>> On Monday, April 12, 2021 at 1:03:57 PM UTC-4 Edward K. Ream wrote:
>>
>>> On Monday, April 12, 2021 at 11:55:03 AM UTC-5 tbp1...@gmail.com wrote:
>>>
>>> Without testing it I don't think that will work. 

>>>
>>> From https://doc.qt.io/qt-6/qframe.html#details "The frame style is 
>>> specified by a frame shape 
>>>  and a shadow style 
>>>  that is used to 
>>> visually separate the frame from surrounding widgets. These properties can 
>>> be set together using the setFrameStyle 
>>> () function..."
>>>
>>> The only way to know for sure is to test it. The qt6 documentation has 
>>> proved unreliable in the past.
>>>
>>> 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 view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/ca62fa4a-1190-4eaf-a832-d73e602068e0n%40googlegroups.com.


Re: ekr-qt branch Leo Won't Start When pyqt6 installed

2021-04-12 Thread tbp1...@gmail.com
AS best as I can tell, QtWebEngine isn't available yet for qt6.  The github 
site for it only refers to qt5.15 as the latest reference I see.  I maybe 
had better remove qt6 from my everyday Python installation.

On Monday, April 12, 2021 at 2:59:44 PM UTC-4 tbp1...@gmail.com wrote:

> Next up: VR3 won't load because
>
> viewrendered3.py requires QtWebKitWidgets.QWebView
> pip install PyQtWebEngine
>
> But how to get this without stepping on the one for qt5?  Hmmm.
>
>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/c743289d-62e6-4261-815e-b4410974461en%40googlegroups.com.


Re: ekr-qt branch Leo Won't Start When pyqt6 installed

2021-04-12 Thread tbp1...@gmail.com
The shift and ALT keys also do the same thing - delete the selection.  The 
strange characters get inserted when I press .  This is using qt6, 
of course.

On Monday, April 12, 2021 at 3:58:32 PM UTC-4 tbp1...@gmail.com wrote:

> Major problem - in the body pane, when I highlight a line of text, then 
> press , the line vanishes.  I can get it back with .  
> Sometimes it left a residue of strange non-ascii characters, but I'm not 
> sure what else I did to cause that (see attached screenshot).
>
> On Monday, April 12, 2021 at 3:46:35 PM UTC-4 tbp1...@gmail.com wrote:
>
>> On Monday, April 12, 2021 at 2:59:44 PM UTC-4 tbp1...@gmail.com wrote:
>>
>>> I got qt_text to work - at least on the surface - with these changes:
>>>
>>#width = self.fm.width(str(max(1000, 
>>> self.highest_line))) + self.w_adjust
>>> if isQt6:
>>> width = self.fm.boundingRect(str(max(1000, 
>>> self.highest_line))).width()
>>> else:
>>> width = self.fm.width(str(max(1000, self.highest_line))) + 
>>> self.w_adjust
>>> if self.width() != width:
>>> self.setFixedWidth(width)
>>>
>>> It's possible that *self.setFixedWidth(width)* has had an API change - 
>>> I didn't look it up to see.  Perhaps this line didn't get executed so an 
>>> error didn't show up.
>>>
>>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/6d960564-f9eb-4d07-b841-2afef6fa7733n%40googlegroups.com.


Re: ekr-qt branch Leo Won't Start When pyqt6 installed

2021-04-12 Thread tbp1...@gmail.com
Major problem - in the body pane, when I highlight a line of text, then 
press , the line vanishes.  I can get it back with .  
Sometimes it left a residue of strange non-ascii characters, but I'm not 
sure what else I did to cause that (see attached screenshot).

On Monday, April 12, 2021 at 3:46:35 PM UTC-4 tbp1...@gmail.com wrote:

> On Monday, April 12, 2021 at 2:59:44 PM UTC-4 tbp1...@gmail.com wrote:
>
>> I got qt_text to work - at least on the surface - with these changes:
>>
>#width = self.fm.width(str(max(1000, 
>> self.highest_line))) + self.w_adjust
>> if isQt6:
>> width = self.fm.boundingRect(str(max(1000, 
>> self.highest_line))).width()
>> else:
>> width = self.fm.width(str(max(1000, self.highest_line))) + 
>> self.w_adjust
>> if self.width() != width:
>> self.setFixedWidth(width)
>>
>> It's possible that *self.setFixedWidth(width)* has had an API change - I 
>> didn't look it up to see.  Perhaps this line didn't get executed so an 
>> error didn't show up.
>>
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/453b5ced-2d83-4a75-b2b4-64bcb593e614n%40googlegroups.com.


Re: ekr-qt branch Leo Won't Start When pyqt6 installed

2021-04-12 Thread tbp1...@gmail.com


On Monday, April 12, 2021 at 2:59:44 PM UTC-4 tbp1...@gmail.com wrote:

> I got qt_text to work - at least on the surface - with these changes:
>#width = self.fm.width(str(max(1000, 
> self.highest_line))) + self.w_adjust
> if isQt6:
> width = self.fm.boundingRect(str(max(1000, 
> self.highest_line))).width()
> else:
> width = self.fm.width(str(max(1000, self.highest_line))) + 
> self.w_adjust
> if self.width() != width:
> self.setFixedWidth(width)
>
> It's possible that *self.setFixedWidth(width)* has had an API change - I 
> didn't look it up to see.  Perhaps this line didn't get executed so an 
> error didn't show up.
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/9955325a-d089-47ba-a0c6-b23280820b08n%40googlegroups.com.


Re: ekr-qt branch Leo Won't Start When pyqt6 installed

2021-04-12 Thread tbp1...@gmail.com
That's what I did with qt_text, except for using EditPlus instead.

On Monday, April 12, 2021 at 3:30:18 PM UTC-4 Edward K. Ream wrote:

> On Mon, Apr 12, 2021 at 12:26 PM tbp1...@gmail.com  
> wrote:
>
>> As a practical matter, how are you managing to edit one of these files 
>> when Leo won't start until the file has been fixed?  
>>
>
> No problem: it works for me. I assume some plugin or setting is activating 
> the code.
>
>> If you check out an earlier changeset, you won't have the current copy of 
>> the file to work on.
>>
>
> Nah. When Leo is hosed I just make the needed change in the scite editor.
>
> 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 view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/1f62f046-d20a-483c-baf4-12f3d5e5eb12n%40googlegroups.com.


Re: ekr-qt branch Leo Won't Start When pyqt6 installed

2021-04-12 Thread Edward K. Ream
On Mon, Apr 12, 2021 at 1:59 PM tbp1...@gmail.com 
wrote:

> I got qt_text to work - at least on the surface - with these changes:
>

Thanks.  I'll make them in the ekr-qt branch later today.

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 view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/CAMF8tS1Q0o8ajXi3QX89rMSHNq3Fbn80b87SYzqN1ANV9xXckQ%40mail.gmail.com.


Re: ekr-qt branch Leo Won't Start When pyqt6 installed

2021-04-12 Thread Edward K. Ream
On Mon, Apr 12, 2021 at 12:26 PM tbp1...@gmail.com 
wrote:

> As a practical matter, how are you managing to edit one of these files
> when Leo won't start until the file has been fixed?
>

No problem: it works for me. I assume some plugin or setting is activating
the code.

> If you check out an earlier changeset, you won't have the current copy of
> the file to work on.
>

Nah. When Leo is hosed I just make the needed change in the scite editor.

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 view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/CAMF8tS0HNg7YP-iGu2j3gxVTCwFEWxbGHA1WDk9EXhmg_HgBpQ%40mail.gmail.com.


Re: ekr-qt branch Leo Won't Start When pyqt6 installed

2021-04-12 Thread tbp1...@gmail.com
I got qt_text to work - at least on the surface - with these changes:

Sunken = QtWidgets.QFrame.Shadow.Sunken if isQt6 else 
self.Sunken
Raised = QtWidgets.QFrame.Shadow.Raised if isQt6 else 
self.StyledPanel
NoFrame = QtWidgets.QFrame.Shape.NoFrame if isQt6 else self.noFrame
self.setFrameStyle(Raised | Sunken)
self.edit = e  # A QTextEdit
e.setFrameStyle(NoFrame)

Then I also needed to change in update():

   #width = self.fm.width(str(max(1000, 
self.highest_line))) + self.w_adjust
if isQt6:
width = self.fm.boundingRect(str(max(1000, 
self.highest_line))).width()
else:
width = self.fm.width(str(max(1000, self.highest_line))) + 
self.w_adjust
if self.width() != width:
self.setFixedWidth(width)

With these changes. Leo opens outlines without crashing.  I notice that the 
gutter numbers have too much padding-left, so they are cut off on the 
right.  I don't know where that is set, so I didn't do anything about it.

If you want, I can push these changes to my branch and do a PR.  It's 
probably easier for you to jsut copy them into yours.  Just let me know if 
you want the PR.

Next up: VR3 won't load because

viewrendered3.py requires QtWebKitWidgets.QWebView
pip install PyQtWebEngine

But how to get this without stepping on the one for qt5?  Hmmm.

On Monday, April 12, 2021 at 1:57:39 PM UTC-4 tbp1...@gmail.com wrote:

> It failed because 
> LeoLineTextWidget' object has no attribute 'StyledPanel
>
> as expected ...
> On Monday, April 12, 2021 at 1:03:57 PM UTC-4 Edward K. Ream wrote:
>
>> On Monday, April 12, 2021 at 11:55:03 AM UTC-5 tbp1...@gmail.com wrote:
>>
>> Without testing it I don't think that will work. 
>>>
>>
>> From https://doc.qt.io/qt-6/qframe.html#details "The frame style is 
>> specified by a frame shape 
>>  and a shadow style 
>>  that is used to 
>> visually separate the frame from surrounding widgets. These properties can 
>> be set together using the setFrameStyle 
>> () function..."
>>
>> The only way to know for sure is to test it. The qt6 documentation has 
>> proved unreliable in the past.
>>
>> 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 view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/741ab895-5641-4590-905b-a30bb7e0dbf9n%40googlegroups.com.


Re: ekr-qt branch Leo Won't Start When pyqt6 installed

2021-04-12 Thread tbp1...@gmail.com
It failed because 
LeoLineTextWidget' object has no attribute 'StyledPanel

as expected ...
On Monday, April 12, 2021 at 1:03:57 PM UTC-4 Edward K. Ream wrote:

> On Monday, April 12, 2021 at 11:55:03 AM UTC-5 tbp1...@gmail.com wrote:
>
> Without testing it I don't think that will work. 
>>
>
> From https://doc.qt.io/qt-6/qframe.html#details "The frame style is 
> specified by a frame shape  
> and a shadow style  that 
> is used to visually separate the frame from surrounding widgets. These 
> properties can be set together using the setFrameStyle 
> () function..."
>
> The only way to know for sure is to test it. The qt6 documentation has 
> proved unreliable in the past.
>
> 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 view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/add8180a-b6ef-4e1f-90de-d3273e76dfean%40googlegroups.com.


Re: [ctlug] M$ Joy

2021-04-12 Thread tbp1...@gmail.com
With Sphinx/Rst you can change the css stylesheet and get it to use yours 
instead.  For example, the difference between the appearance of the docs on 
the Sphinx site and those on ReadTheDocs is the CSS stylesheet.  I'm not 
sure how you can get Sphinx to use a newly named style - one that it 
doesn't inherently know about - for a given paragraph or section, but I 
wouldn't be surprised if there's a way.

On Monday, April 12, 2021 at 1:24:22 PM UTC-4 stevelitt wrote:

>
> The ability to name and define a style that stays a style throughout 
> the editable files of the entire compile chain is all I want out of 
> life, assuming no premature conversion of the style p.story to 
> appearances, and assuming that in each format (html, ePub and PDF) I 
> can create a different style to appearance mapping for p.story, that 
> gets applied at the very last minute. Without Pandoc. 
>
> Markdown has no such ability. Neither does AsciiDoc. AsciiDoctor 
> *might*, but it appears to be very complicated. LyX' HTML exporter does 
> very premature conversions of styles to appearance, so that the 
> resulting HTML loses most of its styles, meaning you can't convert from 
> HTML to something further. What I've briefly read about Sphinx + rST is 
> that it might be able to --- perhaps with the use of rolls, but I've 
> found no example on the Internet, so I have to experiment. 
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/42cd14f5-3109-4e15-89e5-147764bf9f59n%40googlegroups.com.


Re: ekr-qt branch Leo Won't Start When pyqt6 installed

2021-04-12 Thread tbp1...@gmail.com
As a practical matter, how are you managing to edit one of these files when 
Leo won't start until the file has been fixed?  If you check out an earlier 
changeset, you won't have the current copy of the file to work on.

For VR3, I work on my own copy located elsewhere, and use a shortcut 
command to copy it to my repo working directory.  That works pretty well 
for one file, but it would be cumbersome for a lot of them.

On Monday, April 12, 2021 at 1:03:57 PM UTC-4 Edward K. Ream wrote:

> On Monday, April 12, 2021 at 11:55:03 AM UTC-5 tbp1...@gmail.com wrote:
>
> Without testing it I don't think that will work. 
>>
>
> From https://doc.qt.io/qt-6/qframe.html#details "The frame style is 
> specified by a frame shape  
> and a shadow style  that 
> is used to visually separate the frame from surrounding widgets. These 
> properties can be set together using the setFrameStyle 
> () function..."
>
> The only way to know for sure is to test it. The qt6 documentation has 
> proved unreliable in the past.
>
> 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 view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/8f2b5695-967f-4f36-9e15-ff188ca8ae0dn%40googlegroups.com.


Re: [ctlug] M$ Joy

2021-04-12 Thread Steve Litt
Edward K. Ream said on Fri, 9 Apr 2021 12:41:30 -0500

>On Thu, Apr 8, 2021 at 7:55 AM Steve Litt 
>wrote:
>
>Hi Steve. Thanks for the summary.  I'm not sure I have the attributions
>correct below, but here are my comments.
>
>> I'm also looking into something called Restructured Text and a
>> program  
>called Sphinx that seems to be a front end for Restructured Text. It's
>complicated and I don't think would be appropriate for Lindsey.
>
>Imo, Sphinx + rST are relatively easy to learn. Those tools should
>suffice to write almost any book.

Thanks for the tip! I'll put some more time into Sphinx + rST.

>
>> There's also an outliner called Leo, which you can author entirely
>> as an  
>outline with headlines that do or don't contain body text, and then (I
>think) you can run a converter program, possibly one you'd need to
>create yourself, to turn it into a ready made book, probably either
>PDF or HTML/ePub.
>
>Hmm. It would be nice if commentators tried out the tools they are
>describing.

:-) I've tried Leo many times, but still don't know even 3% of it. 

>
>Leo's rst3 command is the "converter" program. rst3 complements
>rST/sphinx as follows:
>
>- Can generate multiple documents from a single outline: one per @rst
>node en.
>- Automagically creates rST section markup using outline structure.
>  This means you can reorganize your paper or book freely, a huge
> advantage.
>- Optionally generates intermediate files for sphinx.
>
>> As we have been describing on leo-editor, rst3 supports a very few  
>frills, including ignoring parts of the @rst tree entirely, or not
>generating section markup for one or more nodes, thereby allowing
>authors to organize long sections using suboutline.
>
>> This isn't appropriate for Lindsey, because it's a huge system with
>> huge  
>capabilities requiring a lot of knowledge: It's a commitment. I'm
>copying the Leo list on this email.

>Did the commentator mean that Leo itself is a huge system? True
>enough, but working through Leo's tutorials
> is all someone needs to do to
>start writing their opus.

I was the commentator. I've worked partially through the tutorials
several times, but got bogged down and went on to other things. I'm
speaking as a Leo outsider or newbie here: Leo has so many capabilities
that learning the majority of it is a serious commitment. All the
capabilities are real, needed things, I have no doubt of that. All I'm
saying is learning something that capable is a commitment, and in my
experience a linear walk through several tutorials wasn't enough to get
me capable beyond regular outline workflow.

I'll try again when I get some time.


>> I feel everybody's pain. As far as I know, there's not a single
>> piece of  
>software out there that authors quickly and yet does consistent,
>styles-based formatting and outputs to both PDF and HTML. But I'll keep
>searching.
>
>To summarize my responses to such discussions:
>
>1. You're screwed if you insist on wysiwyg. How do you create a table
>of contents?

That's my opinion also, but Lindsey's workflow, priorities and past
experience lead him to WYSIWYG.

>
>2. Some people spend their whole life complaining about missing tools,
>without any clear idea of what they want. Others use the tools that do
>exist.  Some people even help improve the tools they use :-)

Yes, I didn't give full context. Earlier in the thread, I had remarked
that because of LibreOffice's handling of styles, it was unsuitable for
long documents, and gave (as I remember) Bluefish, Leo, MS-Word,
Inkscape, LyX, Stylz (which is not complete), org-mode, and several
other alternatives. Lindsey basically said LibreOffice was good enough
for him, and for times sake he likes WYSIWYG. In one situation I agree
with him: If I had a quick 1 pager to write, I'd use either LibreOffice
or Inkscape and be done with it, not a more robust tool meant to
produce bigger and higher quality output.

So it wasn't Lindsey complaining about missing tools, it was me. And
I'm referring to exactly one thing: The ability to create a style on my
own, with a name created by me, and have that style stay a style all
the way through the compile chain until being translated to an
appearance in the very last process. A good example is CSS:

p.story{font-style: italic; margin-right: 1em; margin-left: 1em;}

and later



The cool thing about CSS in HTML is that, if the HTML is actually meant
to produce an ePub, the p.story style stays a style all the way
through, and is translated to appearance by the ePub reader.

In LaTeX, my Story "environment" (TeXish for paragraph style) is as
follows:

\newenvironment{storyL}{
\par
\begingroup
\leftskip 0.4in\rightskip 0.4in
\it
\noindent{.\dotfill{}.\par}
%~\vskip -0.3in
}{
%~\vskip -0.05in
\par\noindent{.\dotfill{}.\par}
\endgroup
%~\vskip 0.0in
~\\
}

Once again, I named the style, I defined it, and that styl

Re: ekr-qt branch Leo Won't Start When pyqt6 installed

2021-04-12 Thread Edward K. Ream
On Monday, April 12, 2021 at 11:55:03 AM UTC-5 tbp1...@gmail.com wrote:

Without testing it I don't think that will work. 
>

>From https://doc.qt.io/qt-6/qframe.html#details "The frame style is 
specified by a frame shape  
and a shadow style  that is 
used to visually separate the frame from surrounding widgets. These 
properties can be set together using the setFrameStyle 
() function..."

The only way to know for sure is to test it. The qt6 documentation has 
proved unreliable in the past.

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 view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/15af4b7b-b2eb-4d88-936d-942d2fd9e467n%40googlegroups.com.


Re: ekr-qt branch Leo Won't Start When pyqt6 installed

2021-04-12 Thread Edward K. Ream
On Mon, Apr 12, 2021 at 11:55 AM tbp1...@gmail.com 
wrote:

> Without testing it I don't think that will work. *StyledPanel *has been
> replaced by *Raised*.  I would expect something like this would do it -
>
> Sunken = QtWidgets.QFrame.Shadow.Sunken if isQt6 else self.Sunken
> Raised = QtWidgets.QFrame.Shadow.Raised if isQt6 else self.StyledPanel
> self.setFrameStyle(Raised | Sunken)
>
> Also, couldn't *self.Shadow* be used instead of *QtWidgets.QFrame.Shadow*?
>

The new code follows the pattern used throughout the conversion.

Please test the code, and we'll go from there.

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 view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/CAMF8tS2pcz5%2B%3DRLRmUTU14O1y0K-DPUfJpPyUeeEE7p%2B6GJC3w%40mail.gmail.com.


Re: ekr-qt branch Leo Won't Start When pyqt6 installed

2021-04-12 Thread tbp1...@gmail.com
Without testing it I don't think that will work. *StyledPanel *has been 
replaced by *Raised*.  I would expect something like this would do it -

Sunken = QtWidgets.QFrame.Shadow.Sunken if isQt6 else self.Sunken 
Raised = QtWidgets.QFrame.Shadow.Raised if isQt6 else self.StyledPanel
self.setFrameStyle(Raised | Sunken) 

Also, couldn't *self.Shadow* be used instead of *QtWidgets.QFrame.Shadow*?
On Monday, April 12, 2021 at 11:59:16 AM UTC-4 Edward K. Ream wrote:

> On Mon, Apr 12, 2021 at 10:32 AM tbp1...@gmail.com  
> wrote:
>
>> Looks like the names of the constants have been changed to
>>
>> label.setFrameStyle(QFrame ::
>> Panel | QFrame ::Raised); 
>>
>> See https://doc.qt.io/qt-6/qframe.html#details
>>
>
> Rev d5a26c0 in ekr-qt attempts a fix.  The new code is:
>
> Shadow = QtWidgets.QFrame.Shadow.Sunken if isQt6 else self.Sunken
> self.setFrameStyle(self.StyledPanel | Shadow.Sunken)
>
> I only tested that Shadow.Sunken exists on qt6. Please let me know if the 
> fix works for you.
>
> 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 view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/47f09af1-5d80-42d2-83a6-a4fb1041b6d5n%40googlegroups.com.


Change to ekr-abbrev branch

2021-04-12 Thread Edward K. Ream
A recent rev replaces:

@bool use-spanish-keyboard

with:

@string keyboard-kind = default-keyboard

The valid (functional) values are "german" and "spanish" (case doesn't 
matter).

Please change your myLeoSettings file accordingly.  I plan to merge this 
branch into devel later today.

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 view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/53153fda-9158-42ff-9d7d-0bbc2f8786c8n%40googlegroups.com.


Re: ekr-qt branch Leo Won't Start When pyqt6 installed

2021-04-12 Thread Edward K. Ream
On Mon, Apr 12, 2021 at 10:32 AM tbp1...@gmail.com 
wrote:

> Looks like the names of the constants have been changed to
>
> label.setFrameStyle(QFrame ::
> Panel | QFrame ::Raised);
>
> See https://doc.qt.io/qt-6/qframe.html#details
>

Rev d5a26c0 in ekr-qt attempts a fix.  The new code is:

Shadow = QtWidgets.QFrame.Shadow.Sunken if isQt6 else self.Sunken
self.setFrameStyle(self.StyledPanel | Shadow.Sunken)

I only tested that Shadow.Sunken exists on qt6. Please let me know if the
fix works for you.

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 view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/CAMF8tS3jabyetUyQ6idn_dcePr-%3Dd20Pxiiorvw05DmtqnN-ew%40mail.gmail.com.


Re: ekr-qt branch Leo Won't Start When pyqt6 installed

2021-04-12 Thread tbp1...@gmail.com
Looks like the names of the constants have been changed to

label.setFrameStyle(QFrame ::
Panel | QFrame ::Raised); 

See https://doc.qt.io/qt-6/qframe.html#details

On Monday, April 12, 2021 at 11:17:10 AM UTC-4 Edward K. Ream wrote:

> On Mon, Apr 12, 2021 at 10:13 AM tbp1...@gmail.com  
> wrote:
>
>> I got a large number of messages as Leo tried to start.  Here is the last 
>> one before it quit:
>>
>>   File "d:\Tom\git\leo-editor\leo\plugins\qt_text.py", line 413, in 
>> __init__
>> self.setFrameStyle(self.StyledPanel | self.Sunken)
>>
>> AttributeError: 'LeoLineTextWidget' object has no attribute 'StyledPanel'
>>
>
> Thanks for the report. I'll fix it immediately.
>
> 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 view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/a18ccf34-d9ff-4335-8e61-135551b103e6n%40googlegroups.com.


Re: ekr-qt branch Leo Won't Start When pyqt6 installed

2021-04-12 Thread Edward K. Ream
On Mon, Apr 12, 2021 at 10:13 AM tbp1...@gmail.com 
wrote:

> I got a large number of messages as Leo tried to start.  Here is the last
> one before it quit:
>
>   File "d:\Tom\git\leo-editor\leo\plugins\qt_text.py", line 413, in
> __init__
> self.setFrameStyle(self.StyledPanel | self.Sunken)
>
> AttributeError: 'LeoLineTextWidget' object has no attribute 'StyledPanel'
>

Thanks for the report. I'll fix it immediately.

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 view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/CAMF8tS0dWVqbZcyWEO8oWnTY0h%3DkukOtNL7RNGiOpD21iR7L%3Dg%40mail.gmail.com.


ekr-qt branch Leo Won't Start When pyqt6 installed

2021-04-12 Thread tbp1...@gmail.com
I got a large number of messages as Leo tried to start.  Here is the last 
one before it quit:

  File "d:\Tom\git\leo-editor\leo\plugins\qt_text.py", line 413, in __init__
self.setFrameStyle(self.StyledPanel | self.Sunken)

AttributeError: 'LeoLineTextWidget' object has no attribute 'StyledPanel'

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/03610013-cfb2-4da0-b2ea-1511dd92c11en%40googlegroups.com.


Re: Recent changes to the ekr-qt branch

2021-04-12 Thread Edward K. Ream
On Sun, Apr 11, 2021 at 10:51 PM tbp1...@gmail.com 
wrote:

> I just incorporated your qt6/qt5 changes into my newer version of VR3.
> You have probably seen the PR by now.
>

Yes. I approved the PR. I just merged your branch into ekr-qt. I did this
"by hand" because the checks seem to have taken forever to complete.

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 view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/CAMF8tS1jzR28bmW0xeFxPydCoL-Jpbzc7iuKNbW6hn6D0wO7BQ%40mail.gmail.com.


I am restarting my sabbatical

2021-04-12 Thread Edward K. Ream
In the next day or so, I'll finish the latest round of bug fixes and return 
my focus to exploration.

I will file email away in a to-be-read-later folder.

As always, I'll fix *urgent *bugs. Long-standing bugs aren't necessarily 
urgent.

Please help me maintain my focus on exploration by creating new bug reports 
and requests for enhancements yourself.

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 view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/d5bb2e63-3ec5-4bdb-af17-75f5b371e4e2n%40googlegroups.com.


Re: Permanent sabbatical?

2021-04-12 Thread Edward K. Ream
On Tuesday, April 6, 2021 at 10:13:27 AM UTC-5 Edward K. Ream wrote:

My mantra for Leo now is, "There's no rush. It will wait."
>
... 

> At present, my priorities for projects are, from highest to lowest:
>

Soon after writing this I saw that the priorities were too detailed. They 
didn't create enough psychological room for exploration.

The only relevant distinction is between urgent/necessary work and 
exploration. Imo, what counts as urgent should be left vague. Sometimes its 
easier to do something than not. But in general long-standing bugs have no 
*urgent* claim on my time. They have waited a long time. They can wait 
longer.

*Summary*

Opening a space for exploration requires discipline. Otherwise it doesn't 
happen.

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 view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/f38f5fa8-bdb6-4f66-977d-34ebf54cc7b1n%40googlegroups.com.


Re: creating a new importer for parse-body use

2021-04-12 Thread jkn
Thanks Edward. It looks like addressing the first of these:

> You have to make @language tds work by creating entries for tds in three 
dictionaries in leoApp.py.

Is what I need to look at first.

Regards, Jon N

On Monday, April 12, 2021 at 1:21:41 AM UTC+1 Edward K. Ream wrote:

> On Sun, Apr 11, 2021 at 4:16 PM jkn  wrote:
>
>> Hi (Edward, probably)
>
>
> Yes. I wrote this mess :-)
>
>> I am interested in writing an importer to allow me to use the parse-body 
>> command...
>>
> ...
>
>> I'm starting with a stripped-down file...leo/plugins/importers/tds.py
>>
>
> Yes, that sounds reasonable.
>
>> I'm a little unclear as to whether just that file will be enough; 
>>
>
> Yes, it should be enough, provided that '@language tds' is supported.
>
> I intend to select this parser by means of '@language tds', but with just 
>> 'noddy' contents of the tds importer I am seeing an error like:
>>
>> {{{
>>
>> Traceback (most recent call last):
>>
>>   File "/home/jkn/leo-editor/leo/core/leoKeys.py", line 2466, in 
>> callAltXFunction
>> func(event)
>>
>>   File "/home/jkn/leo-editor/leo/core/leoImport.py", line 2738, in 
>> parse_body_command
>> c.importCommands.parse_body(c.p)
>>
>>   File "/home/jkn/leo-editor/leo/core/leoImport.py", line 1137, in parse_body
>> ext = '.' + g.app.language_extension_dict.get(language)
>> TypeError: can only concatenate str (not "NoneType") to str
>> }}}
>>
>> I have tried creating a matching file colorizor leo/modes/tds.py, without 
>> success
>>
>
> Creating modes/tds.py only affects colorizing. It should have no effect on 
> importers. 
>
> Any thoughts? In any case, that error message might be improved IMO
>>
>
> Hehe. I agree the message leaves a bit to be desired. 
>
> However, the traceback is actually pretty informative. As usual, the last 
> two lines are the most informative. Clearly, 
> g.app.language_extension_dict.get( 
> language) is returning None.
>
> The "language" var comes from the line:
>
> language = g.scanForAtLanguage(c, p), so yes, you must support your new 
> language by creating entries in three language dictionaries.  See the node 
> "app.__init__ (helpers contain language dicts)" in leoApp.py.
>
> *Summary*
>
> You have to make @language tds work by creating entries for tds in three 
> dictionaries in leoApp.py.
> You have to create an importer for .tds files.
> parse_body shouldn't crash if g.app.language_extension_dict.get( language) 
> is None.
>
> 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 view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/4f6bf7ea-b4cf-4df0-ba06-ffa2ac4be073n%40googlegroups.com.