Re: Managing Python 2.7 Code In Leo

2022-01-17 Thread Edward K. Ream
On Mon, Jan 17, 2022 at 9:10 AM tbp1...@gmail.com 
wrote:

> That setting is not among the settings listed in the output of
> Settings/Show Settings/Show-Settings.


[M] @  bool checkforchangedexternalfiles = True

The name shown is the "dictionary" name, with "-" and "_" deleted.

In any case, leoSettings.leo contains the primary data, and the data are
organized by subject.

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/CAMF8tS3gbApURTcDgVKAi_o%2BwEvTbLZcAeYaieeyaHGRo4W1yA%40mail.gmail.com.


Re: Managing Python 2.7 Code In Leo

2022-01-17 Thread tbp1...@gmail.com
On Monday, January 17, 2022 at 12:57:12 PM UTC-5 David Szent-Györgyi wrote:

> Jython support for Python3 is planned 
>  and roadmapped 
> . 
>

Yes, and have you noticed the huge amount of work those plans will entail?  
I don't see it getting competed in the near future, I'm sorry to say. 

-- 
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/227b86bd-afb4-4b0a-baa9-d0091ac3a00an%40googlegroups.com.


Re: Managing Python 2.7 Code In Leo

2022-01-17 Thread tbp1...@gmail.com
The Graal system can also run jython or jython-like code to some degree.  
They added some improved support for inheriting from jython/pythonIntroduction 
to GraalVM classes in java at 
my request.  See, e.g., Inheritance from Java 

.

In my case, I have to run under Tomcat.  It seems that Graal now 
supports/is supported by Tomcat to some degree at least:  GraalVM 20.0: Run 
Tomcat as Native Image on Windows 
.  
It's a terrific accomplishment, but I seriously doubt that I could get my 
using agencies to start using Graal with Tomcat.  Still, it might be worth 
looking at for ImageJ.

For those not familiar with Graal, "GraalVM is a high-performance JDK 
distribution designed to accelerate the execution of applications written 
in Java and other JVM languages along with support for JavaScript, Ruby, 
Python, and a number of other popular languages. GraalVM’s polyglot 
capabilities make it possible to mix multiple programming languages in a 
single application while eliminating foreign language call costs." - 
Introduction 
to GraalVM .

The polyglot capability might make it really interesting for Leo if only it 
could support major Python libraries like QT, numpy, etc.  Here's someone 
showing the use of numpy with Graal: 
https://abvijaykumar.medium.com/building-graalvm-native-image-of-a-polyglot-java-numpy-application-a7288740409e,
 
so maybe it can be done.  Wouldn't it be wonderful to mix java, Python, R, 
and javascript code in one Leo subtree, and execute it within Leo!
On Monday, January 17, 2022 at 12:57:12 PM UTC-5 David Szent-Györgyi wrote:

> On Monday, January 17, 2022 at 6:01:43 AM UTC-5 Edward K. Ream wrote:
>
>> On Sun, Jan 16, 2022 at 3:08 PM tbp1...@gmail.com  
>> wrote:
>>
>>> The project is a Tomcat web application that uses mixed java and 
>>> Jython.  
>>
>>
>> VSCode probably allows you to use python 2 for some projects. I am not 
>> going to support python 2 in Leo, but a plugin could do so.
>>
>
> Jython  is one of the languages in which macros 
> are written for the ImageJ  image processing and 
> analysis software, and important as such. Jython support for Python3 is 
> planned  and roadmapped 
> . 
>
> Another significant implementation of Python for which Python3 compliance 
> is a work in progress is IronPython , which runs 
> native on the Dynamic Language Runtime for .NET. The implementation is open 
> source, source code for IronPython2, IronPython3, and the Dynamic 
> Language Runtime is on GitHub . The 
> current forum for for developers and users a Gitter discussion group 
> . 
>
> I work on ImageJ macros, using Jython when I can. I work with .NET-based 
> applications for which IronPython is the macro language.  Those macros are 
> short enough that they don't need an outliner, and the host applications 
> provide the IDE. 
>

-- 
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/98c3a878-7976-481b-8ab9-e0f45f0cde12n%40googlegroups.com.


Re: Managing Python 2.7 Code In Leo

2022-01-17 Thread David Szent-Györgyi
On Monday, January 17, 2022 at 6:01:43 AM UTC-5 Edward K. Ream wrote:

> On Sun, Jan 16, 2022 at 3:08 PM tbp1...@gmail.com  
> wrote:
>
>> The project is a Tomcat web application that uses mixed java and Jython.  
>
>
> VSCode probably allows you to use python 2 for some projects. I am not 
> going to support python 2 in Leo, but a plugin could do so.
>

