Changeset 3152 in products for quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/browser/utils.py
- Timestamp:
- Apr 20, 2011 8:20:36 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/browser/utils.py
r2181 r3152 14 14 _marker = [] 15 15 16 16 17 def searchAndReplace(string, what, withs): 17 18 """Emulate sed command s/""" 18 res = re.sub(what, withs,string)19 res = re.sub(what, withs, string) 19 20 return res 20 OPERATORS = {'s': searchAndReplace,} 21 OPERATORS = {'s': searchAndReplace, } 22 21 23 22 24 def applyOperations(objects, operations): 23 25 """Parse Operations """ 24 operations =[OPERATIONS_PARSE.match(op).groups() for op in operations]26 operations = [OPERATIONS_PARSE.match(op).groups() for op in operations] 25 27 result = {} 26 28 for ob in objects: … … 38 40 if url in result.keys(): 39 41 continue 40 #TODO: replace brain with only data necessary to 42 #TODO: replace brain with only data necessary to 41 43 #generate sitemap 42 result[url] =ob44 result[url] = ob 43 45 return result 46 44 47 45 48 def additionalURLs(context): … … 49 52 plone_home = getToolByName(context, 'portal_url')() 50 53 root = context.getPhysicalRoot().absolute_url() 51 URLs = 54 URLs = context.getUrls() 52 55 53 56 for url in URLs: 54 57 if ADD_ZOPE.match(url): 55 res.append(root +url)58 res.append(root + url) 56 59 elif ADD_PLONE.match(url): 57 res.append(plone_home +'/'+url)60 res.append(plone_home + '/' + url) 58 61 else: 59 62 res.append(url)
Note: See TracChangeset
for help on using the changeset viewer.