예제 #1
0
파일: qa.py 프로젝트: skwerlman/entropy
    def __init__(self, repository_id):
        """
        object constructor, repository_id must be a valid repository
        identifier.

        @param repository_id: valid repository identifier
        @type repository_id: string
        """
        super(UGCErrorReport, self).__init__("#fake#")

        self.__system_settings = SystemSettings()
        self._entropy = Client()
        if repository_id not in self.__system_settings['repositories']['order']:
            raise AttributeError('invalid repository_id provided')
        self.__repository_id = repository_id

        self._factory = self._entropy.WebServices()
        try:
            self._webserv = self._factory.new(self.__repository_id)
        except WebService.UnsupportedService:
            raise AttributeError('Web Services not supported by %s' % (
                self.__repository_id,))

        try:
            available = self._webserv.service_available()
        except WebService.WebServiceException:
            available = False

        if not available:
            raise AttributeError('Web Services not supported by %s (2)' % (
                self.__repository_id,))
예제 #2
0
파일: command.py 프로젝트: jgarte/entropy
 def _entropy_bashcomp(self):
     """
     Return an Entropy Client object that MUST
     be used only inside bashcomp methods.
     This object is faster to load than the standard
     Entropy object loaded by _entropy() at the cost
     of less consistency checks.
     """
     return Client(indexing=False, repo_validation=False)
예제 #3
0
파일: command.py 프로젝트: jgarte/entropy
 def _entropy(self, *args, **kwargs):
     """
     Return the Entropy Client object.
     This method is not thread safe.
     """
     return Client(*args, **kwargs)