def __init__(self, request):
        super(CMSToolbar, self).__init__()
        self.right_items = []
        self.left_items = []
        self.populated = False
        self.post_template_populated = False
        self.menus = {}
        self.obj = None
        self.redirect_url = None
        self.request = None
        self.is_staff = None
        self.edit_mode = None
        self.edit_mode_url_on = get_cms_setting('CMS_TOOLBAR_URL__EDIT_ON')
        self.edit_mode_url_off = get_cms_setting('CMS_TOOLBAR_URL__EDIT_OFF')
        self.disable_url = get_cms_setting('CMS_TOOLBAR_URL__DISABLE')
        self.build_mode = None
        self.use_draft = None
        self.show_toolbar = None
        self.login_form = None
        self.clipboard = None
        self.language = None
        self.toolbar_language = None
        self.simple_structure_mode = get_cms_setting('TOOLBAR_SIMPLE_STRUCTURE_MODE')
        self.show_toolbar = True
        self.init_toolbar(request)

        with force_language(self.language):
            try:
                decorator = resolve(self.request.path_info).func
                try:
                    # If the original view is decorated we try to extract the real function
                    # module instead of the decorator's one
                    if decorator and getattr(decorator, 'func_closure', False):
                        # python 2
                        self.app_name = decorator.func_closure[0].cell_contents.__module__
                    elif decorator and getattr(decorator, '__closure__', False):
                        # python 3
                        self.app_name = decorator.__closure__[0].cell_contents.__module__
                    else:
                        raise AttributeError()
                except (__HOLE__, AttributeError):
                    # no decorator
                    self.app_name = decorator.__module__
            except Resolver404:
                self.app_name = ""
        toolbars = toolbar_pool.get_toolbars()
        parts = self.app_name.split('.')
        while parts:
            path = '.'.join(parts)
            if path in installed_apps():
                self.app_name = path
                break
            parts.pop()

        self.toolbars = OrderedDict()
        for key in toolbars:
            toolbar = toolbars[key](self.request, self, toolbars[key].check_current_app(key, self.app_name), self.app_name)
            self.toolbars[key] = toolbar
dataset/ETHPy150Open divio/django-cms/cms/toolbar/toolbar.py/CMSToolbar.__init__