本文整理汇总了Python中st2common.bootstrap.base.ResourceRegistrar.ALLOWED_EXTENSIONS方法的典型用法代码示例。如果您正苦于以下问题:Python ResourceRegistrar.ALLOWED_EXTENSIONS方法的具体用法?Python ResourceRegistrar.ALLOWED_EXTENSIONS怎么用?Python ResourceRegistrar.ALLOWED_EXTENSIONS使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类st2common.bootstrap.base.ResourceRegistrar
的用法示例。
在下文中一共展示了ResourceRegistrar.ALLOWED_EXTENSIONS方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: ResourceRegistrar
# 需要导入模块: from st2common.bootstrap.base import ResourceRegistrar [as 别名]
# 或者: from st2common.bootstrap.base.ResourceRegistrar import ALLOWED_EXTENSIONS [as 别名]
from st2common.content.loader import ContentPackLoader
from st2common.content.loader import MetaLoader
from st2common.bootstrap.base import ResourceRegistrar
import st2common.content.utils as content_utils
from st2common.models.api.action import ActionAPI
from st2common.models.api.sensor import SensorTypeAPI
from st2common.models.api.rule import RuleAPI
from st2common.models.db import db_setup
from st2common.models.db import db_teardown
from st2common.models.system.common import ResourceReference
from st2common.persistence.rule import Rule
from st2common.persistence.sensor import SensorType
from st2common.persistence.action import Action
registrar = ResourceRegistrar()
registrar.ALLOWED_EXTENSIONS = [".yaml", ".yml", ".json"]
meta_loader = MetaLoader()
API_MODELS_ARTIFACT_TYPES = {"actions": ActionAPI, "sensors": SensorTypeAPI, "rules": RuleAPI}
API_MODELS_PERSISTENT_MODELS = {Action: ActionAPI, SensorType: SensorTypeAPI, Rule: RuleAPI}
def do_register_cli_opts(opts, ignore_errors=False):
for opt in opts:
try:
cfg.CONF.register_cli_opt(opt)
except:
if not ignore_errors:
raise
示例2: ResourceRegistrar
# 需要导入模块: from st2common.bootstrap.base import ResourceRegistrar [as 别名]
# 或者: from st2common.bootstrap.base.ResourceRegistrar import ALLOWED_EXTENSIONS [as 别名]
from st2common.content.loader import ContentPackLoader
from st2common.content.loader import MetaLoader
from st2common.bootstrap.base import ResourceRegistrar
import st2common.content.utils as content_utils
from st2common.models.api.action import ActionAPI
from st2common.models.api.sensor import SensorTypeAPI
from st2common.models.api.rule import RuleAPI
from st2common.service_setup import db_setup
from st2common.service_setup import db_teardown
from st2common.models.system.common import ResourceReference
from st2common.persistence.rule import Rule
from st2common.persistence.sensor import SensorType
from st2common.persistence.action import Action
registrar = ResourceRegistrar()
registrar.ALLOWED_EXTENSIONS = ['.yaml', '.yml', '.json']
meta_loader = MetaLoader()
API_MODELS_ARTIFACT_TYPES = {
'actions': ActionAPI,
'sensors': SensorTypeAPI,
'rules': RuleAPI
}
API_MODELS_PERSISTENT_MODELS = {
Action: ActionAPI,
SensorType: SensorTypeAPI,
Rule: RuleAPI
}