def listCASATasks(): """ Return a list of all the CASA tasks. Also report the difference between the task list in this module and the task list obtained from CASA. Note that the appropriate list will vary with the version of CASA. This function requires casapy module *tasks*. In casapy: >>> import extractCASAscript >>> taskList = extractCASAscript.listCASATasks() Review the difference between the task lists here... To update the task list in this module, >>> print taskList Then, copy-paste the output list into this module. THIS COULD BE AUTOMATED IF THE SCRIPT EXTRACTOR WAS RUN WITHIN CASAPY! THE CURRENT DESIGN ASSUMES THIS IS NOT THE CASE. """ from tasks import allcat all_tasks = [] for key in allcat.keys(): for taskname in allcat[key]: if (taskname[0] == '(') or (taskname[0] == '{'): taskname = taskname[1:-1] if (taskname in all_tasks) == False: all_tasks.append(taskname) all_tasks.sort() all_tasks_set = set(all_tasks) casa_tasks_set = set(casa_tasks) print "Tasks in casapy but not in this module: " + \ str(all_tasks_set.difference(casa_tasks_set)) print "Tasks in this module but not in casapy: " + \ str(casa_tasks_set.difference(all_tasks_set)) return all_tasks
def listCASATasks(): """ Return a list of all the CASA tasks. Also report the difference between the task list in this module and the task list obtained from CASA. Note that the appropriate list will vary with the version of CASA. This function requires casapy module *tasks*. In casapy: >>> import extractCASAscript >>> taskList = extractCASAscript.listCASATasks() Review the difference between the task lists here... To update the task list in this module, >>> print taskList Then, copy-paste the output list into this module. THIS COULD BE AUTOMATED IF THE SCRIPT EXTRACTOR WAS RUN WITHIN CASAPY! THE CURRENT DESIGN ASSUMES THIS IS NOT THE CASE. """ from tasks import allcat all_tasks=[] for key in allcat.keys(): for taskname in allcat[key]: if (taskname[0] == '(') or (taskname[0]=='{'): taskname = taskname[1:-1] if (taskname in all_tasks) == False: all_tasks.append(taskname) all_tasks.sort() all_tasks_set = set(all_tasks) casa_tasks_set = set(casa_tasks) print "Tasks in casapy but not in this module: " + \ str(all_tasks_set.difference(casa_tasks_set)) print "Tasks in this module but not in casapy: " + \ str(casa_tasks_set.difference(all_tasks_set)) return all_tasks