• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python tags.legend函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中nevow.tags.legend函数的典型用法代码示例。如果您正苦于以下问题:Python legend函数的具体用法?Python legend怎么用?Python legend使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了legend函数的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: render_forms

    def render_forms(self, ctx, data):
        forms = []

        if self.node.is_readonly():
            return T.div["No upload forms: directory is read-only"]
        if self.dirnode_children is None:
            return T.div["No upload forms: directory is unreadable"]

        mkdir = T.form(action=".", method="post",
                       enctype="multipart/form-data")[
            T.fieldset[
            T.input(type="hidden", name="t", value="mkdir"),
            T.input(type="hidden", name="when_done", value="."),
            T.legend(class_="freeform-form-label")["Create a new directory in this directory"],
            "New directory name: ",
            T.input(type="text", name="name"), " ",
            T.input(type="submit", value="Create"),
            ]]
        forms.append(T.div(class_="freeform-form")[mkdir])

        upload = T.form(action=".", method="post",
                        enctype="multipart/form-data")[
            T.fieldset[
            T.input(type="hidden", name="t", value="upload"),
            T.input(type="hidden", name="when_done", value="."),
            T.legend(class_="freeform-form-label")["Upload a file to this directory"],
            "Choose a file to upload: ",
            T.input(type="file", name="file", class_="freeform-input-file"),
            " ",
            T.input(type="submit", value="Upload"),
            " Mutable?:",
            T.input(type="checkbox", name="mutable"),
            ]]
        forms.append(T.div(class_="freeform-form")[upload])

        mount = T.form(action=".", method="post",
                        enctype="multipart/form-data")[
            T.fieldset[
            T.input(type="hidden", name="t", value="uri"),
            T.input(type="hidden", name="when_done", value="."),
            T.legend(class_="freeform-form-label")["Add a link to a file or directory which is already in Tahoe-LAFS."],
            "New child name: ",
            T.input(type="text", name="name"), " ",
            "URI of new child: ",
            T.input(type="text", name="uri"), " ",
            T.input(type="submit", value="Attach"),
            ]]
        forms.append(T.div(class_="freeform-form")[mount])
        return forms
开发者ID:drewp,项目名称:tahoe-lafs,代码行数:49,代码来源:directory.py


示例2: rend

    def rend(self, context, data):
        context.remember(data, iformless.IBinding)

        from formless import configurable as conf

        configurable = conf.GroupConfigurable(data.boundTo, data.typedValue.iface)
        context.remember(configurable, iformless.IConfigurable)

        bindingNames = configurable.getBindingNames(context)

        def generateBindings():
            for name in bindingNames:
                bnd = configurable.getBinding(context, name)
                renderer = iformless.IBindingRenderer(bnd, defaultBindingRenderer)
                renderer.isGrouped = True
                renderer.needsSkin = True
                yield tags.invisible(
                    data=bnd,
                    render=renderer,
                    key=name)

        return getError(context), tags.form(
            id=keyToXMLID(context.key),
            enctype="multipart/form-data",
            action=calculatePostURL(context, data),
            method="post",
            **{'accept-charset':'utf-8'})[
                tags.fieldset[
                    tags.legend(_class="freeform-form-label")[data.label],
                    tags.input(type='hidden', name='_charset_'),
                    generateBindings(),
                    tags.input(type="submit")]]
开发者ID:StetHD,项目名称:nevow,代码行数:32,代码来源:webform.py


示例3: render_check_form

    def render_check_form(self, ctx, data):
        node = self.original
        quoted_uri = urllib.quote(node.get_uri())
        target = self.get_root(ctx) + "/uri/" + quoted_uri
        if IDirectoryNode.providedBy(node):
            target += "/"
        check = T.form(action=target, method="post",
                       enctype="multipart/form-data")[
            T.fieldset[
            T.input(type="hidden", name="t", value="check"),
            T.input(type="hidden", name="return_to", value="."),
            T.legend(class_="freeform-form-label")["Check on this object"],
            T.div[
            "Verify every bit? (EXPENSIVE):",
            T.input(type="checkbox", name="verify"),
            ],
            T.div["Repair any problems?: ",
                  T.input(type="checkbox", name="repair")],
            T.div["Add/renew lease on all shares?: ",
                  T.input(type="checkbox", name="add-lease")],
            T.div["Emit results in JSON format?: ",
                  T.input(type="checkbox", name="output", value="JSON")],

            T.input(type="submit", value="Check"),

            ]]
        return ctx.tag[check]
