mailr20219 - /branches/relax_disp/lib/software/grace.py


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

Header


Content

Posted by edward on June 19, 2013 - 16:25:
Author: bugman
Date: Wed Jun 19 16:25:32 2013
New Revision: 20219

URL: http://svn.gna.org/viewcvs/relax?rev=20219&view=rev
Log:
Updated the grace2images.py scripts created by the 
relax_disp.plot_disp_curves user function.

This was discussed in bug #20916 (https://gna.org/bugs/?20916) and the change 
suggested in the post
http://thread.gmane.org/gmane.science.nmr.relax.devel/3953/focus=4000.

Improved that both small and big letters for image types can be used on the 
command line. 


Modified:
    branches/relax_disp/lib/software/grace.py

Modified: branches/relax_disp/lib/software/grace.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/relax_disp/lib/software/grace.py?rev=20219&r1=20218&r2=20219&view=diff
==============================================================================
--- branches/relax_disp/lib/software/grace.py (original)
+++ branches/relax_disp/lib/software/grace.py Wed Jun 19 16:25:32 2013
@@ -91,21 +91,24 @@
     file.write("for grace in gracefiles:\n")
     file.write("    # Get the filename without extension\n")
     file.write("    fname = grace.split(\".agr\")[0]\n")
-    file.write("    if \"PNG\" in types:\n")
+    file.write("    if (\"PNG\" in types or \".PNG\" in types or \"png\" in 
types or \".png\" in types):\n")
     file.write("        # Produce the argument string\n")
     file.write("        im_args = r\"xmgrace -hdevice PNG -hardcopy -param 
%s -printfile %s.png %s\"%(pngpar,fname,grace)\n")
     file.write("        # Split the arguments the right way, to call 
xmgrace\n")
     file.write("        im_args = shlex.split(im_args)\n")
     file.write("        return_code = subprocess.call(im_args)\n")
-    file.write("    if \"EPS\" in types:\n")
+    file.write("    if (\"EPS\" in types or \".EPS\" in types or \"eps\" in 
types or \".eps\" in types):\n")
     file.write("        im_args = r\"xmgrace -hdevice EPS -hardcopy 
-printfile %s.eps %s\"%(fname,grace)\n")
     file.write("        im_args = shlex.split(im_args)\n")
     file.write("        return_code = subprocess.call(im_args)\n")
-    file.write("    if (\"JPG\" or \"JPEG\") in types:\n")
+    file.write("    if (\"JPG\" in types or \".JPG\" in types or \"jpg\" in 
types or \".jpg\" in types):\n")
     file.write("        im_args = r\"xmgrace -hdevice JPEG -hardcopy 
-printfile %s.jpg %s\"%(fname,grace)\n")
     file.write("        im_args = shlex.split(im_args)\n")
+    file.write("    if (\"JPEG\" in types or \".JPEG\" in types or \"jpeg\" 
in types or \".jpeg\" in types):\n")
+    file.write("        im_args = r\"xmgrace -hdevice JPEG -hardcopy 
-printfile %s.jpg %s\"%(fname,grace)\n")
+    file.write("        im_args = shlex.split(im_args)\n")
     file.write("        return_code = subprocess.call(im_args)\n")
-    file.write("    if \"SVG\" in types:\n")
+    file.write("    if (\"SVG\" in types or \".SVG\" in types or \"svg\" in 
types or \".svg\" in types):\n")
     file.write("        im_args = r\"xmgrace -hdevice SVG -hardcopy 
-printfile %s.svg %s\"%(fname,grace)\n")
     file.write("        im_args = shlex.split(im_args)\n")
     file.write("        return_code = subprocess.call(im_args)\n")




Related Messages


Powered by MHonArc, Updated Wed Jun 19 19:40:02 2013