[scribus-dev] Windows - Replacing Shipped Python Interpreter

John Laurence Poole jlpoole56 at gmail.com
Sat May 30 21:08:22 UTC 2015


I'd sure like to hear from the person who makes the Windows Build for
Scribus (a project I had been diligently pursuing using the open source
win-build) comment on this.  I do not want to post something on the wiki
only to have some knowledgeable person point out that my hack creates a
problem, risks corrupted or nonconforming xml, or a host of other possible
bugs.

I do not know to what extent the included Python interpreter interacts with
Scribus.  Is it there only for scripting?

On Sat, May 30, 2015 at 12:52 PM, Joao S. O. Bueno <gwidion at gmail.com>
wrote:

> That is great - it could be made a documentation entry - or otherwise
> be put in some visible web place.  This is the kind of thing that
> could be easier to do for Windows users.
>
> On 30 May 2015 at 12:05, John L. Poole <jlpoole56 at gmail.com> wrote:
> > I wanted the ability to transact with postgreSQL from within Scribus
> > and the Python Interpreter shipped with Scribus does not contain
> > the postgreSQL module: psycopg2
> >
> > So, as I wrote earlier today, I hacked the Windows build to use
> > my installed Python vs. that shipped with the build.
> >
> > Others may want to do the same, so I have created a Windows batch file
> > that accomplishes the necessary substitutions.
> >
> > Here is the script:
> > -------------------------------------------
> >     @echo off
> >     ::
> >     :: special run of Scribus that uses Python installed on the
> >     :: users system that matches the build of the Python interpreter
> >     :: shipped with Scribus rather than the Python Interpreter shipped
> >     :: with Scribus' build.
> >     ::
> >     :: See: http...wiki....[Windows Replacing Shipped Python Interpreter]
> >     ::
> >     echo.
> >     echo Running Scribus ***without*** its shipped Python Interpreter
> >     echo.
> >     ::
> >     :: Hide the shipped version of the Python interpreter so Scribus will
> > use
> >     :: the "same" version we have built on Windows
> >     ::
> >     if exist python (
> >         echo masking Scribus Python directory
> >         ren python python.SUSPEND
> >     )
> >     if exist python27.dll (
> >         echo masking Scribus library python.dll
> >         ren python27.dll python27.dll.SUSPEND
> >     )
> >     echo.
> >     ::
> >     :: point to our custom Python which should match the build of
> >     :: Python shipped with this version of Scribus
> >     :: See:
> >     ::
> >     PATH=C:\Python278;.
> >     ::
> >     ::   run it!
> >     ::
> >     echo.
> >     echo Launching Scribus...
> >     scribus.exe
> >     echo.
> >     ::
> >     :: undo our temporary masks so we don't run Scribus in the future
> >     :: forgetting that we have this special hack to replace the Python
> >     :: interpreter shipped with it
> >     ::
> >     if exist python.SUSPEND (
> >         echo restoring Scribus Python directory
> >         ren python.SUSPEND python
> >     )
> >     if exist python27.dll.SUSPEND (
> >         echo restoring Scribus library python.dll
> >         ren python27.dll.SUSPEND python27.dll
> >     )
> >     echo.
> >     ::
> >     :: remind our user that we're cleaning up
> >     ::
> >     pause
> >
> > -------------------------------------------
> >
> > Before I go public with this on the Sribus Scripting wiki, I'd like to
> see
> > if there are any
> > objections or problems with this approach.
> >
> > Opinions?
> >
> >
> >
> > _______________________________________________
> > scribus-dev mailing list
> > scribus-dev at lists.scribus.net
> > http://lists.scribus.net/mailman/listinfo/scribus-dev
> >
>
> _______________________________________________
> scribus-dev mailing list
> scribus-dev at lists.scribus.net
> http://lists.scribus.net/mailman/listinfo/scribus-dev
>



-- 
John L. Poole

P.O. Box 6566
Napa, CA 94581-6566
707-812-1323

jlpoole56 at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scribus.net/pipermail/scribus-dev/attachments/20150530/6c7b12c1/attachment.html>


More information about the scribus-dev mailing list