

def __new__(mcs, *args, **kwargs):
    "\n        Handles the url_map generation based on the rules from the base classes\n        Added to the class' own rules\n        "
    name = args[0]
    bases = args[1]
    members = args[2].copy()
    rules = members.get('rules', [])
    for base in (base for base in bases if hasattr(base, 'rules')):
        for base_rule in base.rules:
            if (not any((((base_rule.rule == rule.rule) and set(base_rule.methods).intersection(set(rule.methods))) for rule in rules))):
                rules.append(base_rule)
    url_map = members.get('url_map', Map())
    for rule in rules:
        url_map.add(Rule(rule.rule, methods=rule.methods, endpoint=rule.endpoint))
    members['rules'] = list(url_map.iter_rules())
    members['url_map'] = url_map
    return super(mcs, mcs).__new__(mcs, *(name, bases, members), **kwargs)

dataset/ETHPy150Open lvieirajr/mongorest/mongorest/resource.py ResourceMeta.__new__/original