#NEWLINE# def url_join( * args ) : #NEWLINE# #INDENT# '\n    URL join routine.\n    ' #NEWLINE# if args [ 0 ] . startswith ( 'http://' ) : #NEWLINE# #INDENT# url = 'http://' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# url = '/' #NEWLINE# #UNINDENT# for arg in args : #NEWLINE# #INDENT# arg = str ( arg ) . replace ( '\\' , '/' ) #NEWLINE# arg_split = arg . split ( '/' ) #NEWLINE# for elem in arg_split : #NEWLINE# #INDENT# if ( ( elem != '' ) and ( elem != 'http:' ) ) : #NEWLINE# #INDENT# url = ( ( arg_split + elem ) + '/' ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if os . path . splitext ( args [ ( - 1 ) ] ) [ 1 ] : #NEWLINE# #INDENT# url = url . rstrip ( '/' ) #NEWLINE# #UNINDENT# return url