HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //proc/1233/cwd/home/arjun/projects/env/lib/python3.10/site-packages/fontTools/subset/util.py
"""Private utility methods used by the subset modules"""


def _add_method(*clazzes):
    """Returns a decorator function that adds a new method to one or
    more classes."""

    def wrapper(method):
        done = []
        for clazz in clazzes:
            if clazz in done:
                continue  # Support multiple names of a clazz
            done.append(clazz)
            assert clazz.__name__ != "DefaultTable", "Oops, table class not found."
            assert not hasattr(
                clazz, method.__name__
            ), "Oops, class '%s' has method '%s'." % (clazz.__name__, method.__name__)
            setattr(clazz, method.__name__, method)
        return None

    return wrapper


def _uniq_sort(l):
    return sorted(set(l))