Changeset 624

Show
Ignore:
Timestamp:
04/06/06 01:54:37 (3 years ago)
Author:
coderanger
Message:

WikiRenameScript:

Allow links of the form foo? to be translated.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • wikirenamescript/0.9/RenamePage.py

    r456 r624  
    6969    # Get a list of all wiki pages containing links to the old page 
    7070    if debug: print "Trying to fix links" 
    71     sql = 'SELECT w1.version,w1.name,w1.text' + sqlbase + 'AND w1.text like \'%%[wiki:%s %%\'' % oldname 
     71    sql = 'SELECT w1.version,w1.name,w1.text' + sqlbase + "AND w1.text like '%%[wiki:%s%%'" % oldname 
    7272    cursor.execute(sql) 
    7373 
    7474    # Rewrite all links to the old page, such as to point to the new page 
    7575    for row in cursor: 
    76         newtext = sre.sub('\[wiki:%s '%oldname,'[wiki:%s '%newname,row[2]) 
     76        newtext = sre.sub('\[wiki:%s'%oldname,'[wiki:%s'%newname,row[2]) 
    7777        cursor.execute('UPDATE wiki SET text=%s WHERE name=%s AND version=%s', (newtext,row[1],row[0])) 
    7878