Author: bugman Date: Tue Nov 20 18:22:06 2007 New Revision: 3712 URL: http://svn.gna.org/viewcvs/relax?rev=3712&view=rev Log: Renamed the file_path class method to the get_file_path module function. Modified: 1.3/relax_io.py Modified: 1.3/relax_io.py URL: http://svn.gna.org/viewcvs/relax/1.3/relax_io.py?rev=3712&r1=3711&r2=3712&view=diff ============================================================================== --- 1.3/relax_io.py (original) +++ 1.3/relax_io.py Tue Nov 20 18:22:06 2007 @@ -58,6 +58,23 @@ """ +def get_file_path(file_name=None, dir=None): + """Generate and expand the full file path.""" + + # File name. + file_path = file_name + + # Add the directory. + if dir: + file_path = dir + '/' + file_path + + # Expand any ~ characters. + file_path = expanduser(file_path) + + # Return the file path. + return file_path + + def log(file_name=None, dir=None, compress_type=0, print_flag=1): """Function for turning logging on.""" @@ -99,7 +116,7 @@ """Open the file 'file' and return all the data.""" # File path. - file_path = file_path(file_name, dir) + file_path = get_file_path(file_name, dir) # Test if the file exists and determine the compression type. if access(file_path, F_OK): @@ -163,7 +180,7 @@ mkdir_nofail(dir, print_flag=0) # File path. - file_path = file_path(file_name, dir) + file_path = get_file_path(file_name, dir) # Bzip2 compression. if compress_type == 1 and not search('.bz2$', file_path): @@ -254,7 +271,7 @@ """Function for deleting the given file.""" # File path. - file_path = self.file_path(file_name, dir) + file_path = get_file_path(file_name, dir) # Test if the file exists and determine the compression type. if access(file_path, F_OK): @@ -296,23 +313,6 @@ file.close() - def file_path(self, file_name=None, dir=None): - """Generate and expand the full file path.""" - - # File name. - file_path = file_name - - # Add the directory. - if dir: - file_path = dir + '/' + file_path - - # Expand any ~ characters. - file_path = expanduser(file_path) - - # Return the file path. - return file_path - - def file_root(self, file_path): """Return the root file name, striped of path and extension details"""