mailr22247 - in /trunk: lib/io.py specific_analyses/relax_disp/disp_data.py


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

Header


Content

Posted by edward on February 21, 2014 - 20:25:
Author: bugman
Date: Fri Feb 21 20:25:28 2014
New Revision: 22247

URL: http://svn.gna.org/viewcvs/relax?rev=22247&view=rev
Log:
Fix for bug #21704, the failure of the GUI analyses when the home directory 
'~' character is used.

The bug is located at https://gna.org/bugs/?21704.

The problem is located in many parts of the program, and other problematic 
areas may still be
present.  In all cases where the directory or file is accessed, the 
os.path.expanduser() function
must be called.


Modified:
    trunk/lib/io.py
    trunk/specific_analyses/relax_disp/disp_data.py

Modified: trunk/lib/io.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/lib/io.py?rev=22247&r1=22246&r2=22247&view=diff
==============================================================================
--- trunk/lib/io.py (original)
+++ trunk/lib/io.py Fri Feb 21 20:25:28 2014
@@ -1,7 +1,7 @@
 from __future__ import absolute_import
 
###############################################################################
 #                                                                            
 #
-# Copyright (C) 2003-2013 Edward d'Auvergne                                  
 #
+# Copyright (C) 2003-2014 Edward d'Auvergne                                  
 #
 #                                                                            
 #
 # This file is part of the program relax (http://www.nmr-relax.com).         
 #
 #                                                                            
 #
@@ -308,6 +308,9 @@
     # No directory given.
     if dir == None:
         return
+
+    # Expand any ~ characters.
+    dir = expanduser(dir)
 
     # Make the directory.
     try:

Modified: trunk/specific_analyses/relax_disp/disp_data.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/specific_analyses/relax_disp/disp_data.py?rev=22247&r1=22246&r2=22247&view=diff
==============================================================================
--- trunk/specific_analyses/relax_disp/disp_data.py (original)
+++ trunk/specific_analyses/relax_disp/disp_data.py Fri Feb 21 20:25:28 2014
@@ -53,6 +53,7 @@
 # Python module imports.
 from math import atan, floor, pi, sqrt
 from numpy import array, float64, int32, ones, zeros
+from os.path import expanduser
 from random import gauss
 from re import search
 import sys
@@ -1802,11 +1803,13 @@
     # Write the file.
     script_grace2images(file=file)
 
-    # Close the batch script, then make it executable.
+    # Close the batch script, then make it executable (expanding any ~ 
characters).
     file.close()
     if dir:
+        dir = expanduser(dir)
         chmod(dir + sep + file_name, S_IRWXU|S_IRGRP|S_IROTH)
     else:
+        file_name = expanduser(file_name)
         chmod(file_name, S_IRWXU|S_IRGRP|S_IROTH)
 
 




Related Messages


Powered by MHonArc, Updated Fri Feb 21 20:40:02 2014