本文整理汇总了Python中pyasm.web.HtmlElement.h2方法的典型用法代码示例。如果您正苦于以下问题:Python HtmlElement.h2方法的具体用法?Python HtmlElement.h2怎么用?Python HtmlElement.h2使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyasm.web.HtmlElement
的用法示例。
在下文中一共展示了HtmlElement.h2方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_page_header
# 需要导入模块: from pyasm.web import HtmlElement [as 别名]
# 或者: from pyasm.web.HtmlElement import h2 [as 别名]
def get_page_header(string):
"""
Given a string, return a DivWdg containing the string in an H1 tag
:param string: String
:return: HtmlElement.label
"""
return HtmlElement.h2(string)
示例2: get_display
# 需要导入模块: from pyasm.web import HtmlElement [as 别名]
# 或者: from pyasm.web.HtmlElement import h2 [as 别名]
#.........这里部分代码省略.........
category_div.add(category)
category_div.add_style("padding: 8px")
category_div.add_style("font-size: 16px")
category_div.add_style("font-weight: bold")
category_div.add_color("color", "color")
category_div.add_gradient("background", "background3",0, -10)
category_div.add_color("color", "color3")
#category_div.set_round_corners()
if last_category == None:
category_div.add_style("margin: -6 -6 6 -6")
else:
category_div.add_style("margin: 15 -6 0 -6")
table.add_row()
has_category = True
index = 0
index += 1
last_category = category
thumb = ThumbWdg()
thumb.set_name("snapshot")
thumb.set_sobject(project)
thumb.set_show_clipboard(False)
thumb.set_has_img_link(False)
thumb.set_icon_size(icon_size)
code = project.get_code()
title = project.get_value("title")
# Restrict the length of project name
if len(title) >= 36:
title = title[:36] + "..."
if app_name != 'Browser':
href = HtmlElement.href(HtmlElement.h2(title), ref='/tactic/%s/%s'\
%(code, app_name))
img_href = HtmlElement.href(thumb, ref='/tactic/%s/%s'\
%(code, app_name))
link = '/tactic/%s/%s' % (code, app_name)
else:
href = HtmlElement.href(HtmlElement.h2(title), ref="/tactic/%s/" % code)
img_href = DivWdg(thumb)
img_href.add_behavior( {
'type': 'click_up',
'code': code,
'cbjs_action': '''
document.location = '/tactic/'+bvr.code+'/';
'''
} )
link = '/tactic/%s/' % code
href = href.get_buffer_display()
if (index-1) % columns == 0:
table.add_row()
td = table.add_cell()
img_div = DivWdg()
img_div.add(img_href)
img_div.add_style("margin-right: 20px")
img_div.add_style("float: left")
img_div.add_border()
#img_div.set_round_corners()
img_div.set_box_shadow("0px 1px 5px")
project_div = DivWdg()