Show
Ignore:
Timestamp:
03/28/08 08:51:04 (2 years ago)
Author:
JensDiemer
Message:

Updating the cache middleware:

  • Splitting pagestats from cache is a good idea, after all ;)
  • add a debug information in the response
  • verify the shortcut from the url
  • update unittests
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/pylucid/PyLucid/tools/shortcuts.py

    r1503 r1511  
    1919ALLOW_CHARS = string.ascii_letters + string.digits + "_" 
    2020 
     21def verify_shortcut(shortcut): 
     22    """ 
     23    Check a shortcut. Raise AssertionError if something seems to be wrong. 
     24    But normaly the urls-re should only filter the bad thing from urls ;) 
     25    """ 
     26    if shortcut=="": 
     27        raise AssertionError("Shortcut is empty!") 
     28 
     29    for char in shortcut: 
     30        if not char in ALLOW_CHARS: 
     31            raise AssertionError( 
     32                "Not allowed character in shortcut: '%r'" % char 
     33            ) 
    2134 
    2235def makeUnique(item_name, name_list):