'Internal function.'

def _configure(self, cmd, cnf, kw):

    if kw:
        cnf = _cnfmerge((cnf, kw))
    elif cnf:
        cnf = _cnfmerge(cnf)
    if (cnf is None):
        cnf = {}
        for x in self.tk.split(self.tk.call(_flatten((self._w, cmd)))):
            cnf[x[0][1:]] = ((x[0][1:],) + x[1:])
        return cnf
    if (type(cnf) is StringType):
        x = self.tk.split(self.tk.call(_flatten((self._w, cmd, ('-' + cnf)))))
        return ((x[0][1:],) + x[1:])
    self.tk.call((_flatten((self._w, cmd)) + self._options(cnf)))
