Source
518
518
if outfile=='': outfile=taskname+'.saved'
519
519
if(myf.has_key('__multibackup') and myf['__multibackup']):
520
520
backupoldfile(outfile)
521
521
522
522
##make sure unfolded parameters get their default values
523
523
myf['update_params'](func=myf['taskname'], printtext=False, ipython_globals=myf)
524
524
###
525
525
526
526
outpathdir = os.path.realpath(os.path.dirname(outfile))
527
527
outpathfile = outpathdir + os.path.sep + os.path.basename(outfile)
528
-
if do_save_inputs and outpathfile not in casa['state']['unwritable'] and outpathdir not in casa['state']['unwritable']:
528
+
# Note the casa['state']['unwritable'] - state in the global casa dict that can
529
+
# be initialized in previous function calls
530
+
do_save_inputs = (do_save_inputs and outpathfile not in casa['state']['unwritable']
531
+
and outpathdir not in casa['state']['unwritable'])
532
+
if do_save_inputs:
529
533
try:
530
534
taskparameterfile=open(outfile,'w')
531
535
print >>taskparameterfile, '%-15s = "%s"'%('taskname', taskname)
532
536
except:
533
537
do_save_inputs = False
534
538
print "********************************************************************************"
535
539
print "Warning: no write permission for %s, cannot save task" % outfile
536
540
if os.path.isfile(outfile):
537
541
print " inputs in %s..." % outpathfile
538
542
casa['state']['unwritable'].add(outpathfile)