On Friday 13 May 2005 13:39, G. Milde wrote:
> On 11.05.05, Jose' Matos wrote:

> > > (This would need some more thoughts about the right place of
> > > the files and incorporating with the python path.)
> >
> >   That was also my thought. :-)
> >   One idea would be to transform LyX into a package instead of it being
> > a module.
>
> Actually, I already converted my pyclient script into a LyX package (with
> LyX/pyserver.py, LyX/pyclient.py, LyX/lfuns.py, ...). (As I need to
> finish testing, it is still unpublished.)

  To be a real package you need the __init__.py file also, I didn't saw it 
there in your list. :-)

> I currently have it in my PYTHONPATH, and the wrapper-scripts (like
> lyx-remote) in ~/.lyx/scripts/.
>
> This way I can
>
>   * call import the modules from the wrapper script with e.g.
>     from LyX import lyxserver
>
>   * browse the documentation with pydoc

  True.

  But we can, and should add it to the sitelib of python. Just like we do 
with some of the tex related stuff.

  For Fedora 3 that I am using now this is:
/usr/lib/python2.3/site-packages/

  But again due to python multi-platform nature that is not a problem since 
we can use distutils to install it in the correct place.

> However, I can imagine problems with not knowing the PYTHONPATH or the
> desire of LyX developers to keep lyx-related files under LYXDIR
> (/usr/share/lyx on my Debian).
>
> So, instead of a package directory "LyX" directly in the PYTHONPATH, I
> suggest "$LYXDIR/pyLyX".
>
>   The package name would then be called "pyLyX" (PYthon package for LYX),
>   this is still short enough and more informative. (someone seeing
>   "usr/share/lyx/LyX" would not be able to tell that this is a Python
>   package.)
>
> A symlink or a path configuration (*.pth) file would than add
> LYXDIR/pyLyX to the PYTHONPATH. (Additionaly Python wrapper scripts in
> "LYXDIR/scripts" could modify sys.path to include LYXDIR/pyLyX in any
> case.)

  With my proposal LyX is again the natural name and there is no need to 
play with PITHONPATH, as the package will then be installed in the 
system. :-)

> If you then move LYXDIR/lyx2lyx/ to LYXDIR/pyLyX/lyx2lyx, it becomes
> a part of the pyLyX package. Now moving LYXDIR/lyx2lyx/lyx2lyx to
> LYXDIR/scripts/lyx2lyx would make the lyx2lyx wrapper easily available
> again. Of course this moves would need changes in the import
> statements...

  Again no need to change its place, lyx2lyx should remain where it is and 
as it does now it is a simple client of LyX.

  Also with this scheme there is no need to change either yours or the 
existing code.

> Günter

-- 
José Abílio

Reply via email to