本文整理汇总了Python中pyasm.search.SearchType.break_up_key方法的典型用法代码示例。如果您正苦于以下问题:Python SearchType.break_up_key方法的具体用法?Python SearchType.break_up_key怎么用?Python SearchType.break_up_key使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyasm.search.SearchType
的用法示例。
在下文中一共展示了SearchType.break_up_key方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: handle_columns_mode
# 需要导入模块: from pyasm.search import SearchType [as 别名]
# 或者: from pyasm.search.SearchType import break_up_key [as 别名]
def handle_columns_mode(my):
doc = my.xml.create_doc("config")
root = my.xml.get_root_node()
columns = my.get_columns()
if len(columns) == 1 and columns[0] == "id":
columns = my.get_columns(required_only=False)
# create the table
# search is a special view for SearchWdg and it should not be created
if my.view not in ['search','publish']:
if my.view.find('@') != -1:
table = my.xml.create_element('view', attrs={'name': my.view})
else:
table = my.xml.create_element(my.view)
my.xml.append_child(root, table)
for column in columns:
if column in ["_id", "id", "oid", "s_status"]:
continue
element = my.xml.create_element("element")
Xml.set_attribute(element, "name", column)
my.xml.append_child(table, element)
# add history, input and output for the load view (designed for app loading)
if my.view == 'load':
element = my.xml.create_element("element")
Xml.set_attribute(element, "name", "checkin")
my.xml.append_child(table, element)
for column in ['input', 'output']:
element = my.xml.create_element("element")
Xml.set_attribute(element, "name", column)
Xml.set_attribute(element, "edit", "false")
display_element = my.xml.create_element("display")
Xml.set_attribute(display_element, "class", "tactic.ui.cgapp.LoaderElementWdg")
my.xml.append_child(element, display_element)
stype, key = SearchType.break_up_key(my.search_type)
op1 = my.xml.create_text_element("search_type", stype)
op2 = my.xml.create_text_element("mode", column)
my.xml.append_child(display_element, op1)
my.xml.append_child(display_element, op2)
my.xml.append_child(table, element)
value = my.xml.to_string()
my.xml = Xml()
my.xml.read_string(value)