开发者ID:ArtRichards,项目名称:tahoe-lafs,代码行数:27,代码来源:info.py


示例4: render_upload_form

    def render_upload_form(self, ctx, data):
        # This is a form where users can upload unlinked files.
        # Users can choose immutable, SDMF, or MDMF from a radio button.

        upload_chk  = T.input(type='radio', name='format',
                              value='chk', id='upload-chk',
                              checked='checked')
        upload_sdmf = T.input(type='radio', name='format',
                              value='sdmf', id='upload-sdmf')
        upload_mdmf = T.input(type='radio', name='format',
                              value='mdmf', id='upload-mdmf')

        form = T.form(action="uri", method="post",
                      enctype="multipart/form-data")[
            T.fieldset[
            T.legend(class_="freeform-form-label")["Upload a file"],
            T.div["Choose a file:"+SPACE,
                  T.input(type="file", name="file", class_="freeform-input-file")],
            T.input(type="hidden", name="t", value="upload"),
            T.div[upload_chk,  T.label(for_="upload-chk") [" Immutable"],           SPACE,
                  upload_sdmf, T.label(for_="upload-sdmf")[" SDMF"],                SPACE,
                  upload_mdmf, T.label(for_="upload-mdmf")[" MDMF (experimental)"], SPACE*2,
                  T.input(type="submit", value="Upload!")],
            ]]
        return T.div[form]
开发者ID:warner,项目名称:tahoe-lafs,代码行数:25,代码来源:root.py


示例5: calculateDefaultSkin

    def calculateDefaultSkin(self, context):
        if self.isGrouped:
            frm = tags.invisible
            butt = ""
            fld = tags.invisible
        else:
            frm = tags.form(
                id=slot("form-id"),
                name=slot("form-id"),
                action=slot("form-action"),
                method="post",
                enctype="multipart/form-data",
                **{"accept-charset": "utf-8"}
            )
            butt = slot("form-button")
            fld = tags.fieldset[tags.input(type="hidden", name="_charset_")]

        ## Provide default skin since no skin was provided for us.
        context.tag.clear()[
            frm[
                fld[
                    tags.legend(_class="freeform-form-label")[slot("form-label")],
                    tags.div(_class="freeform-form-description")[slot("form-description")],
                    tags.div(_class="freeform-form-error")[slot("form-error")],
                    slot("form-arguments"),
                    butt,
                ]
            ]
        ]
开发者ID:perkinslr,项目名称:nevow-py3,代码行数:29,代码来源:webform.py


示例6: render_mkdir_form

 def render_mkdir_form(self, ctx, data):
     # this is a form where users can create new directories
     form = T.form(action="uri", method="post",
                   enctype="multipart/form-data")[
         T.fieldset[
         T.legend(class_="freeform-form-label")["Create a directory"],
         T.input(type="hidden", name="t", value="mkdir"),
         T.input(type="hidden", name="redirect_to_result", value="true"),
         T.input(type="submit", value="Create a directory"),
         ]]
     return T.div[form]
开发者ID:drewp,项目名称:tahoe-lafs,代码行数:11,代码来源:root.py


示例7: render_deep_stats_form

 def render_deep_stats_form(self, ctx, data):
     ophandle = base32.b2a(os.urandom(16))
     deep_stats = T.form(action=".", method="post",
                         enctype="multipart/form-data")[
         T.fieldset[
         T.input(type="hidden", name="t", value="start-deep-stats"),
         T.legend(class_="freeform-form-label")["Run a deep-stats operation (EXPENSIVE)"],
         T.input(type="hidden", name="ophandle", value=ophandle),
         T.input(type="submit", value="Deep-Stats"),
         ]]
     return ctx.tag[deep_stats]
开发者ID:ArtRichards,项目名称:tahoe-lafs,代码行数:11,代码来源:info.py


示例8: render_incident_button

 def render_incident_button(self, ctx, data):
     # this button triggers a foolscap-logging "incident"
     form = T.form(action="report_incident", method="post",
                   enctype="multipart/form-data")[
         T.fieldset[
         T.legend(class_="freeform-form-label")["Report an Incident"],
         T.input(type="hidden", name="t", value="report-incident"),
         "What went wrong?: ",
         T.input(type="text", name="details"), " ",
         T.input(type="submit", value="Report!"),
         ]]
     return T.div[form]
