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
relax-commits@xxxxxxx
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