- Timestamp:
- Apr 15, 2013, 11:58:21 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/source/anuga_validation_tests/produce_results.py
r8754 r8825 4 4 5 5 import os 6 import time 7 6 8 import anuga 7 import time8 9 from anuga import indent 9 10 #--------------------------------11 # Get Default values for12 # algorithm parameters.13 #--------------------------------14 10 from parameters import alg 15 11 from parameters import cfl … … 26 22 try: 27 23 # This works when using git on unix 28 minor_revision =os.popen("git show-ref --head -s | head -n1").read().strip()24 minor_revision = os.popen("git show-ref --head -s | head -n1").read().strip() 29 25 except: 30 26 # This is a fallback position 31 minor_revision ='unknown'27 minor_revision = 'unknown' 32 28 33 29 #--------------------------------- … … 37 33 38 34 Upper_dirs = os.listdir('.') 35 dir = '.' 36 Upper_dirs = [name for name in os.listdir(dir) if os.path.isdir(os.path.join(dir, name))] 37 39 38 40 39 try: 41 40 Upper_dirs.remove('.svn') 42 41 Upper_dirs.remove('utilities') 43 42 except ValueError: 44 43 pass 44 45 45 46 46 47 #print Upper_dirs … … 56 57 print indent + dir 57 58 #print 'Changing to', os.getcwd() 58 Lower_dirs = os.listdir('.') 59 dir = '.' 60 Lower_dirs = [name for name in os.listdir(dir) if os.path.isdir(os.path.join(dir, name))] 59 61 try: 60 62 Lower_dirs.remove('.svn') … … 65 67 os.chdir(l_dir) 66 68 #print os.getcwd() 67 print 2 *indent + l_dir69 print 2 * indent + l_dir 68 70 try: 69 71 cmd = 'python produce_results.py' 70 print 3 *indent + 'Running: '+cmd71 os.system( cmd)72 print 3 * indent + 'Running: ' + cmd 73 os.system(cmd) 72 74 except: 73 print 3 *indent + 'Failed running produce_results in '+os.getcwd()75 print 3 * indent + 'Failed running produce_results in ' + os.getcwd() 74 76 pass 75 77 … … 80 82 #print 'Changing to', os.getcwd() 81 83 82 os.chdir( '..')84 os.chdir(buildroot) 83 85 #---------------------------------- 84 86 # Now it is ok to create the latex … … 86 88 #---------------------------------- 87 89 88 f = open('saved_parameters.tex', 'w')90 f = open('saved_parameters.tex', 'w') 89 91 f.write('\\newcommand{\\cfl}{\\UScore{%s}}\n' % str(cfl)) 90 92 f.write('\\newcommand{\\alg}{\\UScore{%s}}\n' % str(alg)) … … 96 98 97 99 100 import os 101 102 os.system('python produce_report.py') 98 103 cmd = 'pdflatex -shell-escape -interaction=batchmode report.tex' 99 print cmd 104 #print cmd 105 #import subprocess 106 #subprocess.call([cmd], shell=True) 107 100 108 import subprocess 101 subprocess.call( [cmd], shell=True )102 109 cmd = 'mv report.pdf report_cfl_%s_alg_%s.pdf' % (str(cfl), str(alg)) 103 110 print cmd 104 subprocess.call( [cmd] , shell=True)111 subprocess.call([cmd], shell=True) 105 112 106 113
Note: See TracChangeset
for help on using the changeset viewer.