本文整理汇总了Python中pyasm.search.SearchType.set_global_template方法的典型用法代码示例。如果您正苦于以下问题:Python SearchType.set_global_template方法的具体用法?Python SearchType.set_global_template怎么用?Python SearchType.set_global_template使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyasm.search.SearchType
的用法示例。
在下文中一共展示了SearchType.set_global_template方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: set_templates
# 需要导入模块: from pyasm.search import SearchType [as 别名]
# 或者: from pyasm.search.SearchType import set_global_template [as 别名]
def set_templates(self):
project_code = WebContainer.get_web().get_full_context_name()
if project_code == "default":
project_code = Project.get_default_project()
try:
SearchType.set_global_template("project", project_code)
except SecurityException as e:
print("WARNING: ", e)
示例2: set_templates
# 需要导入模块: from pyasm.search import SearchType [as 别名]
# 或者: from pyasm.search.SearchType import set_global_template [as 别名]
def set_templates(my):
if my.context:
context = my.context
else:
context = WebContainer.get_web().get_full_context_name()
try:
SearchType.set_global_template("project", context)
except SecurityException, e:
print "WARNING: ", e
示例3: set_templates
# 需要导入模块: from pyasm.search import SearchType [as 别名]
# 或者: from pyasm.search.SearchType import set_global_template [as 别名]
def set_templates(my):
#if my.project_code:
# project_code = my.project_code
#else:
# project_code = WebContainer.get_web().get_full_context_name()
project_code = WebContainer.get_web().get_full_context_name()
if project_code == "default":
project_code = Project.get_default_project()
#if not project_code:
# project_code = my.project_code
try:
SearchType.set_global_template("project", project_code)
except SecurityException, e:
print "WARNING: ", e
示例4: set_templates
# 需要导入模块: from pyasm.search import SearchType [as 别名]
# 或者: from pyasm.search.SearchType import set_global_template [as 别名]
def set_templates(self):
context = WebContainer.get_web().get_full_context_name()
SearchType.set_global_template("project", context)