本文整理汇总了Python中pants.help.build_dictionary_info_extracter.BuildDictionaryInfoExtracter.get_object_info方法的典型用法代码示例。如果您正苦于以下问题:Python BuildDictionaryInfoExtracter.get_object_info方法的具体用法?Python BuildDictionaryInfoExtracter.get_object_info怎么用?Python BuildDictionaryInfoExtracter.get_object_info使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pants.help.build_dictionary_info_extracter.BuildDictionaryInfoExtracter
的用法示例。
在下文中一共展示了BuildDictionaryInfoExtracter.get_object_info方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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_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
}
})
示例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_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)
示例3: test_get_object_info
# 需要导入模块: from pants.help.build_dictionary_info_extracter import BuildDictionaryInfoExtracter [as 别名]
# 或者: from pants.help.build_dictionary_info_extracter.BuildDictionaryInfoExtracter import get_object_info [as 别名]
def test_get_object_info(self):
class Foo(object):
"""Foo docstring."""
def __init__(self, bar, baz=42):
"""
:param bar: Bar details.
:param int baz: Baz details.
"""
bfa = BuildFileAliases(targets={},
objects={
'foo': Foo
},
context_aware_object_factories={},
)
extracter = BuildDictionaryInfoExtracter(bfa)
self.assertEqual([BuildSymbolInfo('foo', 'Foo docstring.', [],
[FunctionArg('bar', 'Bar details.', False, None),
FunctionArg('baz', 'Baz details.', True, 42)])],
extracter.get_object_info())
示例4: test_get_object_info_datatype
# 需要导入模块: from pants.help.build_dictionary_info_extracter import BuildDictionaryInfoExtracter [as 别名]
# 或者: from pants.help.build_dictionary_info_extracter.BuildDictionaryInfoExtracter import get_object_info [as 别名]
def test_get_object_info_datatype(self):
class FooDatatype(datatype(['bar', 'baz'])):
"""Foo docstring."""
def __new__(cls, bar, baz=42):
"""
:param bar: Bar details.
:param int baz: Baz details.
"""
return super(FooDatatype, cls).__new__(cls, bar, baz)
bfa = BuildFileAliases(targets={},
objects={
'foo': FooDatatype
},
context_aware_object_factories={},
)
extracter = BuildDictionaryInfoExtracter(bfa)
self.assertEqual([BuildSymbolInfo('foo', 'Foo docstring.', [],
[FunctionArg('bar', 'Bar details.', False, None),
FunctionArg('baz', 'Baz details.', True, 42)])],
extracter.get_object_info())
示例5: test_get_object_info
# 需要导入模块: from pants.help.build_dictionary_info_extracter import BuildDictionaryInfoExtracter [as 别名]
# 或者: from pants.help.build_dictionary_info_extracter.BuildDictionaryInfoExtracter import get_object_info [as 别名]
def test_get_object_info(self):
class Foo(object):
"""Foo docstring."""
def __init__(self, bar, baz=42):
"""
:param bar: Bar details.
:param int baz: Baz details.
"""
bfa = BuildFileAliases(targets={}, objects={"foo": Foo}, context_aware_object_factories={})
extracter = BuildDictionaryInfoExtracter(bfa)
self.assertEquals(
[
BuildSymbolInfo(
"foo",
"Foo docstring.",
[FunctionArg("bar", "Bar details.", False, None), FunctionArg("baz", "Baz details.", True, 42)],
)
],
extracter.get_object_info(),
)
示例6: test_get_object_info_datatype
# 需要导入模块: from pants.help.build_dictionary_info_extracter import BuildDictionaryInfoExtracter [as 别名]
# 或者: from pants.help.build_dictionary_info_extracter.BuildDictionaryInfoExtracter import get_object_info [as 别名]
def test_get_object_info_datatype(self):
class FooDatatype(datatype("FooDatatype", ["bar", "baz"])):
"""Foo docstring."""
def __new__(cls, bar, baz=42):
"""
:param bar: Bar details.
:param int baz: Baz details.
"""
return super(Foo, cls).__new__(cls, bar, baz)
bfa = BuildFileAliases(targets={}, objects={"foo": FooDatatype}, context_aware_object_factories={})
extracter = BuildDictionaryInfoExtracter(bfa)
self.assertEquals(
[
BuildSymbolInfo(
"foo",
"Foo docstring.",
[FunctionArg("bar", "Bar details.", False, None), FunctionArg("baz", "Baz details.", True, 42)],
)
],
extracter.get_object_info(),
)