本文整理匯總了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)
#.........這裏部分代碼省略.........