Bug#468601: python-xml removal: please drop/replace (build) dependencies

2008-04-11 Thread Michael Banck
reassign 468601 python-4suite-xml
thanks

Hi,

ok, so for the record, this is the runtime error I get when appying
Matthias' patch (i.e. a quick port to python-4suite-xml, see
http://people.ubuntu.com/~doko/tmp/gcal.debdiff if still around):

Traceback (most recent call last):
  File "/usr/lib/opensync/google-cal-helper", line 452, in ?
sys.exit(main(sys.argv))
  File "/usr/lib/opensync/google-cal-helper", line 444, in main
return fn(argv)
  File "/usr/lib/opensync/google-cal-helper", line 332, in oper_get_all
e = GCalEntry(atom=xe)
  File "/usr/lib/opensync/google-cal-helper", line 187, in __init__
self.parseAtom(atom)
  File "/usr/lib/opensync/google-cal-helper", line 196, in parseAtom
self.editUri = self.elementValue('atom:[EMAIL PROTECTED]"edit"]/@href')
  File "/usr/lib/opensync/google-cal-helper", line 293, in elementValue
nodes = self.query(name)
  File "/usr/lib/opensync/google-cal-helper", line 304, in query
return XPath.Evaluate(expr, context=ctx)
  File "/usr/lib/python2.4/site-packages/Ft/Xml/XPath/Util.py", line 188, in 
Evaluate
retval = XPathParser.new().parse(expr).evaluate(con)
  File 
"/usr/lib/python2.4/site-packages/Ft/Xml/XPath/ParsedRelativeLocationPath.py", 
line 18, in evaluate
nodeset = self._left.select(context)
  File "/usr/lib/python2.4/site-packages/Ft/Xml/XPath/ParsedStep.py", line 30, 
in evaluate
node_set = self._predicates.filter(node_set, context, reverse)
  File "/usr/lib/python2.4/site-packages/Ft/Xml/XPath/ParsedPredicateList.py", 
line 43, in filter
res = pred.evaluate(context)
  File "/usr/lib/python2.4/site-packages/Ft/Xml/XPath/ParsedExpr.py", line 721, 
in evaluate
left = self._left.evaluate(context)
  File "/usr/lib/python2.4/site-packages/Ft/Xml/XPath/ParsedStep.py", line 28, 
in evaluate
(node_set, reverse) = self._axis.select(context, self._nodeTest.match)
  File "/usr/lib/python2.4/site-packages/Ft/Xml/XPath/ParsedAxisSpecifier.py", 
line 94, in select
result = [ attr for attr in context.node.xpathAttributes
AttributeError: Element instance has no attribute 'xpathAttributes'

If I print out what is being parsed/frobbed, I get this with python-xml:

atom:title/text()
atom:id/text()
atom:[EMAIL PROTECTED]"edit"]/@href
atom:[EMAIL PROTECTED]"text"]/text()
gd:recurrence/text()
gd:when/@startTime
gd:when/@endTime
gd:eventStatus/@value
gd:where/@valueString
xs to osync: 2008-03-17T08:30:00.000+01:00 => 20080317T083000
xs to osync: 2008-03-17T09:30:00.000+01:00 => 20080317T093000
atom:title/text()
atom:id/text()
atom:[EMAIL PROTECTED]"edit"]/@href
atom:[EMAIL PROTECTED]"text"]/text()
gd:recurrence/text()
gd:when/@startTime
gd:when/@endTime
gd:eventStatus/@value
gd:where/@valueString

When I do the same with python-4suite-xml, I get:

Member 2 of type file-sync just sent all changes
atom:title/text()
atom:id/text()
atom:[EMAIL PROTECTED]"edit"]/@href

and then the traceback.  Could it be that python-4suite-xml chokes on
the parenthesis?  Indeed, if I replace the 4suite code of class
ParsedAttributeAxisSpecifier's select method with what was in
python-xml, it works fine, thus reassigning to python-4suite-xml.  If
the above input is out of spec or bogus or wrong (I wouldn't know),
please assign back.

This is the code I changed (file Ft/Xml/XPath/ParsedAxisSpecifier.py):

class ParsedAttributeAxisSpecifier(AxisSpecifier):

principalType = Node.ATTRIBUTE_NODE

#def select(self, context, nodeTest):
#"""Select all of the attributes from the context node"""
#result = [ attr for attr in context.node.xpathAttributes
#   if nodeTest(context, attr, self.principalType) ]
#return (result, 0)
def select(self, context, nodeTest):
"""Select all of the attributes from the context node"""
attrs = context.node.attributes
rt = filter(lambda attr, test=nodeTest, context=context, 
pt=self.principalType:
test(context, attr, pt),
attrs and attrs.values() or [])
return (rt, 0)



Michael



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#468601: python-xml removal: please drop/replace (build) dependencies

2008-04-07 Thread Michael Banck
Bah, that didn't work out, I did some mistakes during testing, and
it turns out libopensync-plugin-google-calendar_0.22-5 doesn't fix this.

I did some further fixes regarding xpath, but now I hit this:

Traceback (most recent call last):
  File "/usr/lib/opensync/google-cal-helper", line 34, in ?
import xpath
  File "/usr/lib/opensync/xpath/__init__.py", line 103, in ?
from Util import NormalizeNode
  File "/usr/lib/opensync/xpath/Util.py", line 15, in ?
import xml.dom.ext
ImportError: No module named ext

Any recommendation how to circumvent this?


Michael



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]