# Path: repocribro/extending/helpers/views.py
# class ExtensionView:
#     """View object for extensions"""
#     def __init__(self, name, category, author,
#                  admin_url=None, home_url=None, gh_url=None):
#         self.name = name
#         self.category = category
#         self.author = author
#         self.admin_url = admin_url
#         self.home_url = home_url
#         self.gh_url = gh_url
# 
#     @staticmethod
#     def from_class(cls):
#         """Make view from Extension class"""
#         return ExtensionView(
#             getattr(cls, 'NAME', 'uknown'),
#             getattr(cls, 'CATEGORY', ''),
#             getattr(cls, 'AUTHOR', ''),
#             getattr(cls, 'ADMIN_URL', None),
#             getattr(cls, 'HOME_URL', None),
#             getattr(cls, 'GH_URL', None),
#         )


from .helpers import ExtensionView
        from ..security import create_default_role, reload_anonymous_role
        permissions = self.app.container.get('permissions')
        for role_name, role in self.provide_roles().items():
            permissions.register_role(role_name)
            create_default_role(self.app, self.db, role)
        reload_anonymous_role(self.app, self.db)
        for action_name in self.provide_actions():
            permissions.register_action(action_name)

    def init_template_vars(self):
        if not hasattr(self.app.config, 'dropdown_menu_items'):
            self.app.config.dropdown_menu_items = {}
        for route, title in self.provide_dropdown_menu_items().items():
            self.app.config.dropdown_menu_items[route] = title

    def introduce(self):
        """Hook operation for getting short introduction of extension (mostly
        for debug/log purpose)

        :return: Name of the extension
        :rtype: str
        """
        return getattr(self, 'NAME', 'unknown')

    def view_admin_extensions(self):
        """Hook operation for getting view model of the extension in order
        to show it in the administration of app

        :return: Extensions view for this extension
        :rtype: ``repocribro.extending.helpers.ExtensionView``
        """

# Path: repocribro/extending/helpers/views.py
# class ExtensionView:
#     """View object for extensions"""
#     def __init__(self, name, category, author,
#                  admin_url=None, home_url=None, gh_url=None):
#         self.name = name
#         self.category = category
#         self.author = author
#         self.admin_url = admin_url
#         self.home_url = home_url
#         self.gh_url = gh_url
# 
#     @staticmethod
#     def from_class(cls):
#         """Make view from Extension class"""
#         return ExtensionView(
#             getattr(cls, 'NAME', 'uknown'),
#             getattr(cls, 'CATEGORY', ''),
#             getattr(cls, 'AUTHOR', ''),
#             getattr(cls, 'ADMIN_URL', None),
#             getattr(cls, 'HOME_URL', None),
#             getattr(cls, 'GH_URL', None),
#         )


# Path: repocribro/extending/extension.py
from .helpers import ExtensionView
        from ..security import create_default_role, reload_anonymous_role

        permissions = self.app.container.get('permissions')
        for role_name, role in self.provide_roles().items():
            permissions.register_role(role_name)
            create_default_role(self.app, self.db, role)
        reload_anonymous_role(self.app, self.db)
        for action_name in self.provide_actions():
            permissions.register_action(action_name)

    def init_template_vars(self):
        if not hasattr(self.app.config, 'dropdown_menu_items'):
            self.app.config.dropdown_menu_items = {}
        for route, title in self.provide_dropdown_menu_items().items():
            self.app.config.dropdown_menu_items[route] = title

    def introduce(self):
        """Hook operation for getting short introduction of extension (mostly
        for debug/log purpose)

        :return: Name of the extension
        :rtype: str
        """
        return getattr(self, 'NAME', 'unknown')

    def view_admin_extensions(self):
        """Hook operation for getting view model of the extension in order
        to show it in the administration of app

        :return: Extensions view for this extension
        :rtype: ``repocribro.extending.helpers.ExtensionView``
        """

        return ExtensionView.from_class(self.__class__)