From a7301cc9a262e0ba05a85566b292f6a01851589e Mon Sep 17 00:00:00 2001 From: samus_ Date: Tue, 22 Jul 2008 18:38:02 +0000 Subject: [PATCH] implemented __getslice__ for the XPathSelectorList, still broken when using step-slices --HG-- extra : convert_revision : svn%3Ab85faa78-f9eb-468e-a121-7cced6da292c%4094 --- scrapy/trunk/scrapy/xpath/selector.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scrapy/trunk/scrapy/xpath/selector.py b/scrapy/trunk/scrapy/xpath/selector.py index bdc30cf89..f49e5c84c 100644 --- a/scrapy/trunk/scrapy/xpath/selector.py +++ b/scrapy/trunk/scrapy/xpath/selector.py @@ -86,6 +86,9 @@ class XPathSelector(object): class XPathSelectorList(list): """List of XPathSelector objects""" + def __getslice__(self, i, j): + return XPathSelectorList(list.__getslice__(self, i, j)) + def x(self, xpath): """Perform the given XPath query on each XPathSelector of the list and return a new (flattened) XPathSelectorList of the results"""