That was simple, I didn't know about the 'basename()' and 'splitext()' os functions. I'll merge all of the changes that have occurred within the 1.3 line since the creation of the 'tensor_pdb' branch and then incorporate this function. Another thing for tomorrow (unless you would like to do it Chris).
Edward On 11/1/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
Author: macraild Date: Tue Oct 31 17:49:36 2006 New Revision: 2719 URL: http://svn.gna.org/viewcvs/relax?rev=2719&view=rev Log: Impliments the io.file_root() function. As suggested: https://mail.gna.org/public/relax-devel/2006-10/msg00218.html Modified: 1.3/io.py Modified: 1.3/io.py URL: http://svn.gna.org/viewcvs/relax/1.3/io.py?rev=2719&r1=2718&r2=2719&view=diff ============================================================================== --- 1.3/io.py (original) +++ 1.3/io.py Tue Oct 31 17:49:36 2006 @@ -42,7 +42,7 @@ __builtin__.devnull_import_message = message.args[0] from os import F_OK, X_OK, access, altsep, getenv, makedirs, pathsep, remove, sep, stat -from os.path import expanduser +from os.path import expanduser, basename, splitext from re import match, search from string import split import sys @@ -154,6 +154,13 @@ # Return the file path. return file_path + + + def file_root(self, file_path): + """Return the root file name, striped of path and extension details""" + + root,ext = splitext(file_path) + return basename(root) def log(self, file_name=None, dir=None, compress_type=0, print_flag=1): _______________________________________________ relax (http://nmr-relax.com) This is the relax-commits mailing list [email protected] To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-commits
_______________________________________________ relax (http://nmr-relax.com) This is the relax-devel mailing list [email protected] To unsubscribe from this list, get a password reminder, or change your subscription options, visit the list information page at https://mail.gna.org/listinfo/relax-devel

