Changeset 2923 in products
- Timestamp:
- Oct 25, 2010 2:38:55 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
quintagroup.plonegooglesitemaps/branches/blacklist/quintagroup/plonegooglesitemaps/utilities.py
r2922 r2923 1 1 from zope.interface import implements 2 from zope.component import queryMultiAdapter 2 3 from quintagroup.plonegooglesitemaps.interfaces import IBlackoutFilterUtility 3 4 … … 19 20 def filterOut(self, fdata, fkey, **kwargs): 20 21 """Filter-out fdata list by path in fkey.""" 22 sm = kwargs.get("sitemap", None) 23 req = kwargs.get("request", None) 21 24 if fkey.startswith("/"): 22 25 # absolute path filter 23 return [b for b in fdata if b.getPath() != fkey] 26 # portal_state = getMultiAdapter((self.context, self.request), name=u'plone_portal_state') 27 portal = queryMultiAdapter((sm, req), name=u"plone_portal_state").portal() 28 return [b for b in fdata if b.getPath() != '/%s%s' % (portal.getId(), fkey)] 24 29 elif fkey.startswith("./"): 25 30 # relative path filter 26 smpath = kwargs.get("sitemap") 27 contpath = '/'.join(smpath.getPhysicalPath()[:-1]) 28 resfilter = contpath + fkey[1:] 29 return [b for b in fdata if b.getPath() != resfilter] 31 contpath = '/'.join(sm.getPhysicalPath()[:-1]) 32 return [b for b in fdata if b.getPath() != (contpath + fkey[1:])] 30 33 return fdata
Note: See TracChangeset
for help on using the changeset viewer.