#NEWLINE# def path_from_name( name , ext = None , sep = '|' ) : #NEWLINE# #INDENT# 'Convert name with optional extension to file path.' #NEWLINE# if ext : #NEWLINE# #INDENT# return fsencode ( ( name . replace ( os . sep , ext ) + ext ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return fsencode ( name . replace ( os . sep , sep ) )