l'll make sure to put it into the leo-editor/leo/core/leoserver.py that i'm developping.
Thanks for this!! (I'll try to get something going in the felix-server branch by this weekend) Thanks again for taking the time to make those tests and finding solutions to implement and make it smooth for people to start the server and connect to it easily -- Félix On Thursday, June 10, 2021 at 1:53:39 PM UTC-4 Edward K. Ream wrote: > With ed5b6d66 in leoInteg master, and the latest code per PR #1971 > <https://github.com/leo-editor/leo-editor/pull/1971>: > > *Stage 1* > > leoInteg worked for me, but only when I did the following: > > 1. Add <path to>leo-editor in my sitecustomize.py file. > 2. Specify leobridgeserver.py (*not* leoserver.py) as the server. > > *Stage 2* > > 1. I copied leobridgeserver.py to leo/core/leoserver.py and changed the > leoInteg setting to point to leo/core/leoserver.py instead of > leointeg/leobridgeserver.py. > > 2. I disabled the code in sitecustomize.py that added the leo-editor > directory to sys.path. > > 3. I changed the imports at the start of leoserver.py so they are: > > #! python3 > # pylint: disable=wrong-import-position > import asyncio > import getopt > import json > import os.path > import sys > import time > import traceback > # Third-party. > import websockets > # #1970: Adjust sys.path so that the following imports will always work. > _leo_editor_path = os.path.abspath(os.path.join(__file__, '..', '..', > '..')) > if _leo_editor_path not in sys.path: > sys.path.append(_leo_editor_path) > # Leo > import leo.core.leoBridge as leoBridge > import leo.core.leoNodes as leoNodes > from leo.core.leoGui import StringFindTabManager > > This works! > > > *Suggestions and conclusions* > > leoInteg should be able to find leo/core/leoserver.py given only the path > to the leo-editor directory. The latest code in Leo's devel branch reports > the path to leo-editor. So there should be no need for the user even to > know that leoserver.py exists, and a single setting (the path to > leo-editor) is probably the only path-related setting that should be needed. > > The import code shown above should work without any additions whatever to > the user's system path, or to python's path environment variable. > > The code in leobridgeserver.py must eventually be copied to leoserver.py, > with the additions shown above. > > So this is good progress. I'll be playing with leoInteg over the next few > days. > > 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/c8499695-d2a8-450b-a915-44110d204292n%40googlegroups.com.
