mailr20187 - /trunk/lib/io.py


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

Header


Content

Posted by edward on June 18, 2013 - 10:00:
Author: bugman
Date: Tue Jun 18 10:00:50 2013
New Revision: 20187

URL: http://svn.gna.org/viewcvs/relax?rev=20187&view=rev
Log:
Fix for bug #20915, (https://gna.org/bugs/?20915) - Failure of Grace opening 
in MS Windows

Troels E. Linnet provided this patch, and was discovered during work on a 
Windows 7 system: telinnet
aaattt bio_dot_ku_dot_dk

This is a small fix for a wrong call to "raise 
RelaxMissingBinaryError(binary)", when issuing an
external call to xmgrace.

The "path_sep" would be equal = [\/], and the RE search would not find(True) 
the full path specified
for the xmgrace file.  This is now shifted to python: os.path.isfile
http://docs.python.org/2/library/os.path.html

Another fix, is that as a standard the command "xmgrace" is provided. This 
will work fine through
windows cmd, but the true name for program in windows is "xmgrace.exe", and 
so an additional search
for +".exe" is also performed. 


Modified:
    trunk/lib/io.py

Modified: trunk/lib/io.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/lib/io.py?rev=20187&r1=20186&r2=20187&view=diff
==============================================================================
--- trunk/lib/io.py (original)
+++ trunk/lib/io.py Tue Jun 18 10:00:50 2013
@@ -33,7 +33,7 @@
 # Python module imports.
 from os import devnull
 from os import F_OK, X_OK, access, altsep, getenv, makedirs, pathsep, 
remove, sep
-from os.path import expanduser, basename, splitext
+from os.path import expanduser, basename, splitext, isfile
 from re import search
 import sys
 from sys import stdin, stdout, stderr
@@ -718,7 +718,7 @@
         path_sep = sep
 
     # The full path of the program has been given (if a directory separatory 
has been supplied).
-    if search(path_sep, binary):
+    if isfile(binary):
         # Test that the binary exists.
         if not access(binary, F_OK):
             raise RelaxMissingBinaryError(binary)
@@ -737,7 +737,7 @@
 
         # Test that the binary exists within the system path (and exit this 
function instantly once it has been found).
         for path in path_list:
-            if access(path + sep + binary, F_OK):
+            if access(path + sep + binary, F_OK) or access(path + sep + 
binary +".exe", F_OK):
                 return
 
         # The binary is not located in the system path!




Related Messages


Powered by MHonArc, Updated Tue Jun 18 10:20:03 2013