本文整理匯總了Python中maven_artifact.MavenArtifact.getGA方法的典型用法代碼示例。如果您正苦於以下問題:Python MavenArtifact.getGA方法的具體用法?Python MavenArtifact.getGA怎麽用?Python MavenArtifact.getGA使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類maven_artifact.MavenArtifact
的用法示例。
在下文中一共展示了MavenArtifact.getGA方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: _filterExcludedRepositories
# 需要導入模塊: from maven_artifact import MavenArtifact [as 別名]
# 或者: from maven_artifact.MavenArtifact import getGA [as 別名]
def _filterExcludedRepositories(self, artifactList):
"""
Filter artifactList removing artifacts existing in specified repositories.
:param artifactList: artifactList to be filtered.
:returns: artifactList without artifacts 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 ga in artifactList.keys():
groupId = ga.split(':')[0]
artifactId = ga.split(':')[1]
for priority in artifactList[ga].keys():
for version in artifactList[ga][priority].keys():
artifact = MavenArtifact(groupId, artifactId, "pom", version)
pool.apply_async(
_artifactInRepos,
[self.config.excludedRepositories, artifact, priority, delArtifacts]
)
# Close the pool and wait for the workers to finnish
pool.close()
pool.join()
for artifact, priority in delArtifacts:
ga = artifact.getGA()
logging.debug("Dropping GAV %s:%s from priority %i because it was found in an excluded repository.",
ga, artifact.version, priority)
del artifactList[ga][priority][artifact.version]
if not artifactList[ga][priority]:
logging.debug("Dropping GA %s from priority %i because of no version left.", ga, priority)
del artifactList[ga][priority]
if not artifactList[ga]:
logging.debug("Dropping GA %s because of no priority left.", ga)
del artifactList[ga]
return artifactList