'Substitutes (via the format operator) the values in the specified
dictionary into the specified command.
The command can be an (action, string) tuple.  In all cases, we
perform substitution on strings and don\'t worry if something isn\'t
a string.  (It\'s probably a Python function to be executed.)'

def subst(self, string, dictionary=None):

    if (dictionary is None):
        dictionary = self._subst_dictionary
    if dictionary:
        try:
            string = (string % dictionary)
        except TypeError:
            pass
    return string
