#NEWLINE# def vfs_construct_path( base_path , * path_components ) : #NEWLINE# #INDENT# 'Mimics behavior of os.path.join on Posix machines.' #NEWLINE# path = base_path #NEWLINE# for component in path_components : #NEWLINE# #INDENT# if component . startswith ( '/' ) : #NEWLINE# #INDENT# path = component #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( path == '' ) or path . endswith ( '/' ) ) : #NEWLINE# #INDENT# path += component #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# path += ( '/%s' % component ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return path