本文整理汇总了Python中pyasm.web.HtmlElement.span方法的典型用法代码示例。如果您正苦于以下问题:Python HtmlElement.span方法的具体用法?Python HtmlElement.span怎么用?Python HtmlElement.span使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyasm.web.HtmlElement
的用法示例。
在下文中一共展示了HtmlElement.span方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: init
# 需要导入模块: from pyasm.web import HtmlElement [as 别名]
# 或者: from pyasm.web.HtmlElement import span [as 别名]
def init(self):
if self.icon_path.startswith("BS") or self.icon_path.startswith("FA"):
icon_path = self.icon_path
elif not self.icon_path.startswith("/"):
# icon_path = "/context/icons/oo/%s" % self.icon_path
icon_path = "/context/icons/silk/%s" % self.icon_path
else:
icon_path = self.icon_path
if icon_path.startswith("BS_"):
icon = HtmlElement.span()
icon.add_class("glyphicon")
part = icon_path.replace("BS_", "")
part = part.lower()
part = part.replace("_","-")
if part == "save":
part = "floppy-disk"
icon.add_class("glyphicon-%s" % part)
if not self.size:
self.size = "16px"
icon.add_style("font-size: %s" % self.size)
if not self.opacity:
self.opacity = 0.6
elif icon_path.startswith("FA"):
icon = HtmlElement.i()
icon.add_class("fa")
part = icon_path.replace("FA_", "")
part = part.lower()
part = part.replace("_","-")
icon.add_class("fa-%s" % part)
if not self.size:
self.size = "16px"
icon.add_style("font-size: %s" % self.size)
if not self.opacity:
self.opacity = 0.6
else:
icon = HtmlElement.img(icon_path)
if self.opacity:
icon.add_style("opacity: %s" % self.opacity)
if self.text and self.text != "":
icon.set_attr("title", self.text)
if self.right_margin:
icon.add_style("margin-right: %s" % self.right_margin)
self.icon = icon
inline = self.kwargs.get("inline")
if inline in [False, 'false']:
self.add_style("float: left")
else:
self.add_style("display: inline")
示例2: get_display
# 需要导入模块: from pyasm.web import HtmlElement [as 别名]
# 或者: from pyasm.web.HtmlElement import span [as 别名]
def get_display(my):
div = DivWdg(css='left_content')
div.set_style("margin-top: 10px; margin-bottom: 20px;")
# add some spacing
span = SpanWdg()
span.set_class('tab_front')
div.add(span)
# figure out which is the selected one
selected_index = 0
for i in range(0, len(my.tab_names)):
tab_name = my.tab_names[i]
if tab_name == my.tab_value:
selected_index = i
break
for i in range(0, len(my.tab_names)):
tab_name = my.tab_names[i]
widget = my.get_widget(tab_name)
tab = HtmlElement.span()
tab.set_attr('name', my.tab_group_name)
# required by IE
tab.set_id(my.tab_group_name)
tab.set_attr('tab', tab_name)
if i == selected_index:
# selected tab
tab.set_class("%s_selected" %my.get_style_prefix())
my.content_div.add(widget)
else:
# unselected tab
tab.set_class("%s_unselected" %my.get_style_prefix())
tab.add( my.get_header(tab_name) )
div.add(tab)
# display the content
my.content_div.set_id(my.content_div_id)
my.content_div.set_class("%s_content" %my.get_style_prefix())
my.content_div.add_style("display: block")
div.add(my.content_div)
return div
示例3: init
# 需要导入模块: from pyasm.web import HtmlElement [as 别名]
# 或者: from pyasm.web.HtmlElement import span [as 别名]
def init(my):
web = WebContainer.get_web()
my.add(HeaderWdg())
undo_redo = HtmlElement.span()
undo_redo.add_style("float", "right")
undo_redo.add_style("margin", "5px 5px")
undo_redo.add(UndoButtonWdg())
undo_redo.add(RedoButtonWdg())
undo_redo.add(IconRefreshWdg())
my.add_widget( undo_redo )
tab = MainTabWdg()
my.add(tab)
示例4: init
# 需要导入模块: from pyasm.web import HtmlElement [as 别名]
# 或者: from pyasm.web.HtmlElement import span [as 别名]
def init(my):
if my.icon_path.startswith("BS"):
icon_path = my.icon_path
elif not my.icon_path.startswith("/"):
# icon_path = "/context/icons/oo/%s" % my.icon_path
icon_path = "/context/icons/silk/%s" % my.icon_path
else:
icon_path = my.icon_path
if icon_path.startswith("BS_"):
icon = HtmlElement.span()
icon.add_class("glyphicon")
part = icon_path.replace("BS_", "")
part = part.lower()
part = part.replace("_","-")
icon.add_class("glyphicon-%s" % part)
if not my.size:
my.size = "16px"
icon.add_style("font-size: %s" % my.size)
if not my.opacity:
my.opacity = 0.6
else:
icon = HtmlElement.img(icon_path)
if my.opacity:
icon.add_style("opacity: %s" % my.opacity)
if my.text and my.text != "":
icon.set_attr("title", my.text)
if my.right_margin:
icon.add_style("margin-right: %s" % my.right_margin)
my.icon = icon
inline = my.kwargs.get("inline")
if inline in [False, 'false']:
my.add_style("float: left")
else:
my.add_style("display: inline")