當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。