Changeset 734

Show
Ignore:
Timestamp:
01/09/07 07:56:49
Author:
crchemist
Message:

correct regular expression for "URL processing Regular Expressions" field.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • qPloneGoogleSitemaps/trunk/utils.py

    r733 r734  
    1313    return 0 
    1414 
    15 def searchAndReplace(string, what, with, options): 
     15def searchAndReplace(string, what, with): 
    1616    """Emulate sed command s/""" 
    1717    res = re.sub(what,with,string) 
     
    2222def applyOperations(objects, operations): 
    2323    """Parse Operations """ 
    24     parse = re.compile('(.*?)/(.*|.*?[^\\\])/(.*|.*?[^\\\])/(.*)'
     24    parse = re.compile(r'([a-zA-Z])/(.*?[^\\])/(.*?[^\\]?)/'
    2525    operations=[parse.match(op).groups() for op in operations] 
    2626    result={} 
    2727    for ob in objects: 
    2828        url = ob.getURL() 
    29         for operator, what, with, options in operations: 
    30             url = OPERATORS[operator](url, what, with, options
     29        for operator, what, with in operations: 
     30            url = OPERATORS[operator](url, what, with
    3131        #TODO: Remove or replace following condition 
    3232        #it is senseless in the case we need intelligent