I understand log 003 well enough. The standard-issue Leo install is being
executed instead of the one in your clone repo. How do you start Leo
normally, e.g., for log 001?
I think the restart-leo command has a weakness - it's going to start Leo
using a shell inheriting its owner's environment. If that original
environment doesn't include a PYTHONPATH variable or hasn't been cd'ed to
the leo-editor directory, it will find the pip-installed version instead of
the git version.
I just tried the restart-leo command in one of my Linux VMs. It's also
running in a venv. The restart worked as intended. however, I start Leo
with the git repo clone version of Leo by using a shell script that firsts
sets PYTHONPATH to point to the leo-editor directory in my git repo. Then
it sources the venv. So when the restart-leo command runs, the new shell
inherits the right environment.
If this is right, the command will be unreliable for anyone who doesn't
start the original Leo session the "right" way. The user might not even
notice they are running the wrong version of Leo.
Here is my script:
#! /bin/bash
if [ "$PYTHONPATH" == "" ]; then
export PYTHONPATH=~/git/leo-editor
echo "Using PYTHONPATH:" $PYTHONPATH
else
echo "PYTHONPATH already set to" $PYTHONPATH
fi
source ~/venv/leo/bin/activate && python3 -m leo.core.runLeo $*
The simplest fix would probably be for the restart-leo command to find the
leo-editor directory and have the subprocess command cd to it before
calling runLeo. This should (but untested!) work for Leo running in any
environment, whether it be a venv, a git repo, or wherever. Of course, if
there is no leo-editor directory, it should omit the cd command.
On Saturday, October 12, 2024 at 8:04:19 AM UTC-4 [email protected]
wrote:
> Hello Edward,
>
> Edward K. Ream schrieb am Freitag, 11. Oktober 2024 um 23:45:44 UTC+2:
>
> On Thu, Oct 10, 2024 at 3:40 PM Thomas Passin <[email protected]> wrote:
>
> I don't think existing commands and menus get updated by closing and
> re-opening an outline. Commands and Menus created in a settings tree in the
> outline might update, but I'm not sure about that.
>
>
> restart-leo reports (in the console) what it does. For example:
>
> os.chdir(C:\Repos\leo-editor)
> subprocess.run([
> C:\Python\Python3.12\python.exe,
> C:\Repos\leo-editor\launchLeo.py,
> C:\Users\Dev\ekr.leo,
> --no-splash
> ])
>
> In other words, restart-leo completely restarts Leo.
>
>
> I knew that this command restarts Leo - but - I was not sure which
> use-cases it supports ...
>
> I'm taking your answer answer as: No limitations / restrictions are
> expected / known.
>
> As I stated in my initial message: This is not true, at least not for the
> setup in my Debian Linux - & Fedora Linux VMs.
>
> Below you find the logs for one of several attempts of restarting Leo
> after a 'git pull' of the 'devel' branch of Leo's repository:
>
> - Before the 'git pull' operation - Log-001.
> - During & after executing 'restart-leo' command at the console -
> Log-002.
> - During & after executing 'restart-leo' command at the log panel -
> Log-003.
> - After having closed & restarted Leo ~ manually ~ via the GUI -
> Log-004.
>
> Do you consider this a bug ?
>
> With kind regards,
>
> Viktor
>
> ### Log-001 from Fedora - Before the 'git pull' operation ...
>
> Leo Log Window
> *Leo 6.8.2-devel, devel branch, build bb7c9c1d95 <- !*
> 2024-10-08 15:08:38 -0500
> Python 3.12.6, PyQt version 6.7.1
> linux
> setting leoID from os.getenv('USER'): 'user'
> home: /home/user
> leo-editor: /home/user/PyVE/GitHub/Leo/leo-editor
> load: /home/user/PyVE/GitHub/Leo/leo-editor/leo/core
> config: /home/user/PyVE/GitHub/Leo/leo-editor/leo/config
> reading settings in
> /home/user/PyVE/GitHub/Leo/leo-editor/leo/config/leoSettings.leo
> reading settings in /home/user/.leo/myLeoSettings.leo
> reading settings in
> /home/user/PyVE/GitHub/Leo/leo-editor/leo/themes/tbp_dark_solarized.leo
> VR3 -- no asciidoc processor
> VR3 -- no asciidoc3 processor
> Can't find /home/user/.leo/vr3/vr3_config.ini so VR3 cannot execute
> non-Python code
> reading settings in /home/user/Documents/SL2024.leo
> read outline in 0.27 seconds
>
> ### Log-002 from Fedora - During & after executing 'restart-leo' command
> at the console ...
>
> Restarting Leo...
> os.chdir(/home/user/PyVE/GitHub/Leo/leo-editor)
> subprocess.run([
> /home/user/PyVE/GitHub/Leo/bin/python,
> /home/user/PyVE/GitHub/Leo/leo-editor/leo/core/runLeo.py
> ])
>
> setting leoID from os.getenv('USER'): 'user'
> *Leo 6.8.0-b1, master branch <- !*
> Python 3.12.6, PyQt version 6.7.1
> linux
>
> ### Log-003 from Fedora - During & after executing 'restart-leo' command
> at the log panel ...
>
> Leo Log Window
> *Leo 6.8.0-b1, master branch <- !*
> Python 3.12.6, PyQt version 6.7.1
> linux
> setting leoID from os.getenv('USER'): 'user'
> home: /home/user
> leo-editor: /home/user/PyVE/GitHub/Leo/lib64/python3.12/site-packages
> load:
> /home/user/PyVE/GitHub/Leo/lib64/python3.12/site-packages/leo/core
> config:
> /home/user/PyVE/GitHub/Leo/lib64/python3.12/site-packages/leo/config
> reading settings in
> /home/user/PyVE/GitHub/Leo/lib64/python3.12/site-packages/leo/config/leoSettings.leo
> reading settings in /home/user/.leo/myLeoSettings.leo
> reading settings in
> /home/user/PyVE/GitHub/Leo/lib64/python3.12/site-packages/leo/themes/tbp_dark_solarized.leo
> VR3 -- no asciidoc processor
> VR3 -- no asciidoc3 processor
> Can't find /home/user/.leo/vr3/vr3_config.ini so VR3 cannot execute
> non-Python code
> reading settings in /home/user/Documents/SL2024.leo
> read outline in 0.26 seconds
>
> ### Log-004 from Fedora - After having closed & restarted Leo ~ manually
> ~ via the GUI ...
>
> Leo Log Window
> *Leo 6.8.2-devel, devel branch, build cb37d41c50 <- !*
> 2024-10-10 10:03:11 -0500
> Python 3.12.6, PyQt version 6.7.1
> linux
> setting leoID from os.getenv('USER'): 'user'
> home: /home/user
> leo-editor: /home/user/PyVE/GitHub/Leo/leo-editor
> load: /home/user/PyVE/GitHub/Leo/leo-editor/leo/core
> config: /home/user/PyVE/GitHub/Leo/leo-editor/leo/config
> reading settings in
> /home/user/PyVE/GitHub/Leo/leo-editor/leo/config/leoSettings.leo
> reading settings in /home/user/.leo/myLeoSettings.leo
> reading settings in
> /home/user/PyVE/GitHub/Leo/leo-editor/leo/themes/tbp_dark_solarized.leo
> VR3 -- no asciidoc processor
> VR3 -- no asciidoc3 processor
> Can't find /home/user/.leo/vr3/vr3_config.ini so VR3 cannot execute
> non-Python code
> reading settings in /home/user/Documents/SL2024.leo
> read outline in 0.26 seconds
>
>
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/leo-editor/e33f4ed3-c2dd-4198-b507-4bf02cacc264n%40googlegroups.com.