本文整理汇总了Python中pyasm.widget.TextAreaWdg.set_persist_on_submit方法的典型用法代码示例。如果您正苦于以下问题:Python TextAreaWdg.set_persist_on_submit方法的具体用法?Python TextAreaWdg.set_persist_on_submit怎么用?Python TextAreaWdg.set_persist_on_submit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyasm.widget.TextAreaWdg
的用法示例。
在下文中一共展示了TextAreaWdg.set_persist_on_submit方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: handle_instance
# 需要导入模块: from pyasm.widget import TextAreaWdg [as 别名]
# 或者: from pyasm.widget.TextAreaWdg import set_persist_on_submit [as 别名]
def handle_instance(my, table, instance, asset, node_name='', publish=True, allow_ref_checkin=False):
# handle the case where asset is not defined
if not asset:
table.add_row()
table.add_blank_cell()
table.add_blank_cell()
# FIXME: Maya specific
parts = instance.split(":")
instance_name = parts[0]
asset_code = parts[1]
if instance_name == asset_code:
table.add_cell(instance_name)
else:
table.add_cell(instance)
td = table.add_cell()
td.add("< %s node >" % my.session.get_node_type(instance_name))
table.add_blank_cell()
return
# get the pipeline for this asset and handlers for the pipeline
process_name = my.process_select.get_value()
handler_hidden = my.get_handler_input(asset, process_name)
pipeline = Pipeline.get_by_sobject(asset)
# TEST: switch this to using node name instead, if provided
if node_name:
instance_node = my.session.get_node(node_name)
else:
instance_node = my.session.get_node(instance)
if instance_node is None:
return
if Xml.get_attribute(instance_node,"reference") == "true":
is_ref = True
else:
is_ref = False
namespace = Xml.get_attribute(instance_node, "namespace")
if not namespace:
namespace = instance
asset_code = asset.get_code()
is_set = False
if asset.get_value('asset_type', no_exception=True) in ['set','section']:
is_set = True
tr = table.add_row()
if is_set:
tr.add_class("group")
if publish and (allow_ref_checkin or not is_ref):
checkbox = CheckboxWdg("asset_instances")
if is_set:
checkbox = CheckboxWdg("set_instances")
checkbox.set_option("value", "%s|%s|%s" % \
(namespace, asset_code, instance) )
checkbox.set_persist_on_submit()
td = table.add_cell(checkbox)
else:
td = table.add_blank_cell()
# only one will be added even if there are multiple
if handler_hidden:
td.add(handler_hidden)
# add the thumbnail
thumb = ThumbWdg()
thumb.set_name("images")
thumb.set_sobject(asset)
thumb.set_icon_size(60)
table.add_cell(thumb)
info_wdg = Widget()
info_wdg.add(HtmlElement.b(instance))
if not node_name:
node_name = '%s - %s' %(asset_code, asset.get_name())
info_div = DivWdg(node_name)
info_div.add_style('font-size: 0.8em')
info_wdg.add(info_div)
info_div.add(HtmlElement.br(2))
if pipeline:
info_div.add(pipeline.get_code())
table.add_cell(info_wdg)
# by default can't checkin references
if not allow_ref_checkin and is_ref:
#icon = IconWdg("error", IconWdg.ERROR)
#.........这里部分代码省略.........