mailr2720 - /branches/tensor_pdb/io.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by c . a . macraild on October 31, 2006 - 18:00:
Author: macraild
Date: Tue Oct 31 17:59:36 2006
New Revision: 2720

URL: http://svn.gna.org/viewcvs/relax?rev=2720&view=rev
Log:
Porting the io.file_root() function (r2719) from the 1.3 line

Command used:
snv merge -r2718:2719 svn+ssh://macraild@xxxxxxxxxxx/svn/relax/1.3 .
 

Modified:
    branches/tensor_pdb/io.py

Modified: branches/tensor_pdb/io.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/tensor_pdb/io.py?rev=2720&r1=2719&r2=2720&view=diff
==============================================================================
--- branches/tensor_pdb/io.py (original)
+++ branches/tensor_pdb/io.py Tue Oct 31 17:59: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):




Related Messages


Powered by MHonArc, Updated Tue Oct 31 18:20:05 2006