<?xml version="1.0"?>
<xsl:stylesheet version="2.0"
xmlns:aps="http://casa.nrao.edu/schema/psetTypes.html"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output omit-xml-declaration="yes"></xsl:output>
<xsl:param name="needscomma"/>
<xsl:param name="taskname"/>
<xsl:param name="paramname"/>
<xsl:param name="setme"/>
<xsl:param name="taskdescription"/>
<xsl:param name="unitsare"/>
<xsl:param name="arraytype"/>
<xsl:template match="*">
<xsl:apply-templates select="aps:task"/>
</xsl:template>
<xsl:template match="aps:task">
<xsl:param name="taskname"><xsl:value-of select="@name"/></xsl:param>
<xsl:param name="taskdescription"><xsl:value-of select="aps:shortdescription"/></xsl:param>
<xsl:text disable-output-escaping="yes">#
# This file was generated using xslt from its XML file
#
# Copyright 2014, Associated Universities Inc., Washington DC
#
import sys
import os
import datetime
#from casac import *
import casac
import string
import time
import inspect
import gc
import numpy
from casa_stack_manip import stack_frame_find
from odict import odict
from types import *
from task_</xsl:text><xsl:value-of select="$taskname"/> import <xsl:value-of select="$taskname"/>
<xsl:text>
class </xsl:text><xsl:value-of select="@name"/><xsl:text>_cli_:</xsl:text>
<xsl:text>
__name__ = "</xsl:text><xsl:value-of select="$taskname"/><xsl:text>"
rkey = None
i_am_a_casapy_task = None
# The existence of the i_am_a_casapy_task attribute allows help()
# (and other) to treat casapy tasks as a special case.
def __init__(self) :
self.__bases__ = (</xsl:text><xsl:value-of select="@name"/><xsl:text>_cli_,)
self.__doc__ = self.__call__.__doc__</xsl:text>
self.parameters=<xsl:text>{</xsl:text><xsl:apply-templates select="aps:input" mode="quotes"/>}
<xsl:text disable-output-escaping="yes">
def result(self, key=None):
#### and add any that have completed...
return None
</xsl:text>
def __call__<xsl:text>(self, </xsl:text><xsl:apply-templates select="aps:input" mode="noquotes"/>):
<xsl:text>
"""</xsl:text>
<xsl:apply-templates select="aps:shortdescription"></xsl:apply-templates>
<xsl:apply-templates select="aps:description"/>
<xsl:if test="aps:input">
<xsl:text>
Arguments :
</xsl:text>
</xsl:if>
<xsl:for-each select="aps:input">
<xsl:for-each select="aps:param">
<xsl:if test="not(@visibility) or @visibility!='hidden'">
<xsl:choose>
<xsl:when test="aps:description">
<xsl:text> </xsl:text><xsl:value-of select="@name"/><xsl:text>: </xsl:text><xsl:value-of select="aps:description" disable-output-escaping="yes"/>
</xsl:when>
<xsl:otherwise>
<xsl:text> </xsl:text><xsl:value-of select="@name"/><xsl:text>: </xsl:text><xsl:value-of select="aps:shortdescription" disable-output-escaping="yes"/>
</xsl:otherwise>
</xsl:choose>
<xsl:text>
</xsl:text>
<xsl:text> Default Value: </xsl:text><xsl:value-of select="aps:value"/>
<xsl:if test="aps:allowed">
<xsl:text>
Allowed Values:</xsl:text>
<xsl:for-each select="aps:allowed/aps:value">
<xsl:text>
</xsl:text><xsl:value-of select="."/>
</xsl:for-each>
</xsl:if>