本文整理汇总了Python中pyasm.web.HtmlElement.h3方法的典型用法代码示例。如果您正苦于以下问题:Python HtmlElement.h3方法的具体用法?Python HtmlElement.h3怎么用?Python HtmlElement.h3使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyasm.web.HtmlElement
的用法示例。
在下文中一共展示了HtmlElement.h3方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_display
# 需要导入模块: from pyasm.web import HtmlElement [as 别名]
# 或者: from pyasm.web.HtmlElement import h3 [as 别名]
def get_display(my):
# just refresh the whole thing
widget = DivWdg()
outer_widget = DivWdg(css='spt_view_panel')
search_div = DivWdg()
search_bvr = {
'type': 'click_up',
'cbjs_action': 'spt.dg_table.search_cbk(evt, bvr)',
'override_class_name': 'tactic.ui.cgapp.AppShotPanelWdg',
'override_target': 'bvr.src_el.getParent(".spt_app_shot_panel")',
'extra_args': {'instance_search_type': my.instance_search_type,
'asset_search_type': my.asset_search_type}
#'panel_id': 'main_body_search'
}
# WARNING: this is made just for main search box and won't be compatible with the simple search wdg
search_wdg = SearchWdg(search_type=my.search_type, custom_search_view='search_shot_loader', parent_key='', filter=''\
, display='block', custom_filter_view='', state=None, run_search_bvr=search_bvr)
#from tactic.ui.app.simple_search_wdg import SimpleSearchWdg
#search_wdg = SimpleSearchWdg(search_type=my.search_type, search_view=my.simple_search_view, state=None, run_search_bvr=search_bvr)
search_div.add( HtmlElement.spacer_div(1,10) )
search_div.add(search_wdg)
# if there is result, it could only be one shot
search = search_wdg.get_search()
shots = search.get_sobjects()
# avoid getting a shot when no shot is selected
if not my.shot_code and len(shots) == 1:
my.shot_code = shots[0].get_code()
outer_widget.add(search_div)
my.set_as_panel(outer_widget, class_name='spt_panel spt_view_panel spt_app_shot_panel')
#show_shot_panel = False
#if show_shot_panel:
panel = ViewPanelWdg( search_type=my.search_type, \
inline_search=True, show_search='false', show_refresh='false', view=my.view, \
run_search_bvr=search_bvr, simple_search_view=my.simple_search_view)
panel.set_sobjects(shots)
widget.add(panel)
show_instances_in_shot = ProdSetting.get_value_by_key("show_instances_in_shot_panel")
if show_instances_in_shot != "false":
widget.add(HtmlElement.h3("Asset Instances in Shot [%s]" %my.shot_code))
widget.add(HtmlElement.br(2))
asset_inst_panel = AppAssetInstancePanelWdg(search_type=my.search_type, instance_search_type=my.instance_search_type, asset_search_type=my.asset_search_type, shot_code=my.shot_code, show_search='false')
widget.add(asset_inst_panel)
outer_widget.add(widget)
return outer_widget
示例2: get_display
# 需要导入模块: from pyasm.web import HtmlElement [as 别名]
# 或者: from pyasm.web.HtmlElement import h3 [as 别名]
def get_display(my):
web = WebContainer.get_web()
search_key = web.get_form_value("search_key")
widget = Widget()
sobject = Search.get_by_search_key(search_key)
table = TableWdg( sobject.get_search_type(), "render" )
table.set_sobject(sobject)
widget.add(table)
# get all of the snapshots with a context render
sobject_snapshot = Snapshot.get_latest_by_sobject(sobject,"render")
if sobject_snapshot:
search_type = sobject.get_search_type()
search_id = sobject.get_value('search_id')
render_snapshots = Snapshot.get_by_search_type(search_type,search_id,"render")
table = TableWdg("sthpw/snapshot")
table.set_sobjects(render_snapshots)
widget.add(table)
widget.add(HtmlElement.h3("Rendered Frames"))
if sobject_snapshot:
widget.add("Render version: v%0.3d" % sobject_snapshot.get_value("version") )
# get latest snapshot of the render
renders = Render.get_all_by_sobject(sobject)
if not renders:
widget.add("<h4>No renders found</h4>")
return widget
render = renders[0]
snapshot = Snapshot.get_latest_by_sobject(render,"render")
if snapshot == None:
widget.add("<h4>No snapshots found</h4>")
return widget
# get the images
web_dir = snapshot.get_web_dir()
lib_dir = snapshot.get_lib_dir()
xml = snapshot.get_xml_value("snapshot")
file_nodes = xml.get_nodes("snapshot/file")
file_name = icon_file_name = ''
frame_range = icon_frame_range = None
for file_node in file_nodes:
if Xml.get_attribute(file_node, 'type') == 'main':
file_name, frame_range = my._get_frame_info(file_node, sobject)
if Xml.get_attribute(file_node, 'type') == 'icon':
icon_file_name, icon_frame_range = my._get_frame_info(file_node, sobject)
file_names = [file_name]
icon_file_names = [icon_file_name]
if "##" in file_name:
file_names = FileGroup.expand_paths(file_name, frame_range)
if "##" in icon_file_name:
icon_file_names = FileGroup.expand_paths(icon_file_name, \
icon_frame_range)
div = DivWdg()
for k in range(len(file_names)):
file_name = file_names[k]
# ignore frames that don't exist
lib_path = "%s/%s" % (lib_dir, file_name)
if not os.path.exists(lib_path):
continue
try:
icon_file_name = icon_file_names[k]
except IndexError:
icon_file_name = file_names[k]
file_path = "%s/%s" % (web_dir, file_name)
icon_file_path = "%s/%s" % (web_dir, icon_file_name)
img = HtmlElement.img(icon_file_path)
img.set_attr("width", "60")
img.add_event("onmouseover","hint_bubble.show(event,'Ctrl + Click to open in new window')")
href = HtmlElement.href(img, file_path)
div.add(href)
widget.add(div)
widget.add( "<h3>Render History</h3>" )
widget.add( my.get_render_history(renders) )
return widget
示例3: get_display
# 需要导入模块: from pyasm.web import HtmlElement [as 别名]
# 或者: from pyasm.web.HtmlElement import h3 [as 别名]
def get_display(self):
if self.mode == 'detail':
upstream = True
div = DivWdg()
self.snapshot_code = self.kwargs.get('snapshot_code')
ref_snapshot = Snapshot.get_by_code(self.snapshot_code)
self._handle_snapshot(ref_snapshot, div, upstream, recursive=False)
return div
self.web = WebContainer.get_web()
if self.sobjects:
snapshot = self.sobjects[0]
else:
search_type = self.kwargs.get("search_type")
search_id = self.kwargs.get("search_id")
snapshot = None
if search_type == Snapshot.SEARCH_TYPE:
snapshot = Search.get_by_id(search_type, search_id)
else:
snapshot = Snapshot.get_latest(search_type, search_id)
if not snapshot:
self.add(HtmlElement.h3("No snapshot found"))
return super(DependencyWdg,self).get_display()
widget = DivWdg()
widget.add_style('min-width: 700px')
if self.show_title:
self.add(HtmlElement.h3("Asset Dependency"))
from tactic.ui.panel import TableLayoutWdg
table = TableLayoutWdg(search_type="sthpw/snapshot", mode='simple', view='table', width='700px')
table.add_style('min-width: 700px')
table.set_sobject(snapshot)
widget.add(table)
sobject = snapshot.get_sobject()
search_type_obj = sobject.get_search_type_obj()
#file_div = DivWdg(css='left_content discussion_child')
file_div = DivWdg()
file_div.add_color("background", "background", -20)
file_div.add_color("color", "color")
file_div.add_style("padding: 5px")
file_div.add_border()
#file_div.add_style('margin','0 10px 0 10px')
file_div.add_style('padding','10px 0 0 10px')
#file_div.add_style('-moz-border-radius: 6px')
title = DivWdg()
title.add_style("font-weight: bold")
title.add_style("font-size: 1.2em")
#title.add_style('margin-left', '10px')
if self.show_title:
title.add(search_type_obj.get_title() )
title.add(" - ")
title.add(sobject.get_code() )
if sobject.has_value("description"):
title.add(" : ")
title.add(sobject.get_value("description") )
file_div.add(title)
file_div.add(HtmlElement.br())
# find out how many 1st level ref nodes we are dealing with
xml = snapshot.get_xml_value("snapshot")
#self.total_ref_count = len(xml.get_nodes("snapshot/file/ref | snapshot/ref |snapshot/input_ref| snapshot/fref"))
self._handle_snapshot(snapshot, file_div, upstream=True, recursive=True )
self._handle_snapshot(snapshot, file_div, upstream=False, recursive=True )
#widget.add(widget)
widget.add(file_div)
widget.add(HtmlElement.br(2))
#return super(DependencyWdg,self).get_display()
return widget
示例4: init
# 需要导入模块: from pyasm.web import HtmlElement [as 别名]
# 或者: from pyasm.web.HtmlElement import h3 [as 别名]
def init(my):
# get the args in the URL
args = WebContainer.get_web().get_form_args()
search_type = args['search_type']
search_id = args['search_id']
sobject = Search.get_by_id(search_type, search_id)
main_div = DivWdg()
main_div.add_style("width: 95%")
main_div.add_style("float: right")
my.add(main_div)
if isinstance(sobject, Shot):
content_id ='summary_story_%s' %sobject.get_id()
title_id = 'story_head_%s' %sobject.get_id()
story_div = DivWdg(id=content_id)
story_div.add_style('display','block')
story_head = HtmlElement.h3("Storyboard")
my.add_title_style(story_head, title_id, content_id)
main_div.add(story_head)
main_div.add(story_div)
storyboard_table = TableWdg("prod/storyboard", "summary", css='minimal')
search = Search("prod/storyboard")
search.add_filter( sobject.get_foreign_key(), sobject.get_code() )
sobjects = search.get_sobjects()
storyboard_table.set_sobjects(sobjects)
story_div.add(storyboard_table)
# add reference material
search = Search("sthpw/connection")
search.add_filter("src_search_type", search_type)
search.add_filter("src_search_id", search_id)
connections = search.get_sobjects()
if connections:
content_id ='summary_ref_%s' %sobject.get_id()
title_id = 'ref_head_%s' %sobject.get_id()
ref_head = HtmlElement.h3("Reference")
my.add_title_style(ref_head, title_id, content_id)
ref_div = DivWdg(id = content_id)
ref_div.add_style('display','block')
for connection in connections:
thumb = ThumbWdg()
thumb.set_name("snapshot")
dst_search_type = connection.get_value("dst_search_type")
dst_search_id = connection.get_value("dst_search_id")
dst = Search.get_by_id(dst_search_type, dst_search_id)
thumb.set_sobject(dst)
ref_div.add(thumb)
main_div.add(ref_head)
main_div.add(ref_div)
task_head = HtmlElement.h3("Tasks")
content_id ='summary_task_%s' %sobject.get_id()
title_id = 'task_head_%s' %sobject.get_id()
my.add_title_style(task_head, title_id, content_id)
main_div.add(task_head)
task_div = DivWdg(id=content_id)
task_div.add_style('display','block')
main_div.add(task_div)
search = Search("sthpw/task")
#if process != "":
# search.add_filter("process", process)
search.add_filter("search_type", search_type)
search.add_filter("search_id", search_id)
#search.set_limit(4)
task_table = TableWdg("sthpw/task", "summary", css='minimal')
task_table.set_id('sthpw/task%s' % search_id)
task_table.set_search(search)
task_div.add(task_table)
content_id ='summary_hist_%s' %sobject.get_id()
title_id = 'hist_head_%s' %sobject.get_id()
hist_head = HtmlElement.h3("Checkin History")
my.add_title_style(hist_head, title_id, content_id)
hist_div = DivWdg(id=content_id)
hist_div.add_style('display','block')
#.........这里部分代码省略.........