开发者ID:drewp,项目名称:tahoe-lafs,代码行数:12,代码来源:root.py


示例9: render_view_form

 def render_view_form(self, ctx, data):
     # this is a form where users can download files by URI, or jump to a
     # named directory
     form = T.form(action="uri", method="get",
                   enctype="multipart/form-data")[
         T.fieldset[
         T.legend(class_="freeform-form-label")["View a file or directory"],
         "Tahoe-URI to view: ",
         T.input(type="text", name="uri"), " ",
         T.input(type="submit", value="View!"),
         ]]
     return T.div[form]
开发者ID:drewp,项目名称:tahoe-lafs,代码行数:12,代码来源:root.py


示例10: render_upload_form

 def render_upload_form(self, ctx, data):
     # this is a form where users can upload unlinked files
     form = T.form(action="uri", method="post",
                   enctype="multipart/form-data")[
         T.fieldset[
         T.legend(class_="freeform-form-label")["Upload a file"],
         T.div["Choose a file: ",
               T.input(type="file", name="file", class_="freeform-input-file")],
         T.input(type="hidden", name="t", value="upload"),
         T.div[T.input(type="checkbox", name="mutable"), T.label(for_="mutable")["Create mutable file"],
               " ", T.input(type="submit", value="Upload!")],
         ]]
     return T.div[form]
开发者ID:drewp,项目名称:tahoe-lafs,代码行数:13,代码来源:root.py


示例11: render_download_form

 def render_download_form(self, ctx, data):
     # this is a form where users can download files by URI
     form = T.form(action="uri", method="get",
                   enctype="multipart/form-data")[
         T.fieldset[
         T.legend(class_="freeform-form-label")["Download a file"],
         T.div["Tahoe-URI to download: ",
               T.input(type="text", name="uri")],
         T.div["Filename to download as: ",
               T.input(type="text", name="filename")],
         T.input(type="submit", value="Download!"),
         ]]
     return T.div[form]
开发者ID:drewp,项目名称:tahoe-lafs,代码行数:13,代码来源:root.py


示例12: render_overwrite_form

 def render_overwrite_form(self, ctx, data):
     node = self.original
     root = self.get_root(ctx)
     action = "%s/uri/%s" % (root, urllib.quote(node.get_uri()))
     done_url = "%s/uri/%s?t=info" % (root, urllib.quote(node.get_uri()))
     overwrite = T.form(action=action, method="post",
                        enctype="multipart/form-data")[
         T.fieldset[
         T.input(type="hidden", name="t", value="upload"),
         T.input(type='hidden', name='when_done', value=done_url),
         T.legend(class_="freeform-form-label")["Overwrite"],
         "Upload new contents: ",
         T.input(type="file", name="file"),
         " ",
         T.input(type="submit", value="Replace Contents")
         ]]
     return ctx.tag[overwrite]
开发者ID:ArtRichards,项目名称:tahoe-lafs,代码行数:17,代码来源:info.py


示例13: render_manifest_form

 def render_manifest_form(self, ctx, data):
     ophandle = base32.b2a(os.urandom(16))
     manifest = T.form(action=".", method="post",
                         enctype="multipart/form-data")[
         T.fieldset[
         T.input(type="hidden", name="t", value="start-manifest"),
         T.legend(class_="freeform-form-label")["Run a manifest operation (EXPENSIVE)"],
         T.div["Output Format: ",
               T.select(name="output")
               [ T.option(value="html", selected="true")["HTML"],
                 T.option(value="text")["text"],
                 T.option(value="json")["JSON"],
                 ],
               ],
         T.input(type="hidden", name="ophandle", value=ophandle),
         T.input(type="submit", value="Manifest"),
         ]]
     return ctx.tag[manifest]
开发者ID:ArtRichards,项目名称:tahoe-lafs,代码行数:18,代码来源:info.py


