Esempio n. 1
0
    def _read_views(self, view_list):
        """
        Translate the view list received in the descriptor into the one
        understood by the views loader.
        Add any extra, built-in views with the `_add_builtin_views` method.

        :param view_list: list of tuples of avalaible views, each consists
        of view name and view callable preparator.
        """
        skin = self.config['skin']
        speller_layout = self.config['speller']['layout']
        layout = 'default'
        if self.app_name in ['speller', 'blog', 'email']:
            layout = speller_layout
        if self._configuration:
            special_layout = self._configuration.get("layout")
            if special_layout:
                layout = special_layout
        layout = '_'.join([layout, skin])
        self.views = {}
        for view_name, preparator in view_list:
            self.views[os.path.join(self.app_name,
                                    view_name)] = (dirs.get_json_path(
                                        view_name, layout,
                                        self.app_name), preparator)
        self._add_builtin_views(self.views, layout)
Esempio n. 2
0
    def _read_views(self, view_list):
        """
        Translate the view list received in the descriptor into the one
        understood by the views loader.
        Add any extra, built-in views with the `_add_builtin_views` method.

        :param view_list: list of tuples of avalaible views, each consists
        of view name and view callable preparator.
        """
        skin = self.config['skin']
        speller_layout = self.config['speller']['layout']
        layout = 'default'
        if self.app_name in ['speller', 'blog', 'email']:
            layout = speller_layout
        if self._configuration:
            special_layout = self._configuration.get("layout")
            if special_layout:
                layout = special_layout
        layout = '_'.join([layout, skin])
        self.views = {}
        for view_name, preparator in view_list:
            self.views[os.path.join(self.app_name, view_name)] = (
                dirs.get_json_path(view_name, layout, self.app_name), preparator
            )
        self._add_builtin_views(self.views, layout)
Esempio n. 3
0
 def _init_content(self):
     self.set_layout_manager(Clutter.BinLayout())
     json = dirs.get_json_path('loading_screen', '_'.join(
         ['default', pisak.config['skin']]))
     script = Clutter.Script()
     script.load_from_file(json)
     main = script.get_object('main')
     self.add_actor(main)
Esempio n. 4
0
 def _init_content(self):
     self.set_layout_manager(Clutter.BinLayout())
     json = dirs.get_json_path('loading_screen',
                               '_'.join(['default', pisak.config['skin']]))
     script = Clutter.Script()
     script.load_from_file(json)
     main = script.get_object('main')
     self.add_actor(main)
Esempio n. 5
0
    def _read_views(self, app_name, view_list):
        """
        Translate the view list received in the descriptor into the one
        understood by the views loader.
        Add any extra, built-in views with the `_add_builtin_views` method.

        :param app_name: name of the current application.
        :param view_list: list of tuples of avalaible views, each consists
        of view name and view callable preparator.
        """
        layout = 'default'
        if self._configuration:
            layout = self._configuration.get("layout")
        self.views = {}
        for view_name, preparator in view_list:
            self.views[os.path.join(app_name, view_name)] = (
                dirs.get_json_path(view_name, layout, app_name), preparator
            )
        self._add_builtin_views(self.views, layout)
Esempio n. 6
0
    def _read_views(self, app_name, view_list):
        """
        Translate the view list received in the descriptor into the one
        understood by the views loader.
        Add any extra, built-in views with the `_add_builtin_views` method.

        :param app_name: name of the current application.
        :param view_list: list of tuples of avalaible views, each consists
        of view name and view callable preparator.
        """
        layout = 'default'
        if self._configuration:
            layout = self._configuration.get("layout")
        self.views = {}
        for view_name, preparator in view_list:
            self.views[os.path.join(app_name,
                                    view_name)] = (dirs.get_json_path(
                                        view_name, layout,
                                        app_name), preparator)
        self._add_builtin_views(self.views, layout)
Esempio n. 7
0
 def _add_builtin_views(self, views_dict, layout):
     for view_name, preparator in BUILTIN_VIEWS:
         views_dict[view_name] = (dirs.get_json_path(view_name,
                                                     layout), preparator)
Esempio n. 8
0
 def _add_builtin_views(self, views_dict, layout):
     for view_name, preparator in BUILTIN_VIEWS:
         views_dict[view_name] = (
             dirs.get_json_path(view_name, layout), preparator)