本文整理汇总了Python中tactic.ui.input.TextInputWdg.add_color方法的典型用法代码示例。如果您正苦于以下问题:Python TextInputWdg.add_color方法的具体用法?Python TextInputWdg.add_color怎么用?Python TextInputWdg.add_color使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tactic.ui.input.TextInputWdg
的用法示例。
在下文中一共展示了TextInputWdg.add_color方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_display
# 需要导入模块: from tactic.ui.input import TextInputWdg [as 别名]
# 或者: from tactic.ui.input.TextInputWdg import add_color [as 别名]
def get_display(self):
top = self.top
self.set_as_panel(top)
top.add_class("spt_ingestion_top")
top.add_color("background", "background", -5)
self.data = {}
rules_div = DivWdg()
top.add(rules_div)
rules_div.add_style("padding: 10px")
rules_div.add("Rules: ")
rules_select = SelectWdg("rule_code")
rule_code = self.get_value('rule_code')
if rule_code:
rules_select.set_value(rule_code)
rules_select.set_option("query", "config/ingest_rule|code|title")
rules_select.add_empty_option("-- New --")
rules_div.add(rules_select)
rules_select.add_behavior( {
'type': 'change',
'cbjs_action': '''
var top = bvr.src_el.getParent(".spt_ingestion_top");
value = bvr.src_el.value;
var class_name = 'tactic.ui.tools.IngestionToolWdg';
spt.panel.load(top, class_name, {rule_code: value} );
'''
} )
rules_div.add("<hr/>")
# read from the database
if rule_code:
search = Search("config/ingest_rule")
search.add_filter("code", rule_code)
sobject = search.get_sobject()
else:
sobject = None
if sobject:
self.data = sobject.get_value("data")
if self.data:
self.data = jsonloads(self.data)
session_code = self.kwargs.get("session_code")
if session_code:
session = Search.get_by_code("config/ingest_session", session_code)
else:
if sobject:
session = sobject.get_related_sobject("config/ingest_session")
print("sobject: ", sobject.get_code(), sobject.get_value("spt_ingest_session_code"))
print("parent: ", session)
else:
session = None
if not session:
#session = SearchType.create("config/ingest_session")
#session.set_value("code", "session101")
#session.set_value("location", "local")
##session.set_value("base_dir", "C:")
top.add("No session defined!!!")
return top
rule = ""
filter = ""
ignore = ""
# get the base path
if sobject:
base_dir = sobject.get_value("base_dir")
else:
base_dir = ''
#else:
# base_dir = self.get_value("base_dir")
#if not base_dir:
# base_dir = ''
if sobject:
title = sobject.get_value("title")
else:
title = ''
if sobject:
code = sobject.get_value("code")
else:
code = ''
file_list = self.get_value("file_list")
scan_type = self.get_value("scan_type")
action_type = self.get_value("action_type")
rule = self.get_value("rule")
if not rule:
#.........这里部分代码省略.........