當前位置: 首頁>>代碼示例>>Python>>正文


Python MavenArtifact.getGAT方法代碼示例

本文整理匯總了Python中maven_artifact.MavenArtifact.getGAT方法的典型用法代碼示例。如果您正苦於以下問題:Python MavenArtifact.getGAT方法的具體用法?Python MavenArtifact.getGAT怎麽用?Python MavenArtifact.getGAT使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在maven_artifact.MavenArtifact的用法示例。


在下文中一共展示了MavenArtifact.getGAT方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: _filterExcludedRepositories

# 需要導入模塊: from maven_artifact import MavenArtifact [as 別名]
# 或者: from maven_artifact.MavenArtifact import getGAT [as 別名]
    def _filterExcludedRepositories(self, artifactList):
        """
        Filter artifactList removing artifacts existing in specified repositories.

        :param artifactList: artifactList to be filtered.
        :returns: artifactList without arifacts that exists in specified repositories.
        """

        logging.debug("Filtering artifacts contained in excluded repositories.")

        pool = ThreadPool(maven_repo_util.MAX_THREADS)
        # Contains artifact to be removed
        delArtifacts = []
        for gat in artifactList.keys():
            groupId = gat.split(':')[0]
            artifactId = gat.split(':')[1]
            artifactType = gat.split(':')[2]
            for priority in artifactList[gat].keys():
                for version in artifactList[gat][priority].keys():
                    artifact = MavenArtifact(groupId, artifactId, artifactType, version)
                    pool.apply_async(
                        _artifactInRepos,
                        [self.config.excludedRepositories, artifact, priority, delArtifacts]
                    )
                if not artifactList[gat][priority]:
                    del artifactList[gat][priority]
            if not artifactList[gat]:
                del artifactList[gat]

        # Close the pool and wait for the workers to finnish
        pool.close()
        pool.join()
        for artifact, priority in delArtifacts:
            del artifactList[artifact.getGAT()][priority][artifact.version]

        return artifactList
開發者ID:VaclavDedik,項目名稱:maven-repository-builder,代碼行數:38,代碼來源:filter.py


注:本文中的maven_artifact.MavenArtifact.getGAT方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。