示例#1
0
    def _userdata(self):
        """
        Return the noticeboard user metadata.

        This dictionary contains misc noticeboard information for given
        repository, like (at the moment) items read status.

        @return: repository user metadata
        @rtype: dict
        @raise KeyError: if given repository identifier is not available
        """
        avail_data = self._settings['repositories']['available']
        nb_path = avail_data[self._repository_id]['local_notice_board']

        if not const_file_readable(nb_path):
            return {}  # not found

        return dump_loadobj(nb_path, complete_path=True) or {}
示例#2
0
    def _userdata(self):
        """
        Return the noticeboard user metadata.

        This dictionary contains misc noticeboard information for given
        repository, like (at the moment) items read status.

        @return: repository user metadata
        @rtype: dict
        @raise KeyError: if given repository identifier is not available
        """
        avail_data = self._settings['repositories']['available']
        nb_path = avail_data[self._repository_id]['local_notice_board']

        if not const_file_readable(nb_path):
            return {} # not found

        return dump_loadobj(nb_path, complete_path = True) or {}
示例#3
0
    def get_noticeboard_userdata(self, repository_id):
        """
        Return noticeboard user metadata dict for given repository identifier.
        This dictionary contains misc noticeboard information for given
        repository, like (at the moment) items read status.

        @param repository_id: repository identifier
        @type repository_id: string
        @return: repository user metadata
        @rtype: dict
        @raise KeyError: if given repository identifier is not available
        """
        repo_data = self._settings['repositories']['available'][repository_id]
        nb_path = repo_data['local_notice_board_userdata']

        if not const_file_readable(nb_path):
            return {} # not found

        # load metadata
        data = dump_loadobj(nb_path, complete_path = True) or {}
        return data