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