Re: [LyX/master] Add new placeholder $${python} to configure

2022-01-23 Thread Pavel Sanda
On Sun, Jan 23, 2022 at 04:06:07PM +, José Abílio Matos wrote:
> Could it be a cache interfering?
> Are the previewed files cached?

I don't think so. I also checked whether missing reconfigure could have been
the case, but it does not look like that either.
Last thing coming to my mind is that I was not working on master's HEAD but
few commits back when the $$(python) transition was not finished.

Who knows, I'll keep an eye on it.

Pavel
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Add new placeholder $${python} to configure

2022-01-23 Thread José Abílio Matos
On Sunday, 23 January 2022 15.01.33 WET Pavel Sanda wrote:
> On Sat, Jan 22, 2022 at 09:54:39PM +, José Abílio Matos wrote:
> > The problem here is that the placeholder is not replaced before being 
used.
> > In order to see what python is being used you can see:
> > 
> > Help->About LyX
> 
> python3 -tt

The detection is right. :-)

> > In a hunch does the attached patch fixes the issue?
> > The idea is to replace the placeholder when the converter is added/
imported.
> 
> Strangely, I can't reproduce the problem anymore. I'll wait if I can catch
> it again. Pavel

Could it be a cache interfering?
Are the previewed files cached?

Thank you,
-- 
José Abílio-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Add new placeholder $${python} to configure

2022-01-23 Thread Pavel Sanda
On Sat, Jan 22, 2022 at 09:54:39PM +, José Abílio Matos wrote:
> The problem here is that the placeholder is not replaced before being used.
> In order to see what python is being used you can see:
> 
> Help->About LyX

python3 -tt

> In a hunch does the attached patch fixes the issue?
> The idea is to replace the placeholder when the converter is added/imported.

Strangely, I can't reproduce the problem anymore. I'll wait if I can catch it 
again.
Pavel
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Add new placeholder $${python} to configure

2022-01-22 Thread José Abílio Matos
On Saturday, 22 January 2022 19.49.26 WET Pavel Sanda wrote:
> Hi Jose,
> 
> this what I see in curent master:
> 1. start lyx
> 2. load file
> 3. this is  what I see in terminal window:
> env: '$${python}': No such file or directory
> 
> Most likely related to image preview conversions, this what I see with debug
> messages on graphics:
> graphics/PreviewLoader.cpp (757): PreviewLoader::finishedInProgress(127):
> processing failed for $${python} $$s/scripts/lyxpreview2bitmap.py --png
> "/tmp/lyx_tmpdir.LiGxsfYQmUxW/lyx_tmpbuf6/lyxpreviewGdodeo.tex" --dpi 115
> --fg ff9822 --bg 00 --bibtex="bibtex"
> 
> 
> These binaries available on my system:
> python python2python2.7  python3python3.9
> python defaults to python2.7
> 
> Pavel

The problem here is that the placeholder is not replaced before being used.
In order to see what python is being used you can see:

Help->About LyX


In a hunch does the attached patch fixes the issue?
The idea is to replace the placeholder when the converter is added/imported.

-- 
José Abíliodiff --git a/src/Converter.cpp b/src/Converter.cpp
index c00941d21f..7bb998d5a9 100644
--- a/src/Converter.cpp
+++ b/src/Converter.cpp
@@ -148,6 +148,12 @@ void Converter::readFlags()
 }
 
 
+void Converter::setCommand(std::string const & command)
+{
+	command_ = subst(command, token_python, os::python());
+}
+
+
 Converter const * Converters::getConverter(string const & from,
 	string const & to) const
 {
diff --git a/src/Converter.h b/src/Converter.h
index 5197e3447a..091dbcd394 100644
--- a/src/Converter.h
+++ b/src/Converter.h
@@ -58,7 +58,7 @@ public:
 	///
 	std::string const command() const { return command_; }
 	///
-	void setCommand(std::string const & command) { command_ = command; }
+	void setCommand(std::string const & command);
 	///
 	std::string const flags() const { return flags_; }
 	///
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel


Re: [LyX/master] Add new placeholder $${python} to configure

2022-01-22 Thread Pavel Sanda
On Tue, Jan 04, 2022 at 12:52:37AM +0100, JosĂŠ Matos wrote:
> commit 109ea2be4a21ca93d22ab25703b3352a50fbbe3b
> Author: José Matos 
> Date:   Tue Jan 4 00:21:34 2022 +
> 
> Add new placeholder $${python} to configure
> 
> This ensures that we use a consistent Python interpreter in LyX.
> 
> $${python} is replaced by the Python version found.
> 
> Users can apply this in preferences and use the same version defined by
> LyX.

Hi Jose,

this what I see in curent master:
1. start lyx 
2. load file
3. this is  what I see in terminal window:
env: '$${python}': No such file or directory

Most likely related to image preview conversions, this what I see with debug
messages on graphics:
graphics/PreviewLoader.cpp (757): PreviewLoader::finishedInProgress(127): 
processing failed for $${python} $$s/scripts/lyxpreview2bitmap.py --png 
"/tmp/lyx_tmpdir.LiGxsfYQmUxW/lyx_tmpbuf6/lyxpreviewGdodeo.tex" --dpi 115 --fg 
ff9822 --bg 00 --bibtex="bibtex"


These binaries available on my system:
python python2python2.7  python3python3.9
python defaults to python2.7

Pavel
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel