def ValidFilename(filename):
 if (_file_path_positive_re.match(filename) is None):
  return ('Invalid character in filename: %s' % filename)
 if (_file_path_negative_1_re.search(filename) is not None):
  return ('Filename cannot contain "." or ".." or start with "-" or "_ah/": %s' % filename)
 if (_file_path_negative_2_re.search(filename) is not None):
  return ('Filename cannot have trailing / or contain //: %s' % filename)
 if (_file_path_negative_3_re.search(filename) is not None):
  return ('Any spaces must be in the middle of a filename: %s' % filename)
 return ''

def ValidFilename ( filename ) : if ( _file_path_positive_re . match ( filename ) is None ) : return ( 'Invalid character in filename: %s' % filename ) if ( _file_path_negative_1_re . search ( filename ) is not None ) : return ( 'Filename cannot contain "." or ".." or start with "-" or "_ah/": %s' % filename ) if ( _file_path_negative_2_re . search ( filename ) is not None ) : return ( 'Filename cannot have trailing / or contain //: %s' % filename ) if ( _file_path_negative_3_re . search ( filename ) is not None ) : return ( 'Any spaces must be in the middle of a filename: %s' % filename ) return ''
determines if filename is valid .