Author: bugman
Date: Fri Dec 19 19:31:23 2014
New Revision: 27148

URL: http://svn.gna.org/viewcvs/relax?rev=27148&view=rev
Log:
Updated the gnuplot scripts to be executable.

These are the scripts created by the gnuplot specific correlation_matrix() 
plotting API function.
The file is made executable and the script now starts with "#!/usr/bin/env 
gnuplot".


Modified:
    trunk/lib/plotting/gnuplot.py
    trunk/test_suite/system_tests/structure.py

Modified: trunk/lib/plotting/gnuplot.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/lib/plotting/gnuplot.py?rev=27148&r1=27147&r2=27148&view=diff
==============================================================================
--- trunk/lib/plotting/gnuplot.py       (original)
+++ trunk/lib/plotting/gnuplot.py       Fri Dec 19 19:31:23 2014
@@ -22,8 +22,12 @@
 # Module docstring.
 """Module for data plotting using gnuplot."""
 
+# Python module imports.
+from os import chmod
+from stat import S_IRWXU, S_IRGRP, S_IROTH
+
 # relax module imports.
-from lib.io import file_root, open_write_file, swap_extension
+from lib.io import file_root, get_file_path, open_write_file, swap_extension
 from lib.plotting import text
 
 
@@ -51,6 +55,10 @@
 
     # Open the script file for writing.
     output = open_write_file(file_name, dir=dir, force=force)
+
+    # Gnuplot script setup. 
+    output.write("#!/usr/bin/env gnuplot\n\n")
+
 
     # Set up the terminal type and make the plot square.
     output.write("# Set up the terminal type and make the plot square.\n")
@@ -87,6 +95,9 @@
     # Close the file.
     output.close()
 
+    # Make the script executable.
+    chmod(get_file_path(file_name=file_name, dir=dir), S_IRWXU|S_IRGRP|S_IROTH)
+
 
 def format_enhanced(text):
     """Convert and return the text to handle enhanced postscript.

Modified: trunk/test_suite/system_tests/structure.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/test_suite/system_tests/structure.py?rev=27148&r1=27147&r2=27148&view=diff
==============================================================================
--- trunk/test_suite/system_tests/structure.py  (original)
+++ trunk/test_suite/system_tests/structure.py  Fri Dec 19 19:31:23 2014
@@ -415,6 +415,8 @@
 
         # Check the gnuplot file.
         script = [
+            "#!/usr/bin/env gnuplot\n",
+            "\n",
             "# Set up the terminal type and make the plot square.\n",
             "set terminal postscript eps size 10,10 enhanced color font 
'Helvetica,20' linewidth 0.1\n",
             "set size square\n",


_______________________________________________
relax (http://www.nmr-relax.com)

This is the relax-commits mailing list
relax-commits@gna.org

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

Reply via email to