当前位置: 首页>>代码示例>>Python>>正文


Python Target.identify方法代码示例

本文整理汇总了Python中twitter.pants.base.target.Target.identify方法的典型用法代码示例。如果您正苦于以下问题:Python Target.identify方法的具体用法?Python Target.identify怎么用?Python Target.identify使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在twitter.pants.base.target.Target的用法示例。


在下文中一共展示了Target.identify方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: replace_targets

# 需要导入模块: from twitter.pants.base.target import Target [as 别名]
# 或者: from twitter.pants.base.target.Target import identify [as 别名]
 def replace_targets(self, target_roots):
   """Replaces all targets in the context with the given roots and their transitive
   dependencies.
   """
   self._target_roots = target_roots
   self._targets = OrderedSet()
   for target in target_roots:
     self.add_target(target)
   self.id = Target.identify(self._targets)
开发者ID:bonifaido,项目名称:commons,代码行数:11,代码来源:context.py

示例2: calculate_sources

# 需要导入模块: from twitter.pants.base.target import Target [as 别名]
# 或者: from twitter.pants.base.target.Target import identify [as 别名]
  def calculate_sources(self, targets):
    sources = defaultdict(set)
    def collect_sources(target):
      src = (os.path.join(target.target_base, source)
             for source in target.sources if source.endswith('.java'))
      if src:
        sources[target].update(src)

    for target in targets:
      collect_sources(target)
    return sources, Target.identify(targets)
开发者ID:wickman,项目名称:commons,代码行数:13,代码来源:java_compile.py

示例3: _process_target_partition

# 需要导入模块: from twitter.pants.base.target import Target [as 别名]
# 或者: from twitter.pants.base.target.Target import identify [as 别名]
  def _process_target_partition(self, vts, cp):
    sources_by_target = self._compute_sources_by_target(vts.targets)
    sources = list(itertools.chain.from_iterable(sources_by_target.values()))
    fingerprint = Target.identify(vts.targets)

    if not sources:
      self.context.log.warn('Skipping java compile for targets with no sources:\n  %s' % vts.targets)
    else:
      # Do some reporting.
      self.context.log.info(
        'Operating on a partition containing ',
        items_to_report_element(vts.cache_key.sources, 'source'),
        ' in ',
        items_to_report_element([t.address.reference() for t in vts.targets], 'target'), '.')
      classpath = [jar for conf, jar in cp if conf in self._confs]
      result = self.compile(classpath, sources, fingerprint, self._depfile)
      if result != 0:
        default_message = 'Unexpected error - %s returned %d' % (_JMAKE_MAIN, result)
        raise TaskError(_JMAKE_ERROR_CODES.get(result, default_message))
    return sources_by_target
开发者ID:bollwang,项目名称:commons,代码行数:22,代码来源:java_compile.py


注:本文中的twitter.pants.base.target.Target.identify方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。