Changeset 66445


Ignore:
Timestamp:
Oct 9, 2015, 6:38:35 AM (9 years ago)
Author:
wenzeslaus
Message:

ignore also https when fixing URLs in addons manuals

Follows r63507. Fixes e.g. Reference link in v.ellipse manual.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • grass-addons/tools/addons/update_manual.py

    r65891 r66445  
    88import re
    99
     10
    1011def get_addons(path):
    1112    return os.walk(path).next()[1]
     13
    1214
    1315def main(htmlfile, prefix):
     
    2628    addons = get_addons(os.sep.join(htmlfile.split(os.sep)[:4]))
    2729    for match in re.finditer(pattern, shtml):
    28         if match.group(1)[:7] == 'http://':
     30        # most common URLs
     31        if match.group(1).startswith('http://'):
    2932            continue
     33        if match.group(1).startswith('https://'):
     34            continue
     35        # protocol-relative URL
     36        if match.group(1).startswith('//'):
     37            continue
     38        # TODO: perhaps we could match any *://
     39        # link to other addon
    3040        if match.group(1).replace('.html', '') in addons:
    3141            continue
     
    3343
    3444    if not pos:
    35         return # no match
     45        return  # no match
    3646
    3747    # replace file URIs
     
    5060        f.close()
    5161
     62
    5263if __name__ == "__main__":
    5364    if len(sys.argv) != 3:
Note: See TracChangeset for help on using the changeset viewer.