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


Python BuildDictionaryInfoExtracter.get_object_factory_info方法代码示例

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


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

示例1: _gen_build_dictionary

# 需要导入模块: from pants.help.build_dictionary_info_extracter import BuildDictionaryInfoExtracter [as 别名]
# 或者: from pants.help.build_dictionary_info_extracter.BuildDictionaryInfoExtracter import get_object_factory_info [as 别名]
 def _gen_build_dictionary(self):
   buildfile_aliases = self.context.build_file_parser.registered_aliases()
   extracter = BuildDictionaryInfoExtracter(buildfile_aliases)
   target_type_infos = extracter.get_target_type_info()
   other_infos = sorted(extracter.get_object_info() + extracter.get_object_factory_info())
   self._do_render(self.get_options().build_dictionary_template, {
     'target_types': {
       'infos': target_type_infos
     },
     'other_symbols': {
       'infos': other_infos
     }
   })
开发者ID:CaitieM20,项目名称:pants,代码行数:15,代码来源:generate_pants_reference.py

示例2: _gen_build_dictionary

# 需要导入模块: from pants.help.build_dictionary_info_extracter import BuildDictionaryInfoExtracter [as 别名]
# 或者: from pants.help.build_dictionary_info_extracter.BuildDictionaryInfoExtracter import get_object_factory_info [as 别名]
  def _gen_build_dictionary(self):
    buildfile_aliases = self.context.build_configuration.registered_aliases()
    extracter = BuildDictionaryInfoExtracter(buildfile_aliases)
    target_type_infos = extracter.get_target_type_info()
    other_infos = sorted(extracter.get_object_info() + extracter.get_object_factory_info())

    build_dict_page = self._do_render(self.get_options().build_dictionary_template, {
      'target_types': {
        'infos': target_type_infos
      },
      'other_symbols': {
        'infos': other_infos
      }
    })
    self.context.products.register_data(self.BUILD_DICTIONARY_PRODUCT, build_dict_page)
开发者ID:cosmicexplorer,项目名称:pants,代码行数:17,代码来源:generate_pants_reference.py

示例3: test_get_object_factory_info

# 需要导入模块: from pants.help.build_dictionary_info_extracter import BuildDictionaryInfoExtracter [as 别名]
# 或者: from pants.help.build_dictionary_info_extracter.BuildDictionaryInfoExtracter import get_object_factory_info [as 别名]
  def test_get_object_factory_info(self):
    class Foo(object):
      """Foo docstring."""

      def __call__(self, bar, baz=42):
        """
        :param bar: Bar details.
        :param int baz: Baz details.
        """

    bfa = BuildFileAliases(targets={},
      objects={},
      context_aware_object_factories={
        'foo': Foo
      }
    )
    extracter = BuildDictionaryInfoExtracter(bfa)
    self.assertEqual([BuildSymbolInfo('foo', 'Foo docstring.', [],
                                       [FunctionArg('bar', 'Bar details.', False, None),
                                        FunctionArg('baz', 'Baz details.', True, 42)])],
                      extracter.get_object_factory_info())
开发者ID:cosmicexplorer,项目名称:pants,代码行数:23,代码来源:test_build_dictionary_info_extracter.py


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