本文整理汇总了Python中hydeengine.siteinfo.SiteInfo.find_node方法的典型用法代码示例。如果您正苦于以下问题:Python SiteInfo.find_node方法的具体用法?Python SiteInfo.find_node怎么用?Python SiteInfo.find_node使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类hydeengine.siteinfo.SiteInfo
的用法示例。
在下文中一共展示了SiteInfo.find_node方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_filters
# 需要导入模块: from hydeengine.siteinfo import SiteInfo [as 别名]
# 或者: from hydeengine.siteinfo.SiteInfo import find_node [as 别名]
def test_filters(self):
site = SiteInfo(settings, TEST_SITE.path)
for name in [".banjo", ".hidden", "junk.abc~"]:
f = File(site.content_folder.child(name))
self.files.append(f)
f.write("junk")
git = site.content_folder.child_folder(".git")
git_child = git.child_folder("child")
git_child_pack = File(git_child.child("pack"))
git.make()
git_child.make()
git_index = File(git.child("index"))
git_index.write("junk")
git_child_pack.write("junk")
original_exclude = settings.FILTER['exclude']
original_include = settings.FILTER['include']
settings.FILTER = {}
site = SiteInfo(settings, TEST_SITE.path)
site.refresh()
for f in self.files:
assert site.find_resource(f)
assert site.find_node(git)
assert site.find_resource(git_index)
assert site.find_node(git_child)
assert site.find_resource(git_child_pack)
settings.FILTER = {
'include': (),
'exclude': (".*","*~")
}
site = SiteInfo(settings, TEST_SITE.path)
site.refresh()
for f in self.files:
assert not site.find_resource(f)
assert not site.find_node(git)
assert not site.find_resource(git_index)
assert not site.find_node(git_child)
assert not site.find_resource(git_child_pack)
settings.FILTER = {
'include': (".banjo",),
'exclude': (".*","*~")
}
site = SiteInfo(settings, TEST_SITE.path)
site.refresh()
for f in self.files:
if f.name == ".banjo":
assert site.find_resource(f)
else:
assert not site.find_resource(f)
assert not site.find_node(git)
assert not site.find_resource(git_index)
settings.FILTER['exclude'] = original_exclude
settings.FILTER['include'] = original_include
self.files.append(git)