#NEWLINE# def has_leading_dir( paths ) : #NEWLINE# #INDENT# 'Returns true if all the paths have the same leading path name\n    (i.e., everything is in one subdirectory in an archive)' #NEWLINE# common_prefix = None #NEWLINE# for path in paths : #NEWLINE# #INDENT# ( prefix , rest ) = split_leading_dir ( path ) #NEWLINE# if ( not prefix ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( common_prefix is None ) : #NEWLINE# #INDENT# common_prefix = rest #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( prefix != common_prefix ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# return True