

def diff_map(self, inlanguages):
    'Generate SQL to transform existing languages\n\n        :param input_map: a YAML map defining the new languages\n        :return: list of SQL statements\n\n        Compares the existing language definitions, as fetched from the\n        catalogs, to the input map and generates SQL statements to\n        transform the languages accordingly.\n        '
    stmts = []
    for lng in inlanguages:
        inlng = inlanguages[lng]
        if (lng in self):
            if (not hasattr(inlng, '_ext')):
                stmts.append(self[lng].diff_map(inlng))
        elif hasattr(inlng, 'oldname'):
            oldname = inlng.oldname
            try:
                stmts.append(self[oldname].rename(inlng.name))
                del self[oldname]
            except KeyError as exc:
                exc.args = (("Previous name '%s' for language '%s' not found" % (oldname, inlng.name)),)
                raise
        else:
            stmts.append(inlng.create())
    for lng in self:
        if (lng not in inlanguages):
            if ((self.dbconn.version >= 90000) and (self[lng].name == 'plpgsql')):
                continue
            self[lng].dropped = True
    return inlanguages

dataset/ETHPy150Open perseas/Pyrseas/pyrseas/dbobject/language.py LanguageDict.diff_map/VarMisuse@221/406 `stmts`->`inlanguages`