Changeset 2979 in products
- Timestamp:
- Nov 5, 2010 12:23:56 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
quintagroup.plonegooglesitemaps/branches/blacklist/quintagroup/plonegooglesitemaps/filters.py
r2939 r2979 14 14 def filterOut(self, fdata, fargs): 15 15 """Filter-out fdata list by id in fargs.""" 16 return [b for b in fdata if (b.getId or b.id) != fargs] 16 for b in fdata: 17 if (b.getId or b.id) != fargs: 18 yield b 17 19 18 20 … … 28 30 def filterOut(self, fdata, fargs): 29 31 """Filter-out fdata list by path in fargs.""" 32 if not (fargs.startswith("/") or fargs.startswith("./")): 33 for b in fdata: 34 yield b 35 30 36 if fargs.startswith("/"): 31 37 # absolute path filter 32 portal = queryMultiAdapter((self.context, self.request),33 name=u"plone_portal_state").portal() 34 return [b for b in fdata if b.getPath() != '/%s%s' % (portal.getId(), fargs)]35 el if fargs.startswith("./"):38 portal_id = queryMultiAdapter((self.context, self.request), 39 name=u"plone_portal_state").portal().getId() 40 test_path = '/' + portal_id + fargs 41 else: 36 42 # relative path filter 37 contpath = '/'.join(self.context.getPhysicalPath()[:-1]) 38 return [b for b in fdata if b.getPath() != (contpath + fargs[1:])] 39 return fdata 43 container_path = '/'.join(self.context.getPhysicalPath()[:-1]) 44 test_path = container_path + fargs[1:] 45 46 for b in fdata: 47 if b.getPath() != test_path: 48 yield b 49
Note: See TracChangeset
for help on using the changeset viewer.