PEATSA/Core/Utilities.py
def CheckFile(path):
	
	'''Checks if path refers to an existing file.
	
	Parameters:
		path - A path to a file - Can be absolute or not.
		
	Returns:
		The absolute path to the file.
		
	Exceptions:
		Raises an IOError if the file does not exist or if its not a file'''
		
	#Make the filename absolute
	if not os.path.isabs(path):
		path = os.path.abspath(path)
	
	#Check the specified file exists.
	if not os.path.exists(path):
		raise IOError, 'File %s does not exist' % path
		
	#Check its a file
	if not os.path.isfile(path):
		raise IOError, 'Object at %s is not a file' % path	
	
	return path
Checks if path refers to an existing file.
	
	Parameters:
		path - A path to a file - Can be absolute or not.
		
	Returns:
		The absolute path to the file.
		
	Exceptions:
		Raises an IOError if the file does not exist or if its not a file
Checks if path refers to an existing file.
Parameters:
path - A path to a file - Can be absolute or not.

The absolute path to the file.

Raises an IOError if the file does not exist or if its not a file
Checks if path refers to an existing file . Parameters : path - A path to a file - Can be absolute or not . The absolute path to the file . Raises an IOError if the file does not exist or if its not a file
def CheckFile(path):
	if not os.path.isabs(path):
		path = os.path.abspath(path)
	if not os.path.exists(path):
		raise IOError, 'File %s does not exist' % path
	if not os.path.isfile(path):
		raise IOError, 'Object at %s is not a file' % path	
	return path
def CheckFile ( path ) : if not os . path . isabs ( path ) : path = os . path . abspath ( path ) if not os . path . exists ( path ) : raise IOError , 'File %s does not exist' % path if not os . path . isfile ( path ) : raise IOError , 'Object at %s is not a file' % path return path
Checks if path refers to an existing file.
Checks if path refers to an existing file .
'''Checks if path refers to an existing file.
	
	Parameters:
		path - A path to a file - Can be absolute or not.
		
	Returns:
		The absolute path to the file.
		
	Exceptions:
		Raises an IOError if the file does not exist or if its not a file''' #Make the filename absolute #Check the specified file exists. #Check its a file
path