def checkFile(filename):
 valid = True
 if ((filename is None) or (not os.path.isfile(filename))):
  valid = False
 if valid:
  try:
   with open(filename, 'rb'):
    pass
  except:
   valid = False
 if (not valid):
  raise PocsuiteSystemException(("unable to read file '%s'" % filename))

def checkFile ( filename ) : valid = True if ( ( filename is None ) or ( not os . path . isfile ( filename ) ) ) : valid = False if valid : try : with open ( filename , 'rb' ) : pass except : valid = False if ( not valid ) : raise PocsuiteSystemException ( ( "unable to read file '%s'" % filename ) )
checks for file existence and readability .