#NEWLINE# def urljoin( * atoms ) : #NEWLINE# #INDENT# 'Return the given path \\*atoms, joined into a single URL.\n\n    This will correctly join a SCRIPT_NAME and PATH_INFO into the\n    original URL, even if either atom is blank.\n    ' #NEWLINE# url = '/' . join ( [ x for x in atoms if x ] ) #NEWLINE# while ( '//' in url ) : #NEWLINE# #INDENT# url = url . replace ( '//' , '/' ) #NEWLINE# #UNINDENT# return ( url or '/' )