Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

4Suite / McMillan Installer / py2exe

7 views
Skip to first unread message

Thomas Korb

unread,
Sep 4, 2002, 11:18:03 AM9/4/02
to
Hi! I am using the XSLT-Processor from 4Suite (0.12.0a2), i.e.

from Ft.Xml.Xslt.Processor import Processor
from Ft.Xml.InputSource import DefaultFactory
from Ft.Xml import ReaderException

On Linux, I can use McMillan's Installer to create a distribution;
on Windows, it fails (problems with a Math.py-module in the 4Suite
package). And py2exe complains about missing modules.

I can overcome the py2exe-problem by importing everything from
Ft.Xml.Xslt, i.e.

import Ft.Xml.Xslt.ApplyImportsElement
import Ft.Xml.Xslt.ApplyTemplatesElement
etc. etc. (a lot of etc. :-)

(Too many module to include them on the commmand line with py2exe's
'-p' option; more than 1024 characters!)

After that, py2exe still complains about missing modules (some of
which even do not exist on the system; I think at least some of them
are Mac-specific!), but it works (as far as I could check up to now).

But now the program takes quite a time to start (many imports), and
I actually do not really trust this solution. Moreover, I would have
to check and test all the above imports with each new version of 4Suite.

Does someone know how to use 4Suite with the McMillan Installer or
py2exe on Windows? Any help or hints would be highly appreciated!

</Doc>

--
----------------- Dr. Thomas Korb - G O O D W E B . D E s i g n ---
----------------- DOMAIN: www.goodweb.de / E-MAIL: D...@goodweb.de ---

Thomas Heller

unread,
Sep 4, 2002, 3:41:13 PM9/4/02
to
"Thomas Korb" <D...@goodweb.de> wrote in message news:doc.m3adm...@goodweb.de...

> Hi! I am using the XSLT-Processor from 4Suite (0.12.0a2), i.e.
>
> from Ft.Xml.Xslt.Processor import Processor
> from Ft.Xml.InputSource import DefaultFactory
> from Ft.Xml import ReaderException
>
> On Linux, I can use McMillan's Installer to create a distribution;
> on Windows, it fails (problems with a Math.py-module in the 4Suite
> package). And py2exe complains about missing modules.
>
> I can overcome the py2exe-problem by importing everything from
> Ft.Xml.Xslt, i.e.
>
> import Ft.Xml.Xslt.ApplyImportsElement
> import Ft.Xml.Xslt.ApplyTemplatesElement
> etc. etc. (a lot of etc. :-)
>
> (Too many module to include them on the commmand line with py2exe's
> '-p' option; more than 1024 characters!)
>
Hm, you can also list them in the setup.cfg file.
Something like this:
[py2exe]
includes=Ft.Xml.Xslt.ApplyImportsElement,
Ft.Xml.Xslt.ApplyTemplatesElement,
....

And IIRC you can also use (on the command line)
--includes Ft.Xml.Xslt.*
or even
--packages Ft.Xml.Xslt


> After that, py2exe still complains about missing modules (some of
> which even do not exist on the system; I think at least some of them
> are Mac-specific!), but it works (as far as I could check up to now).
>
> But now the program takes quite a time to start (many imports), and

If you don't go the setup.cfg solution, you can probably speed it up
by only importing the modules in a dummy function (which is never
executed). Something like this:
def py2exe_hints():


import Ft.Xml.Xslt.ApplyImportsElement
import Ft.Xml.Xslt.ApplyTemplatesElement
etc. etc. (a lot of etc. :-)

> I actually do not really trust this solution. Moreover, I would have


> to check and test all the above imports with each new version of 4Suite.
>
> Does someone know how to use 4Suite with the McMillan Installer or
> py2exe on Windows? Any help or hints would be highly appreciated!
>

I never used 4Suite, so no. I even heard ;-) that py2exe
doesn't work so good with _xmlplus.

Thomas


Peter Hansen

unread,
Sep 4, 2002, 10:43:20 PM9/4/02
to
Thomas Heller wrote:
>>Does someone know how to use 4Suite with the McMillan Installer or
>>py2exe on Windows? Any help or hints would be highly appreciated!
>
> I never used 4Suite, so no. I even heard ;-) that py2exe
> doesn't work so good with _xmlplus.

We appear to have successfully worked around some of these issues
by simply renaming _xmlplus to xml and removing the original
xml directory. We're about to "finish" this task and verify that
things are still working, but at first glance it seemed to solve
the problems.

For what it's worth.... (and in case anyone wants to say "uh, that
won't work, moron". :-)

-Peter

Thomas Korb

unread,
Sep 5, 2002, 6:03:57 PM9/5/02
to
Thanks for the answers! (@Thomas Heller: I really like your
py2exe; it does a great job when using the standard Python-
distribution only; and it is very easy to use!)


I think I found a solution for Gordon McMillan's Installer:

In the 4Suite distribution, there is a module named 'Math.py'
in (e.g. for Python 2.2):

C:\Python22\Lib\site-packages\Ft\Xml\Xslt\Exslt\

This causes problems with Python's built-in math-module (most
probably since Win32 systems are not case-sensitive) when trying
to use Gordon McMillan's Installer. (The executable is built; but
when you try to use e.g. the XSLT-Processor of 4Suite, you get a
lot of error-messages.)

Solution - Rename the above module to something like 'myMath.py'
and change the import of 'Math' in __init.py__ (in the above dir)
to 'myMath'.

Then everythingworks just fine. (I am only using the XSLT-Processor;
so maybe the above changes affect other parts of 4Suite. Did not
check that up to now. But as far as I could see, the Math.py - module
is not used very often in the 4Suite-distribution.)

I will report this to the people at 4Suite.org. Maybe they still have
the chance to change this modules name in the next distribution.

0 new messages