Jython  is one of the languages in which macros 
are written for the ImageJ  image processing and 
analysis software, and important as such. Jython support for Python3 is 
planned  and roadmapped 
. 

Another significant implementation of Python for which Python3 compliance 
is a work in progress is IronPython , which runs 
native on the Dynamic Language Runtime for .NET. The implementation is open 
source, source code for IronPython2, IronPython3, and the Dynamic Language 
Runtime is on GitHub . The current forum 
for for developers and users a Gitter discussion group 
. 

I work on ImageJ macros, using Jython when I can. I work with .NET-based 
applications for which IronPython is the macro language.  Those macros are 
short enough that they don't need an outliner, and the host applications 
provide the IDE. 

-- 
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/2126192c-0c21-4d86-8129-d98f52e7836dn%40googlegroups.com.


Re: Managing Python 2.7 Code In Leo

2022-01-17 Thread tbp1...@gmail.com
That setting is not among the settings listed in the output of 
Settings/Show Settings/Show-Settings.  I now, after your post,  see that it 
is included in leoSettings.leo, where I had to try various guesses as to 
what the setting might be called before finally noticing it.  I started 
searching for "syntax", and eventually tried "check".

Seems to me that the menu item to show settings should at least show all of 
the ones in leoSettings.leo, if not more.

On Monday, January 17, 2022 at 8:05:07 AM UTC-5 Edward K. Ream wrote:

> On Mon, Jan 17, 2022 at 7:30 AM tbp1...@gmail.com  
> wrote:
>
>> Probably being able to disable automatic syntax checking in an outline 
>> would be enough.  Is there a setting to do that?
>>
>
> @bool check-python-code-on-write
>
> In future, please search for settings before asking about them.
>
> 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/a4825f65-dd9b-4f3a-9311-347da82c229dn%40googlegroups.com.


Re: Managing Python 2.7 Code In Leo

2022-01-17 Thread Edward K. Ream
On Mon, Jan 17, 2022 at 7:30 AM tbp1...@gmail.com 
wrote:

> Probably being able to disable automatic syntax checking in an outline
> would be enough.  Is there a setting to do that?
>

@bool check-python-code-on-write

In future, please search for settings before asking about them.

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/CAMF8tS3o2KMaKnX8m3R_0V0KRHQtLoa2nmXGxpy9sGcZZAnGjg%40mail.gmail.com.


Re: Managing Python 2.7 Code In Leo

2022-01-17 Thread tbp1...@gmail.com
Probably being able to disable automatic syntax checking in an outline 
would be enough.  Is there a setting to do that?

On Monday, January 17, 2022 at 6:01:43 AM UTC-5 Edward K. Ream wrote:

> On Sun, Jan 16, 2022 at 3:08 PM tbp1...@gmail.com  
> wrote:
>
>> The project is a Tomcat web application that uses mixed java and Jython.  
>
>
> VSCode probably allows you to use python 2 for some projects. I am not 
> going to support python 2 in Leo, but a plugin could do so.
>
> 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/7b2c22c9-fbeb-4b13-9d89-ad534b33c8f6n%40googlegroups.com.


Re: Script For Counting Lines Of Python Code?

2022-01-17 Thread Edward K. Ream
On Sun, Jan 16, 2022 at 6:07 PM tbp1...@gmail.com 
wrote:

> I'm not a big fan of counts of lines of code, but sometimes it's fun or
> otherwise useful.  I didn't see a script to count the LOC in scripts.leo or
> PyLeoRef.leo, so I came up with one, but I wondered whether anyone else has
> a slicker one.


Here is @command count-pages from my myLeoSettings.leo file. It's just
different :-)

lines, nodes = 0, 0
for p in c.all_unique_positions():
nodes += 1
lines += len(g.splitLines(p.b))
pages = (nodes * 10 + lines) // 50
s = "%d nodes,  %d lines, %d pages" % (nodes,lines,pages)
g.es_print(f"{nodes} nodes,  {lines} lines, {pages} pages")

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/CAMF8tS16fHWFVGMNepoF%2BKUr5zJuMnDuPD6PhEKMsS%2BTE9yyXg%40mail.gmail.com.


Re: Managing Python 2.7 Code In Leo

2022-01-17 Thread Edward K. Ream
On Sun, Jan 16, 2022 at 3:08 PM tbp1...@gmail.com 
wrote:

> The project is a Tomcat web application that uses mixed java and Jython.


VSCode probably allows you to use python 2 for some projects. I am not
going to support python 2 in Leo, but a plugin could do so.

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/CAMF8tS2oaPa98Sa5iqkG_qnJQRw6Xe9R2t8%3De0NOxcOLMu3HJQ%40mail.gmail.com.