本文整理汇总了Python中anyblok.blok.BlokManager.has方法的典型用法代码示例。如果您正苦于以下问题:Python BlokManager.has方法的具体用法?Python BlokManager.has怎么用?Python BlokManager.has使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类anyblok.blok.BlokManager
的用法示例。
在下文中一共展示了BlokManager.has方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_load_anyblok
# 需要导入模块: from anyblok.blok import BlokManager [as 别名]
# 或者: from anyblok.blok.BlokManager import has [as 别名]
def test_load_anyblok(self):
BlokManager.load()
if not BlokManager.list():
self.fail('No blok load')
if not BlokManager.has('anyblok-core'):
self.fail("The blok 'anyblok-core' is missing")
BlokManager.get('anyblok-core')
示例2: add
# 需要导入模块: from anyblok.blok import BlokManager [as 别名]
# 或者: from anyblok.blok.BlokManager import has [as 别名]
def add(cls, blok):
""" Store the blok so that we know which bloks to reload if needed
:param blok: name of the blok to add
:rtype: loader instance
:exception: ImportManagerException
"""
from anyblok.blok import BlokManager
if cls.has(blok):
return cls.get(blok)
if not BlokManager.has(blok):
raise ImportManagerException("Unexisting blok")
loader = Loader(blok)
cls.modules[blok] = loader
return loader
示例3: test_set
# 需要导入模块: from anyblok.blok import BlokManager [as 别名]
# 或者: from anyblok.blok.BlokManager import has [as 别名]
def test_set(self):
blok_name = 'ABlok'
BlokManager.set(blok_name, Blok)
self.assertEqual(BlokManager.has(blok_name), True)
示例4: exist
# 需要导入模块: from anyblok.blok import BlokManager [as 别名]
# 或者: from anyblok.blok.BlokManager import has [as 别名]
def exist(self):
return BlokManager.has(self.blok.name)