示例14: render_mkdir_form

 def render_mkdir_form(self, ctx, data):
     # this is a form where users can create new directories
     mdmf_input = T.input(type='radio', name='mutable-type',
                          value='mdmf', id='mutable-directory-mdmf')
     sdmf_input = T.input(type='radio', name='mutable-type',
                          value='sdmf', id='mutable-directory-sdmf',
                          checked='checked')
     form = T.form(action="uri", method="post",
                   enctype="multipart/form-data")[
         T.fieldset[
         T.legend(class_="freeform-form-label")["Create a directory"],
         T.label(for_='mutable-directory-sdmf')["SDMF"],
         sdmf_input,
         T.label(for_='mutable-directory-mdmf')["MDMF"],
         mdmf_input,
         T.input(type="hidden", name="t", value="mkdir"),
         T.input(type="hidden", name="redirect_to_result", value="true"),
         T.input(type="submit", value="Create a directory"),
         ]]
     return T.div[form]
开发者ID:jsgf,项目名称:tahoe-lafs,代码行数:20,代码来源:root.py


示例15: render_mkdir_form

    def render_mkdir_form(self, ctx, data):
        # This is a form where users can create new directories.
        # Users can choose SDMF or MDMF from a radio button.

        mkdir_sdmf = T.input(type='radio', name='format',
                             value='sdmf', id='mkdir-sdmf',
                             checked='checked')
        mkdir_mdmf = T.input(type='radio', name='format',
                             value='mdmf', id='mkdir-mdmf')

        form = T.form(action="uri", method="post",
                      enctype="multipart/form-data")[
            T.fieldset[
            T.legend(class_="freeform-form-label")["Create a directory"],
            mkdir_sdmf, T.label(for_='mkdir-sdmf')[" SDMF"],                SPACE,
            mkdir_mdmf, T.label(for_='mkdir-mdmf')[" MDMF (experimental)"], SPACE*2,
            T.input(type="hidden", name="t", value="mkdir"),
            T.input(type="hidden", name="redirect_to_result", value="true"),
            T.input(type="submit", value="Create a directory"),
            ]]
        return T.div[form]
开发者ID:warner,项目名称:tahoe-lafs,代码行数:21,代码来源:root.py


示例16: render_upload_form

    def render_upload_form(self, ctx, data):
        # this is a form where users can upload unlinked files
        #
        # for mutable files, users can choose the format by selecting
        # MDMF or SDMF from a radio button. They can also configure a
        # default format in tahoe.cfg, which they rightly expect us to
        # obey. we convey to them that we are obeying their choice by
        # ensuring that the one that they've chosen is selected in the
        # interface.
        if self.client.mutable_file_default == MDMF_VERSION:
            mdmf_input = T.input(type='radio', name='mutable-type',
                                 value='mdmf', id='mutable-type-mdmf',
                                 checked='checked')
        else:
            mdmf_input = T.input(type='radio', name='mutable-type',
                                 value='mdmf', id='mutable-type-mdmf')

        if self.client.mutable_file_default == SDMF_VERSION:
            sdmf_input = T.input(type='radio', name='mutable-type',
                                 value='sdmf', id='mutable-type-sdmf',
                                 checked='checked')
        else:
            sdmf_input = T.input(type='radio', name='mutable-type',
                                 value='sdmf', id='mutable-type-sdmf')


        form = T.form(action="uri", method="post",
                      enctype="multipart/form-data")[
            T.fieldset[
            T.legend(class_="freeform-form-label")["Upload a file"],
            T.div["Choose a file: ",
                  T.input(type="file", name="file", class_="freeform-input-file")],
            T.input(type="hidden", name="t", value="upload"),
            T.div[T.input(type="checkbox", name="mutable"), T.label(for_="mutable")["Create mutable file"],
                  sdmf_input, T.label(for_="mutable-type-sdmf")["SDMF"],
                  mdmf_input,
                  T.label(for_='mutable-type-mdmf')['MDMF (experimental)'],
                  " ", T.input(type="submit", value="Upload!")],
            ]]
        return T.div[form]
开发者ID:jsgf,项目名称:tahoe-lafs,代码行数:40,代码来源:root.py


