本文整理汇总了Python中pgidocgen.repo.Repository.get_shadowed方法的典型用法代码示例。如果您正苦于以下问题:Python Repository.get_shadowed方法的具体用法?Python Repository.get_shadowed怎么用?Python Repository.get_shadowed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pgidocgen.repo.Repository
的用法示例。
在下文中一共展示了Repository.get_shadowed方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_glib
# 需要导入模块: from pgidocgen.repo import Repository [as 别名]
# 或者: from pgidocgen.repo.Repository import get_shadowed [as 别名]
def test_glib(self):
repo = Repository("GLib", "2.0")
mod = repo.parse()
klass = find(mod.pyclasses, "Error")
# GLib.io_add_watch points to g_io_add_watch_full and should
# also use its docs
func = find(mod.functions, "io_add_watch")
self.assertTrue(":param priority:" in func.signature_desc)
# we include a note containing the shadowed docs
self.assertTrue(func.info.shadowed_desc)
self.assertEqual(repo.get_shadowed("g_idle_add"), "g_idle_add_full")
self.assertEqual(repo.lookup_py_id("g_idle_add"), "GLib.idle_add")
self.assertEqual(repo.lookup_py_id("g_idle_add", shadowed=False), None)
klass = find(mod.enums, "BookmarkFileError")
self.assertEqual(klass.base, "GLib.Enum")
klass = find(mod.enums, "Enum")
self.assertEqual(klass.base, None)
klass = find(mod.flags, "FileTest")
self.assertEqual(klass.base, "GLib.Flags")
klass = find(mod.flags, "Flags")
self.assertEqual(klass.base, None)
struct = find(mod.structures, "MemVTable")
field = find(struct.fields, "realloc")
self.assertTrue("object" in field.type_desc)