本文整理汇总了Python中pyasm.web.HtmlElement.set_attr方法的典型用法代码示例。如果您正苦于以下问题:Python HtmlElement.set_attr方法的具体用法?Python HtmlElement.set_attr怎么用?Python HtmlElement.set_attr使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyasm.web.HtmlElement
的用法示例。
在下文中一共展示了HtmlElement.set_attr方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: add_no_option
# 需要导入模块: from pyasm.web import HtmlElement [as 别名]
# 或者: from pyasm.web.HtmlElement import set_attr [as 别名]
def add_no_option(my, sel_el):
option = HtmlElement('option')
option.set_attr( "value", "" )
option.add( "-- No Options Found --" )
sel_el.add( option )
option = HtmlElement('option')
option.set_attr( "value", "" )
no_value_label = "-- No Filter Value Found --"
if my.kwargs.get('no_value_found_label'):
no_value_label = my.kwargs.get('no_value_found_label')
option.add( no_value_label )
sel_el.add( option )
示例2: init
# 需要导入模块: from pyasm.web import HtmlElement [as 别名]
# 或者: from pyasm.web.HtmlElement import set_attr [as 别名]
def init(my):
div_main = DivWdg(css='module')
if my.width != None:
widthstr="width: %sem" % (my.width)
div_main.add_style(widthstr)
# reset my.name, create the content widget
if not my.shad_name:
my.shad_name = "ShadowBox%s" % (my.generate_unique_id())
div_main.set_id(my.shad_name)
div_main.center()
div_head = DivWdg(css='boxhead')
# HACK to compensate for IE weird handling of CSS
if WebContainer.get_web().is_IE() and 'password' in my.shad_name:
div_head.add_style('left','-242px')
div_head.add_style('padding-bottom: 2px')
empty_header = Widget(name=my.HEADER)
div_head.add(empty_header, empty_header.get_name())
div_head.add(my.title_wdg, my.title_wdg.get_name())
div_control = DivWdg(css='control')
empty_control = Widget(name=my.CONTROL)
div_control.add(empty_header, empty_control.get_name())
div_container = DivWdg(css='container')
ie_rect = HtmlElement('v:roundrect')
ie_rect.set_attr("arcsize", "1966f")
ie_rect.set_attr("fillcolor", "white")
ie_rect.set_attr("strokecolor", "#555")
ie_rect.set_attr("strokeweight", "2pt")
div_body = DivWdg(css='content')
div_body.set_id("%s_cont" % my.shad_name)
div_body.center()
div_body.add(div_head)
div_body.add(div_control)
my.content = div_main
my.head = div_head
my.control = div_control
my.body = div_body
div_container.add(ie_rect)
ie_rect.add(div_body)
#div_main.add(div_head)
div_main.add(div_container)
示例3: init
# 需要导入模块: from pyasm.web import HtmlElement [as 别名]
# 或者: from pyasm.web.HtmlElement import set_attr [as 别名]
def init(self):
#print "DEPRECATED"
#raise TacticException("Use of GeneralAppletWdg is Deprecated")
# it's generated thru JS in IE
if WebContainer.get_web().is_IE():
return
context_url = WebContainer.get_web().get_context_url()
print "-"*20
print self.APPLET_CLASS
# create applet
applet = HtmlElement("applet")
applet.set_attr("code", self.APPLET_CLASS)
applet.set_attr("codebase", "%s/java" % context_url.get_url() )
applet.set_attr("archive", self.APPLET_JAR)
applet.set_attr("width", "1")
applet.set_attr("height", "1")
applet.set_attr("id", self.APPLET_ID)
# create param for applet
param = HtmlElement("param")
param.set_attr("name","scriptable")
param.set_attr("value","true")
applet.add(param)
self.add(applet)