本文整理汇总了Python中HTML.HTML.span方法的典型用法代码示例。如果您正苦于以下问题:Python HTML.span方法的具体用法?Python HTML.span怎么用?Python HTML.span使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTML.HTML
的用法示例。
在下文中一共展示了HTML.span方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from HTML import HTML [as 别名]
# 或者: from HTML.HTML import span [as 别名]
#.........这里部分代码省略.........
Plist = []
while True:
Plist.extend([P])
if P == 0:
break
else:
tmp = tree.single("SELECT parent FROM Elements WHERE id=?", P)
P = tmp["parent"]
# Display navbar
for P in reversed(Plist):
ref = self.html.ref
if P:
# --- Spacer
tmp = self.html.div(0, cls="nav_cont")
self.html.a(tmp, "#", id="nav_spacer_{0}".format(P), cls="nav_spacer")
self.html.text(0, "▼", decode=False)
# --- Element
res = tree.single("SELECT * FROM Elements WHERE id=?", P)
if res["type"] == "group":
if P == int(last) and not page:
if res["name"]:
self.html.p(tmp, cls="nav_elm_group nav_elm_mod", contenteditable="true")
self.html.text(0, res["name"])
else:
self.html.p(tmp, cls="nav_elm_group nav_elm_mod nav_elm_mod_empty", contenteditable="true")
self.html.span(0, cls="nav_undef")
self.html.text(0, "Group {0}".format(P))
else:
self.html.a(tmp, "?spot=home&parent={0}".format(P), cls="nav_elm_group")
if res["name"]:
self.html.text(0, res["name"])
else:
self.html.span(0, cls="nav_undef")
self.html.text(0, "Group {0}".format(P))
elif res["type"] == "note":
if P == int(last) and not page:
if res["name"]:
self.html.p(tmp, cls="nav_elm_note nav_elm_mod", contenteditable="true")
self.html.text(0, res["name"])
else:
self.html.p(tmp, cls="nav_elm_note nav_elm_mod nav_elm_mod_empty", contenteditable="true")
self.html.span(0, cls="nav_undef")
self.html.text(0, "Note {0}".format(P))
else:
self.html.a(tmp, "?spot=note¬e={0}".format(P), cls="nav_elm_note")
if res["name"]:
self.html.text(0, res["name"])
else:
self.html.span(0, cls="nav_undef")
self.html.text(0, "Note {0}".format(P))
# --- List
tmp = self.html.div(tmp, id="nav_list_{0}".format(P), cls="nav_list")