Ignore:
Timestamp:
Oct 22, 2010 12:54:50 PM (14 years ago)
Author:
mylan
Message:

#228: Added relative path processing in default path-filter

File:
1 edited

Legend:

Unmodified
Added
Removed
  • quintagroup.plonegooglesitemaps/branches/blacklist/quintagroup/plonegooglesitemaps/utilities.py

    r2912 r2920  
    1919    def filterOut(self, fdata, fkey, **kwargs): 
    2020        """Filter-out fdata list by path in fkey.""" 
    21         return [b for b in fdata if b.getPath() != fkey] 
     21        if fkey.startswith("/"): 
     22            return [b for b in fdata if b.getPath() != fkey] 
     23        elif fkey.startswith("./"): 
     24            # Add relative path filter 
     25            smpath = kwargs.get("sitemap") 
     26            contpath = '/'.join(smpath.getPhysicalPath()[1:-1]) 
     27            resfilter = contpath + fkey[1:] 
     28            return [b for b in fdata if b.getPath() != resfilter] 
     29        return fdata 
Note: See TracChangeset for help on using the changeset viewer.