Changeset 734
- Timestamp:
- 01/09/07 07:56:49
- Files:
-
- qPloneGoogleSitemaps/trunk/utils.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
qPloneGoogleSitemaps/trunk/utils.py
r733 r734 13 13 return 0 14 14 15 def searchAndReplace(string, what, with , options):15 def searchAndReplace(string, what, with): 16 16 """Emulate sed command s/""" 17 17 res = re.sub(what,with,string) … … 22 22 def applyOperations(objects, operations): 23 23 """Parse Operations """ 24 parse = re.compile( '(.*?)/(.*|.*?[^\\\])/(.*|.*?[^\\\])/(.*)')24 parse = re.compile(r'([a-zA-Z])/(.*?[^\\])/(.*?[^\\]?)/' ) 25 25 operations=[parse.match(op).groups() for op in operations] 26 26 result={} 27 27 for ob in objects: 28 28 url = ob.getURL() 29 for operator, what, with , optionsin operations:30 url = OPERATORS[operator](url, what, with , options)29 for operator, what, with in operations: 30 url = OPERATORS[operator](url, what, with) 31 31 #TODO: Remove or replace following condition 32 32 #it is senseless in the case we need intelligent
