Changeset 179

Show
Ignore:
Timestamp:
07/12/06 17:22:09 (2 years ago)
Author:
jgijsbers
Message:

Simplify and comment absoluteToRelative function.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/pyramid/page.py

    r177 r179  
    1919 
    2020def absoluteToRelative(tag,attr,dir): 
    21     VALID_URI_PREFIXES=('https://','http://','mailto:','ftp://') 
     21    # See whether the attribute that should be rewritten exists on the tag. 
    2222    try: 
    2323        uri = tag[attr] 
     
    2525        return 
    2626 
    27     foundprefix = False 
     27    # Don't rewrite full URIs. 
     28    VALID_URI_PREFIXES=('https://','http://','mailto:','ftp://') 
    2829    for prefix in VALID_URI_PREFIXES: 
    2930        if uri.startswith(prefix): 
    30             foundprefix = True 
    31     if foundprefix == True: 
    32         return 
     31            return 
    3332 
    3433    if uri.startswith('/'):