Hello.

I was trying to integrate TGWebServices with TurboGears and Python 2.5.
TG startup was complaining that there is no cElement module. When I try 
easy_install cElement on Windows it blame me that I do not have Visual 
Studio 2003 installed on my machine ;)
Than I take a closer look at documentation and cElement is already part 
of Python2.5, so it is not necessary to install it.

I want to import WebServices:
from tgwebservices.controllers import WebServicesRoot, wsexpose, wsvalidate

When I changed import line to import xml module and etree which is 
already part of Python2.5 (in controllers.py and soap.py) to :
import xml.etree.cElementTree as et

I get following complain:

ImportError: No module named etree.cElementTree


Whoops, that's not good. Then i put some code in import section, to be 
sure what's going on:
import xml
print xml

Result:
Python25\Lib\site-packages\tgwebservices-1.1.2-py2.5.egg\tgwebservices\xml.pyc

And that's the problem xml name from global modle is colliding with 
local name of xml.py in TGWebServices.

One solution which I propose to get TGWebServices working with Python2.5 
is based on absolute import: http://docs.python.org/whatsnew/pep-328.html

In files controllers.py and soap.py make following changes:
- at the beggining of file put:
   from __future__ import absolute_import
- and change line with import cElementTree to:
  import xml.etree.cElementTree as et

Result: Python2.5 + TGWebSerivces works nice, no need to install 
cElement from external package :)


PS: Kevin Dangoor, please consider implementation of correction of 
namespace collision to TGWebServices.

Enjoy.


Juraj

-- 
Asinus IT Group - http://www.asinus.org
FlexGarden      - http://www.flexgarden.net
Personal page   - http://juraj.michalek.asinus.org 


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to