<div dir="ltr"><div>I will be answering most concerns here, in no particular order. I think it will simplify the next messages.<br></div><div><br></div><div>- This is far from an overhaul of the script. The logic did not really change, neither the code structure. I have ideas on how to do it, and I could do it if you are OK with it, but I completely agree that larger changes should be delayed to the next version (or 2.4 should be delayed by a few months). This should also be the occasion to get rid of Python 2 completely, that would make the code much clearer.</div><div><br></div><div>- The cosmetic changes are based on PEP8, which is the only style guide for Python. Highly similar patches already went into the code base less than a year ago (<a href="http://lists.lyx.org/pipermail/lyx-devel/2020-May/001464.html">http://lists.lyx.org/pipermail/lyx-devel/2020-May/001464.html</a>). Other style guides for Python are just more precise than PEP8 (e.g., Google: <a href="https://stackoverflow.com/a/2815311/1066843">https://stackoverflow.com/a/2815311/1066843</a>). I have yet to see an important open-source project that does not use PEP8 style guide. It's as unopiniated as opinion could get on Python.<br></div><div>For now, the Python scripts follow the WTF style guide: every committer does what they prefer, without any kind of consistency. Python is very different from other languages in that there is a real consensus in the community on one style guide (PHP is going in the same direction, but it's not yet as commonly used: <a href="https://www.php-fig.org/psr/psr-2/">https://www.php-fig.org/psr/psr-2/</a>). I am not proposing one style guide for C++ or Perl code, for instance.</div><div><br></div><div>- This way to find Java is quite common on Windows platforms (actually, it's a lot like a port of JavaCall.jl's relevant portion of code: <a href="https://github.com/JuliaInterop/JavaCall.jl">https://github.com/JuliaInterop/JavaCall.jl</a>). It looks like Oracle's JVM does the same at installation: <a href="https://stackoverflow.com/a/9094539/1066843">https://stackoverflow.com/a/9094539/1066843</a>. Other JVMs mimic the same behaviour: <a href="https://github.com/AdoptOpenJDK/openjdk-installer/issues/64">https://github.com/AdoptOpenJDK/openjdk-installer/issues/64</a>. <br></div><div>Moreover, I don't think we can let beginner users on their own to configure the PATH, we really should go an extra step to find a Java binary (while letting the PATH have preference over anything else, so that users can still choose which Java they want).</div><div>Using things like
\HKEY_CLASSES_ROOT\Installer\Products\
is, in my opinion, the wrong way to check for Java in the registry: these identifiers seem to vary a lot between versions of Java (<a href="https://docs.oracle.com/en/java/javase/15/install/installation-jdk-microsoft-windows-platforms.html#GUID-886D35CE-76AF-43B4-8C2F-7B34DB8B1666">https://docs.oracle.com/en/java/javase/15/install/installation-jdk-microsoft-windows-platforms.html#GUID-886D35CE-76AF-43B4-8C2F-7B34DB8B1666</a>). On my machine, I have no
4EA42A62D9304AC4784BF2238120180F, for instance. <br></div><div>I am attaching a new version of the patch based on <a href="https://docs.oracle.com/javase/9/install/installation-jdk-and-jre-microsoft-windows-platforms.htm#JSJIG-GUID-C11500A9-252C-46FE-BB17-FC5A9528EAEB">https://docs.oracle.com/javase/9/install/installation-jdk-and-jre-microsoft-windows-platforms.htm#JSJIG-GUID-C11500A9-252C-46FE-BB17-FC5A9528EAEB</a>. Does it work for you? Otherwise, would you have something else under HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft? <br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, 29 Jan 2021 at 14:41, Kornel Benko <<a href="mailto:kornel@lyx.org">kornel@lyx.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Am Fri, 29 Jan 2021 13:39:19 +0100<br>
schrieb Pavel Sanda <<a href="mailto:sanda@lyx.org" target="_blank">sanda@lyx.org</a>>:<br>
<br>
> On Fri, Jan 29, 2021 at 11:07:43AM +0000, José Abílio Matos wrote:<br>
> > With the extent of the patches I fear that there could be bugs (unintended <br>
> > changes) lurking specially in relation to python 2. <br>
> <br>
> Riki's call, but I don't think this is the best time for python scripts overhaul.<br>
> Except the changes fixing real bugs we should IMHO postpone these to post 2.4 world.<br>
> <br>
> Pavel<br>
<br>
+1<br>
<br>
Kornel<br>
-- <br>
lyx-devel mailing list<br>
<a href="mailto:lyx-devel@lists.lyx.org" target="_blank">lyx-devel@lists.lyx.org</a><br>
<a href="http://lists.lyx.org/mailman/listinfo/lyx-devel" rel="noreferrer" target="_blank">http://lists.lyx.org/mailman/listinfo/lyx-devel</a><br>
</blockquote></div></div>