def WebRootCheck(path):
 p = re.sub('/+', '/', ('/%s/' % path))[:(-1)]
 if (p != CleanText(p, banned=CleanText.NONPATH).clean):
  raise ValueError(('Invalid web root: %s' % path))
 return p

def WebRootCheck ( path ) : p = re . sub ( '/+' , '/' , ( '/%s/' % path ) ) [ : ( - 1 ) ] if ( p != CleanText ( p , banned = CleanText . NONPATH ) . clean ) : raise ValueError ( ( 'Invalid web root: %s' % path ) ) return p
verify that a string is a valid web root path .