(self, cmd, kind)
t.append(cmd, kind) adds a new step at the end.
t.append(cmd, kind) adds a new step at the end.
t . append ( cmd kind ) adds a new step at the end .
def append(self, cmd, kind):
        """t.append(cmd, kind) adds a new step at the end."""
        if not isinstance(cmd, str):
            raise TypeError('Template.append: cmd must be a string')
        if kind not in stepkinds:
            raise ValueError('Template.append: bad kind %r' % (kind,))
        if kind == SOURCE:
            raise ValueError('Template.append: SOURCE can only be prepended')
        if self.steps and self.steps[-1][1] == SINK:
            raise ValueError('Template.append: already ends with SINK')
        if kind[0] == 'f' and not re.search(r'\$IN\b', cmd):
            raise ValueError('Template.append: missing $IN in cmd')
        if kind[1] == 'f' and not re.search(r'\$OUT\b', cmd):
            raise ValueError('Template.append: missing $OUT in cmd')
        self.steps.append((cmd, kind))
def append ( self , cmd , kind ) : if not isinstance ( cmd , str ) : raise TypeError ( 'Template.append: cmd must be a string' ) if kind not in stepkinds : raise ValueError ( 'Template.append: bad kind %r' % ( kind , ) ) if kind == SOURCE : raise ValueError ( 'Template.append: SOURCE can only be prepended' ) if self . steps and self . steps [ - 1 ] [ 1 ] == SINK : raise ValueError ( 'Template.append: already ends with SINK' ) if kind [ 0 ] == 'f' and not re . search ( r'\$IN\b' , cmd ) : raise ValueError ( 'Template.append: missing $IN in cmd' ) if kind [ 1 ] == 'f' and not re . search ( r'\$OUT\b' , cmd ) : raise ValueError ( 'Template.append: missing $OUT in cmd' ) self . steps . append ( ( cmd , kind ) )