#NEWLINE# def valid_filename( value ) : #NEWLINE# #INDENT# ' Validate that the string passed as input can safely\n    be used as a valid file name\n\n    ' #NEWLINE# if ( value in [ '.' , '..' ] ) : #NEWLINE# #INDENT# raise qisys . error . Error ( ( 'Invalid name: %s' % value ) ) #NEWLINE# #UNINDENT# bad_chars = '<>:"/\\|?*' #NEWLINE# for bad_char in bad_chars : #NEWLINE# #INDENT# if ( bad_char in value ) : #NEWLINE# #INDENT# mess = ( "Invalid name: '%s'\n" % value ) #NEWLINE# mess += 'A valid name should not contain any ' #NEWLINE# mess += 'of the following chars:\n' #NEWLINE# mess += ' ' . join ( bad_chars ) #NEWLINE# raise qisys . error . Error ( mess ) #NEWLINE# #UNINDENT# #UNINDENT# return mess