@staticmethod
    def get_layout(name):
        """
            Check whether the current theme has a custom layout for this
            class, and if so, store it in current.layouts

            @param: the name of the custom layout
            @return: the layout or None if not present
        """

        if hasattr(current, "layouts"):
            layouts = current.layouts
        else:
            layouts = {}
        if layouts is False:
            return None
        if name in layouts:
            return layouts[name]

        # Try to find custom layout in theme
        application = current.request.application
        settings = current.deployment_settings
        theme = settings.get_theme()
        theme_location = current.response.s3.theme_location
        if theme_location:
            theme_location = "%s." % theme_location[:-1]
        package = "applications.%s.modules.templates.%s%s.layouts" % \
                  (application, theme_location, theme)
        try:
            override = getattr(__import__(package, fromlist=[name]), name)
        except ImportError:
            # No layouts in theme - no point to try again
            current.layouts = False
            return None
        except AttributeError:
            override = None

        if override and \
           hasattr(override, "layout") and \
           type(override.layout) == type(lambda:None):
            layout = override.layout
        else:
            layout = None

        layouts[name] = layout
        current.layouts = layouts

        return layout

    # -------------------------------------------------------------------------
dataset/ETHPy150Open sahana/eden/modules/s3/s3navigation.py/S3NavigationItem.get_layout/original