示例17: render_deep_check_form

    def render_deep_check_form(self, ctx, data):
        ophandle = base32.b2a(os.urandom(16))
        deep_check = T.form(action=".", method="post",
                            enctype="multipart/form-data")[
            T.fieldset[
            T.input(type="hidden", name="t", value="start-deep-check"),
            T.input(type="hidden", name="return_to", value="."),
            T.legend(class_="freeform-form-label")["Run a deep-check operation (EXPENSIVE)"],
            T.div[
            "Verify every bit? (EVEN MORE EXPENSIVE):",
            T.input(type="checkbox", name="verify"),
            ],
            T.div["Repair any problems?: ",
                  T.input(type="checkbox", name="repair")],
            T.div["Add/renew lease on all shares?: ",
                  T.input(type="checkbox", name="add-lease")],
            T.div["Emit results in JSON format?: ",
                  T.input(type="checkbox", name="output", value="JSON")],

            T.input(type="hidden", name="ophandle", value=ophandle),
            T.input(type="submit", value="Deep-Check"),

            ]]
        return ctx.tag[deep_check]
开发者ID:ArtRichards,项目名称:tahoe-lafs,代码行数:24,代码来源:info.py


示例18: render_forms

    def render_forms(self, ctx, data):
        forms = []

        if self.node.is_readonly():
            return T.div["No upload forms: directory is read-only"]
        if self.dirnode_children is None:
            return T.div["No upload forms: directory is unreadable"]

        mkdir_sdmf = T.input(type='radio', name='format',
                             value='sdmf', id='mkdir-sdmf',
                             checked='checked')
        mkdir_mdmf = T.input(type='radio', name='format',
                             value='mdmf', id='mkdir-mdmf')

        mkdir_form = T.form(action=".", method="post",
                            enctype="multipart/form-data")[
            T.fieldset[
            T.input(type="hidden", name="t", value="mkdir"),
            T.input(type="hidden", name="when_done", value="."),
            T.legend(class_="freeform-form-label")["Create a new directory in this directory"],
            "New directory name:"+SPACE, T.br,
            T.input(type="text", name="name"), SPACE,
            T.div(class_="form-inline")[
                mkdir_sdmf, T.label(for_='mutable-directory-sdmf')[SPACE, "SDMF"], SPACE*2,
                mkdir_mdmf, T.label(for_='mutable-directory-mdmf')[SPACE, "MDMF (experimental)"]
            ],
            T.input(type="submit", class_="btn", value="Create")
            ]]
        forms.append(T.div(class_="freeform-form")[mkdir_form])

        upload_chk  = T.input(type='radio', name='format',
                              value='chk', id='upload-chk',
                              checked='checked')
        upload_sdmf = T.input(type='radio', name='format',
                              value='sdmf', id='upload-sdmf')
        upload_mdmf = T.input(type='radio', name='format',
                              value='mdmf', id='upload-mdmf')

        upload_form = T.form(action=".", method="post",
                             enctype="multipart/form-data")[
            T.fieldset[
            T.input(type="hidden", name="t", value="upload"),
            T.input(type="hidden", name="when_done", value="."),
            T.legend(class_="freeform-form-label")["Upload a file to this directory"],
            "Choose a file to upload:"+SPACE,
            T.input(type="file", name="file", class_="freeform-input-file"), SPACE,
            T.div(class_="form-inline")[
                upload_chk,  T.label(for_="upload-chk") [SPACE, "Immutable"], SPACE*2,
                upload_sdmf, T.label(for_="upload-sdmf")[SPACE, "SDMF"], SPACE*2,
                upload_mdmf, T.label(for_="upload-mdmf")[SPACE, "MDMF (experimental)"]
            ],
            T.input(type="submit", class_="btn", value="Upload"),             SPACE*2,
            ]]
        forms.append(T.div(class_="freeform-form")[upload_form])

        attach_form = T.form(action=".", method="post",
                             enctype="multipart/form-data")[
            T.fieldset[ T.div(class_="form-inline")[
                T.input(type="hidden", name="t", value="uri"),
                T.input(type="hidden", name="when_done", value="."),
                T.legend(class_="freeform-form-label")["Add a link to a file or directory which is already in Tahoe-LAFS."],
                "New child name:"+SPACE,
                T.input(type="text", name="name"), SPACE*2, T.br,
                "URI of new child:"+SPACE,
                T.input(type="text", name="uri"), SPACE,
                T.input(type="submit", class_="btn", value="Attach"),
            ]]]
        forms.append(T.div(class_="freeform-form")[attach_form])
        return forms
开发者ID:LeastAuthority,项目名称:tahoe-lafs,代码行数:69,代码来源:directory.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python tags.p函数代码示例发布时间:2022-05-27
下一篇:
Python tags.invisible函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap