当前位置: 首页>>代码示例>>Python>>正文


Python HTML.span方法代码示例

本文整理汇总了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&note={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")
开发者ID:LaboJeanPerrin,项目名称:Lab.notes,代码行数:70,代码来源:Spot.py


注:本文中的HTML.HTML.span方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。