Source code for shoop.admin.breadcrumbs

# -*- coding: utf-8 -*-
# This file is part of Shoop.
#
# Copyright (c) 2012-2016, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import unicode_literals

from django.utils.encoding import force_text
from django.utils.translation import ugettext_lazy as _

from shoop.admin.base import MenuEntry
from shoop.admin.module_registry import get_modules


def _get_admin_module_for_url(url_names):
    for module in get_modules():
        for url in module.get_urls():
            if url.name in url_names:
                return module