mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-11 11:08:41 +00:00
Output python version in About dialog.
Patch from Jose.
This commit is contained in:
parent
56fe7f47eb
commit
625c61f1d5
@ -297,7 +297,7 @@ static QString version(bool const plain = false)
|
||||
else
|
||||
out << "</p><p>";
|
||||
#endif
|
||||
out << toqstr(bformat(_("Python detected: %1$s"), from_utf8(os::python())));
|
||||
out << toqstr(bformat(_("Python detected: %1$s"), from_utf8(os::python_info())));
|
||||
if (!plain)
|
||||
out << toqstr("</p></body></html>");
|
||||
return res;
|
||||
|
@ -58,7 +58,7 @@ int timeout_ms()
|
||||
|
||||
static string const python23_call(string const & binary, bool verbose = false)
|
||||
{
|
||||
const string version_info = " -c \"from __future__ import print_function;import sys; print(sys.version_info[:2], end=\\\"\\\")\"";
|
||||
const string version_info = " -c \"from __future__ import print_function; import sys; print(sys.version_info[:2], end='')\"";
|
||||
// Default to "python" if no binary is given.
|
||||
if (binary.empty())
|
||||
return "python -tt";
|
||||
@ -197,6 +197,14 @@ bool hasPython()
|
||||
return !(python23_call(python()).empty());
|
||||
}
|
||||
|
||||
string const python_info()
|
||||
{
|
||||
const string info_version = " -c \"from __future__ import print_function; import sys; print('{} ({})'.format(sys.version.split()[0],sys.executable), end='')\"";
|
||||
if (!hasPython())
|
||||
return("None");
|
||||
return (runCommand(python() + info_version).result);
|
||||
}
|
||||
|
||||
} // namespace os
|
||||
} // namespace support
|
||||
} // namespace lyx
|
||||
|
@ -65,6 +65,9 @@ std::string const python(bool reset = false);
|
||||
/// Check for availability of the python interpreter
|
||||
bool hasPython();
|
||||
|
||||
/// Return information about the ython interper
|
||||
std::string const python_info();
|
||||
|
||||
///
|
||||
bool isFilesystemCaseSensitive();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user